I am trying to interface my Robotics Bioloid to the EZ-Bv4 using UART 0 to transmit/receive the 5 word Comm packet; FF 55 Data_l ~Data_l Data_h ~Data_h
~ represents Inverse (1's Complement), Data_l is the least significant hex value, Data_h is the higher significant hex value the Robotis boomerang controller sends when a button is pressed.
For example: FF 55 01 FE 00 is the value 01 (button U)
FF 55 00 FF 01 is the value 256 (Hex 10) (button 5)
I can not get the new UartReadRinary, UartWriteBinary to work correctly.
Is there to be a tutorial on the use of the Uart script functions?
Thanks for any help.
Upgrade to ARC Pro
Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming
I get the general idea you show for writing to the Uart.
What about UartReadBinary?
BTW - Thanks for the very quick response!
1) If I don't press a controller button soon enough (several seconds) EZ-B4 disconnects and the red led flashes.
After a power cycle and 'connect' I start the get hex data script and hit button 5 I get this:
and a RealTerm monitor connected to the RX of EZ-B4 shows this:
Problem 2) RealTerm shows the HEX data but the script produced decimal data.
Here is the script:
Just use decimal values, the Bioloid uses unsigned integers 0 to 255 to communicate.
if you convert the hex to the decimal value you'll see the same values.
I discovered this when trying to control the dynamixels with python.
Because you are not using $x anywhere - and the Read Binary is hardcoded to a value of 6 characters. This means you are 100% certain there is 6 characters available? You cannot be 100% certain without actually checking. So hardcoding a value of 6 is why you're program is crashing. You're requesting more information than what is available.
Perhaps something like this will make more sense...
Works like a champ! Also gave me better understanding of how the script function operates.
Now I am ready to 'UartWriteBinary'.