Community
cancel
Showing results for 
Search instead for 
Did you mean: 
isamu2
Novice
1,239 Views

Using SPI with python to read accelerometer data

Hi everyone,

I am trying to use python to read data from mma7455

currently this is the code I am using but I am always getting 0s.

import mraa as m

x = m.Spi(0)

x.frequency(4000000)

x.write_word(0xAC05)

x.writeByte(0x08)

but I am getting zeros on all accelerometer data.

Please advice

Thank you

Tags (1)
5 Replies
BHess
Novice
59 Views

Does it work with I2C?

Are you using 4-wire SPI? Or 3-wire?

isamu2
Novice
59 Views

Yes it works with i2c. I am using 4 wire SPI

J17-11 - SCL

J17-12 - SDA

J18-11 - SDO

J18-10 - CS

Sergio_A_Intel
Employee
59 Views

Hi,

Are you using an Arduino expansion board or a mini breakout board? Another customer is also trying to use the mma7455 sensor. He has run tests in I2C and SPI. He has also tried several boards and environments. Keep an eye on in case any progress is made on this thread.

What image and mraa versions are you using?

Sergio

isamu2
Novice
59 Views

configure_edison --version

159

opkg info libmraa0

0.7.3

The following code gives me 0L. The same thing when I was working with I2C.

x.write_word(0xAC05)

 

Sergio_A_Intel
Employee
59 Views

Hi,

You'll receive a reply to your question here . Please reply to that thread what is the specific model of the sensor you're using.

Sergio

Reply