Search in Pinguino World !!

Saturday, February 21, 2009

Pinguino with LA FONERA


we worked Friday with Benoit espinola on the link beetween LA FONERA and Pinguino. It Works !!
The FONERA was flashed with openwrt 7.09 and the ser2net package was installed. A small interface was build to convert 3,3V signal from the ttyS0 to 5V for the PIC UART.
The last step is to link a FONERA 2 with Pinguino but it seems that i must write a driver for USB.
Benoit Espinola wrote a small processing sketch to test the link:

import processing.net.*;
boolean onoff;

Client c;
String data;

void setup() {
size(200, 200);
background(50);
fill(200);
onoff = true;
c = new Client(this, "192.168.1.1", 2001); // Connect to FONERA on port 2001
c.write("W01"); // write W output (0) state of the output (1)
// this is the protocol we defined in the pinguino program
}

void draw() {
if (c.available() > 0) { // If there's incoming data from the client...
data = c.readString(); // ...then grab it and print it
println(data);
}
}

// press the mouse change the state of the output

void mousePressed(){
onoff = !onoff;
c.write("W0" + int(onoff));
}

// the led is darked when program stop

void stop(){
c.write("W00");
}

Nice job Benoit !!

No comments: