Hello everybody,
I have made a program with java that includes processing.net.* libary. When I wanted to transform this program to arduino it says that the libary is not available in andorid so the program doesn't work. I wonder if there are any libary compatible like processing.net.* or something that allow me to do this prorgam:
`
import processing.net.*;
Client myClient;
//Definir variables
String incomingMessage;
int dato;
int valin=0;
int xin=0;
int x=1;
void setup() {
size(1000,400);
background(255);
// Connect to the local machine at port 5204.
// This example will not run if you haven't
// previously started a server on this port.
myClient = new Client(this, "192.168.1.1", 81);
myClient.write("start now");
}
void newstart(){
size(1000,400);
background(255);
}
void draw() { // Recibir el mensaje incomingMessage = myClient.readStringUntil('\n'); //Eliminar los espazcios blancos if (incomingMessage!=null){ incomingMessage = incomingMessage.trim(); //Cambio de variable int dato = Integer.parseInt(incomingMessage); println(dato); // Guardar la variable
//Graficar los datos
dato=399 - dato/10;
line(xin, valin, x, dato); //Forma una linea del punto anterior al nuevo punto
valin=dato; //Definición de la nueva y inicial
//Si los datos son más grandes que la ventana, restart
if (x>=1000){
newstart();
xin=0;
x=1;
}else{
xin=x; // Definición de la nueva x inicial
x++;
dato=dato+1;
}
} }
`
The programe is a client which sends a messatge to an arduino launchpad (server) and the launchpad starts sending a voltage value every second.
Thank you for your help!!!