SargisYonan / SensorNode

A generic sensor node for a sensor network
1 stars 1 forks source link

I2C code doesn't work #5

Closed zwgraham closed 8 years ago

zwgraham commented 8 years ago

Even when you pull my fix, the i2c library is not being used correctly.

I attempted to patch this problem, but ran into a bug?

I'll send a frame with payload 0x56 0x00 0x2D to the SensorNode, it then sends many frames of gibberish.

The problem could be in the i2c_init() code (from the library) overwriting a hardware configuration OR the problem is a buffer overflow somewhere (less likely)

If I comment out i2c_init() in driver.c then send the frame, it responds with /160/ every time, which is incorrect. If it is not commented out sending the frame will send lots of frames with gibberish payloads.

I know the sensor works, because I tried a simple test program written in processing using the Wire library.

Attached are the test arduino program (attached) and the patches I made for this code. Can we debug this soon? Arduino_BH1750.zip jjj bad_fix.patch.txt

legendddhgf commented 8 years ago

I2C code now works and is integrated into the build of the 'light' make target