06-22-2009 08:03 PM
I recently bought a "Mosquit-IO" board from Trossen Robotics:
http://www.trossenrobotics.com/Mosquit-IO.aspx
It says all to do to control the servos plugged into the board is to send a command like:
255 25 42 69 25 42 69 /r
Where commands are sent at: 19200 baud, 8 bits , no parity, 1 stop bit, with RTS/CTS handshaking enabled.
I am trying to write a code to send these commands, but not having success talking with the board. I am also just trying, using the "Basic Serial Write and Read" example from LabVIEW. I'm even having no success with the example. I believe if I can get labview's example to work, I can get my code to work.
When I send the commands on the "Basic Serial Write and Read" example, the command:
255 25 42 69 25 42 69 /r
it turns into:
255\s42\s69\s25\s42\s69\s25\s/r
but the servos do not move.
Can anyone help out?
Thanks
Solved! Go to Solution.
06-23-2009 07:57 AM
Hi,
I think you are mixing up data formats here. I guess that the you shouldn't send the ASCII string "255 25 42 69 25 42 69 /r" here, but the numbers represent byte values. E. g. the number 255 represents the maximum value of one byte, but if you put this value into a string and send it to your device, you effectively send three bytes with the values 50 (= ASCII value for the character "2"), 53 (= ASCII "5") and 53 (= ASCII "5"). /r is the symbol for carriage return which equals to a byte value of 13.
The best way to create your command string is to use a byte array (U8) and convert it into a string.
The string is not human readable, but it represents the byte values of your commands.
I hope this helps,
Jochen Klier
National Instruments
06-23-2009 10:11 PM