0

im working on Computer vision (opencv )python and i had a result from the image , so this results is 2D List-arrays that should go to the Arduino by i2c buffer , so i realized that there is a library called smbus that interfacing the Raspberry pi with i2c ports so send and receive data , So i searched on References pages that give me some explanation about this Library but i didn't found eny thing useful...and all what i found is this sites which is not enough information

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/i2c/smbus-protocol

http://wiki.erazor-zone.de/wiki:linux:python:smbus:doc

so im indeed need eny explanation how to send 2D Arrays Like (x,y) Coordinates from Pi to Arduino with i2c buffer

thanks in advance

Mohamed
  • 45
  • 1
  • 11

1 Answers1

0

Check this repository. We connected a NTC CHIP to a Adafruit Trinket using I2C, but connecting the PI with the an Arduino should be very much the same.

The key file is the I2C.py file, which uses SMBus.

To talk to the Trinket Pro (ATMega328) we used the trinket.py file.

And the corresponding client code in the ATMega328, using the Arduino library, specially the Wire.h is located in the hwthontrinket.ino file.

Finally, you can check how to use the classes in the test files. You basically need to pass the bus number and the address of the device.

Havok
  • 5,776
  • 1
  • 35
  • 44