Name |
write() |
Examples |
import hypermedia.pinguino.*;
Pinguino board;
void setup() {
board = new Pinguino(this);
}
void draw() {
byte[] response = new byte[ 21 ];
response = board.read( response ); // get Pinguino's response
if ( response!=null ) {
println( str(response) ); // bonjour Processing :)
}
}
void mousePressed() {
String greeting = "hello pinguino !";
board.write( greeting.getBytes() ); // send greeting to Pinguino device
}
|
Description |
Send the given data to Pinguino device with an optional timeout value. |
Syntax |
write(data); write(data, timeout); |
Parameters |
data |
byte[] : data as byte array to be sent |
timeout |
int : amount of time in milliseconds the device will try to send the data |
|
Return |
None |
Usage |
Application |
Related |
write() read() |