by roycepipkins » Mon Sep 17, 2007 10:22 pm
by roycepipkins
Mon Sep 17, 2007 10:22 pm
I don' think so. My understanding is that serialport1.databits is not the "send this out of the serial port" function. Rather it controls the number of data bits in a single serial byte's frame. You want .databits = 8. The "send this out of the serial port" function is serialport1.write() I believe.
The numbers you send are supposed to be real numbers, also. Not a string. "255" passed to .write() won't send the single number 255. Rather it will send the ASCII number for the character "2" followed by the ASCII number for the character "5" twice over. So you wind up sending three numbers, a 50 followed by two 53's rather than a single 255.
Read this post to get another idea of the correct number sequence to send for the number 5:
http://robosavvy.com/forum/viewtopic.php?t=1395&highlight=
The numbers I think you want to send a 5 are:
255 85 5 250 0 255
In VB *think* that will be the string chr(255) + chr(85) +... etc. assuming .write() demands a string
I don' think so. My understanding is that serialport1.databits is not the "send this out of the serial port" function. Rather it controls the number of data bits in a single serial byte's frame. You want .databits = 8. The "send this out of the serial port" function is serialport1.write() I believe.
The numbers you send are supposed to be real numbers, also. Not a string. "255" passed to .write() won't send the single number 255. Rather it will send the ASCII number for the character "2" followed by the ASCII number for the character "5" twice over. So you wind up sending three numbers, a 50 followed by two 53's rather than a single 255.
Read this post to get another idea of the correct number sequence to send for the number 5:
http://robosavvy.com/forum/viewtopic.php?t=1395&highlight=
The numbers I think you want to send a 5 are:
255 85 5 250 0 255
In VB *think* that will be the string chr(255) + chr(85) +... etc. assuming .write() demands a string