fopetesl
Posts: 44
Joined: Tue Oct 20, 2015 8:08 am

Re: ADXL345 Accelerometer

Fri Dec 18, 2015 10:51 am

joan wrote:....
The "proper" usage (rather than using sudo) is to add yourself to the i2c group, e.g. if your user name is pi then

sudo adduser pi i2c

will allow you to use the i2c devices without needing sudo.

Note, changes in user permissions don't take effect until you log out and back in.
Note: didn't work for me, pi already user of spi (in my case) so still had /dev/mem access denied.
What does work (from another post)

Code: Select all

cd to the directory your file is in then type:-

sudo chown root your_program_name
sudo chmod 4755 your_program_name

You won't need sudo but you still need ./your_program_name

User avatar
joan
Posts: 14473
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: ADXL345 Accelerometer

Fri Dec 18, 2015 11:14 am

fopetesl wrote: ...
Note: didn't work for me, pi already user of spi (in my case) so still had /dev/mem access denied.
What does work (from another post)

Code: Select all

cd to the directory your file is in then type:-

sudo chown root your_program_name
sudo chmod 4755 your_program_name

You won't need sudo but you still need ./your_program_name
You shouldn't have to setuid root to use the SPI devices. There is something wrong with your set up. Are you using a recent Raspbian with a recent kernel?

Return to “Interfacing (DSI, CSI, I2C, etc.)”