C# LattePanda.Firmata not working correctly??

userHead i00 2017-07-06 19:25:56 2138 Views1 Replies

I am using the LattePanda.Firmata.Arduino class and followed the digitalWrite example at https://www.lattepanda.com/docs/

 

...The device seems really slow so I put some extra debug helpers in to tell me what was going on:

 

 

 // ==== set the led on or off
var start = DateTime.Now;
arduino.digitalWrite(13, Arduino.HIGH);//set the LED on
System.Diagnostics.Debug.Print(DateTime.Now.Subtract(start).TotalMilliseconds.ToString());
Thread.Sleep(1000);//delay a seconds
start = DateTime.Now;
arduino.digitalWrite(13, Arduino.LOW);//set the LED off
System.Diagnostics.Debug.Print(DateTime.Now.Subtract(start).TotalMilliseconds.ToString());
Thread.Sleep(1000);//delay a seconds

 

... When I run it the messages start popping out ... but only about one in every 3 times that a command is sent actually seems to trigger the led...

Not only that the timer shows the following outputs:

1453.6637
0
0
1453.2157
0
0
1453.22
0
0
1453.2136
...

So it is taking about 1 and a half seconds to actually register the command with the device??? With the "0 time" ones the command is not registered at all!

What's going on here?

Thanks,
Kris