To initialize the Bridge all you have to do is call the Bridge.begin(); function in the setup part of the sketch. After that we initialize the Console with Console.begin(). To stop the execution of further commands we can poll the Console to become ready.
void setup() { // put your setup code here, to run once: Bridge.begin(); Console.begin(); while (!Console) { ; } }
You can now use the print functions as usual:
if(Console.available()) { c = Console.read(); . . . }
On the Linux side we have a python script that will conncet to the bridge server and do the same as the Arduino serial console.
import telnetlib, time tn = telnetlib.Telnet("localhost", 6571) while True: print "w" tn.write("test") print tn.read_eager() time.sleep(1)
Keine Kommentare:
Kommentar veröffentlichen