// serial IO listSerialIO.list() @=> string list[];// print listfor( int i; i < list.size(); i++ ){ chout <= i <= ": " <= list[i] <= IO.newline();} // device number0 => int device;if( me.args() ) me.arg(0) => Std.atoi => device;// serial ioSerialIO cereal;// open serial devicecereal.open( device, SerialIO.B9600, SerialIO.BINARY ); // infinite time-loopwhile( true ){ // wait on event cereal.onInts(1) => now; // get int cereal.getInts() @=> int i[]; // print if( i.size() > 0 ) chout <= "int: " <= i[0] <= "\n";}
// serial IO list
SerialIO.list() @=> string list[];
// print list
for( int i; i < list.size(); i++ )
{
chout <= i <= ": " <= list[i] <= IO.newline();
}
// device number
0 => int device;
if( me.args() ) me.arg(0) => Std.atoi => device;
// serial io
SerialIO cereal;
// open serial device
cereal.open( device, SerialIO.B9600, SerialIO.BINARY );
// infinite time-loop
while( true )
{
// wait on event
cereal.onInts(1) => now;
// get int
cereal.getInts() @=> int i[];
// print
if( i.size() > 0 )
chout <= "int: " <= i[0] <= "\n";
}