DC-16 Serial Commands
Charlie Johnson
Posts: 147
How would something like this
Be coded in spin using the FullDuplexSerial or some more appropriate Serial object?· Serial TX and RX are on the same pin.· I thought I would make a DC-16 Object, but I am already stumped on the serial I/O.
Thanks
Charlie
AKA dy8coke
' get version SEROUT Sio, Baud, [noparse][[/noparse]"!DC16", Addr, "V"] SERIN Sio, Baud, 200, Main, [noparse][[/noparse]STR id\3] DEBUG "DC-16 Version ", STR id\3, CR
Be coded in spin using the FullDuplexSerial or some more appropriate Serial object?· Serial TX and RX are on the same pin.· I thought I would make a DC-16 Object, but I am already stumped on the serial I/O.
Thanks
Charlie
AKA dy8coke
Comments
OBJ
SS : "SimpleSerial"
PUB getVersion
SS.str(String("!DC16")) 'Preamble
SS.bin(11,2) 'DC-16 address
SS.str(string("V") 'Get version
I will continue to hack at it..... Thanks
Charlie
AKA dy8coke
Keep in mind that the ID parameter in the DC-16 control string is numeric, and the .bin method sends a string representation -- just use the .tx method for sending values and single characters.