|
how to send data to MCU with SERIAL MODULE configuration kenny chan from Malaysia [2 posts] |
13 year
|
im doing for the connection in between the ROBOREALM to the PIC chip. but the problem is how can i define that the connection between this two stuffs is connected??how can i send the data to the PIC??possible that i only use SERIAL MODULE configuration to send the data without plugin any VBscript program?? program.robo
|
|
|
Anonymous |
13 year
|
Kenny,
Use the forum to search for examples of the serial module to get a better idea of the way to communicate to a PIC. Several examples exist for BS2 and another current thread with a Propeller. Or check the bottom of the Serial module page for forum entries.
In your serial module enter
\\[HIGHEST_MIDDLE_X]
in the Send Sequence box (the larger one NOT the one next to the button).
This will transmit a 4 byte number over serial to whatever device is on the other side. So configure the serial module to the PIC and write a pic program to read 4 bytes from the serial line. You will then need to recreate the binary number using something like
value = byte1 | (byte2<<8) | (byte3<<16) | (byte4<24)
or if you have a way to read an integer number from the serial line you can try that too. If the result is a really large number the byte order may be reversed so instead use
//[HIGHEST_MIDDLE_X]
which will reverse which byte is the highest byte.
STeven.
|
|
|
kenny chan from Malaysia [2 posts] |
13 year
|
hi steven after view through the other example, what i get is the is better to use your example as the base but when i tried enter
[left_motor]<cr>
[right_motor]<cr>
in the serial module. but there is not any bytes signals produce...is that any problem for the code i enter in the serial configuration??or the VB script program is not suitable to in this module??
thanks for the the reply....steven program.robo
|
|
|
Anonymous |
13 year
|
|