Did you ever get that ADXL to work? I've spent a frustrating past few days trying to figure the issue out. I am using python (but whatever works would do for me) and trying to write the power register.... Its returning 0.. ALWAYS! I am expecting the output console to print a number (I am getting a 0)
Here's my code for the most basic test:
USED_I2C = 6
DEV_ADDR = 0x1D
x = mraa.I2c(USED_I2C)
byte = 0
m = " "
while byte != 0x28:
print("I read: ")
Any idea on how I can test my code?
My connections are as follows:
VCC==IOREF (IOREF is set to 5V)
I was able to make things work early morning today
I'll post my code etc when I get back home. It turns out that things were pretty trivial... The documentation for beginners sucks at the moment. I don't say that it's bad, but I've found it easier to navigate through beaglebone and RPi stuff. Perhaps it's due to the overwhelming number of discussions taking place across the internet for ARM. I can't be sure.remind me if I forget to post my code.
So basically, here are the steps that I followed:
- Open up "Intel Edison Kit for Arduno Hardware Guide" and follow along the steps on page 30 (section 11.6). Intel® Edison Arduino Board Hardware Guide
- For my testing, I
- Wrote the Power register and wait until I can read the value back...
USED_I2C = 6 DEV_ADDR = 0x53 x = mraa.I2c(USED_I2C) byte = 0 m = " " while byte != 0x28: print("I read: ") x.address(DEV_ADDR) x.writeReg(0x2D, 0x28) time.sleep(1) byte = x.readReg(0x2D) print(byte) print("write to power register was successful")
- Played around with other register settings (I'm not posting that code here since I'm ashamed of how bad the code is written currently: no comments, literals everywhere). The i2c routines seem to work fine from here. Basically we can copy and adapt any code from the internet from here onwards. It would be useful if someone made/ported a library though. I would try to find time to do so if people are interested.
General Suggestion to the Linux Dev Team
It would be GREAT (!!!!) if you guys could make a folder with these scripts for configuring the MUXes. In fact I think this would ease the adoption of the board as a whole for newbies. I always knew there was a Hardware guide but I didn't care going to section 11.6 until after many frustrating hours of the code not working. I can imagine how relieved I would've been if there was a script (in e.g. /local/scripts/) which I could simply execute to change the MUXes to output I2C on the pinouts.