Blockly. I2C. Sending word

coparu67

Senior Member
Hi
I try to control servos with the AXE031 SD21 board using i2c.

I need to send the low byte and the high byte of a integer word (numbers between 1000 and 2000)
In BASIC is very easy
...
let w0 = 1500;
hi2cout 1, ( b0 , b1 )
...

But in Blockly it's no so easy because I can't access to b0 and b1.
What is the simplest way to send those bytes (Blockly)?
Maybe adding functions/convertions/operations like "lowByte" and "highByte"?
 

Technical

Technical Support
Staff member
Try something like this:

CaptureI2c.PNG

This also works (as i2c bytes are restricted to the low byte of a word anyway) but is not so obvious

Capturei2c2.PNG
 
Top