View Single Post
Old 04-23-2012, 01:08 AM   #94 (permalink)
thingstodo
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 746
Thanked 565 Times in 447 Posts
Arduino, logging and communications

Sketch Logger

Start with the hardware serial port connected to USB and to PLC
Read a line from PLC (actually from laptop via debug port)
Parse the line into variables
print variables

sscanf does not want to work with the input buffer. It expects a string, an array of characters. The String object, the Arduino String, has an array of characters but it also has a length as well as other stuff.

I found a copy from String to a normal C character array. sscanf works with the integers .. but not with the floating point value?

That seems to work after a few iterations. The floating point variable still does not want to scan ...

But this is progress ... the string that my PLC sends out is parsed into integers and stored in memory.
  Reply With Quote