5

I am testing out some I2C connected hardware and my C program is working fine using Wiring Pi. However, what I wanted to do was read a byte or write a byte to the slave device from the shell. I looked at Wiring Pi's gpio command but couldn't see any obvious flags to allow it to read and write from I2C. Does anyone know of a shell command that I can use to read and write data through I2C that runs on Raspbian on the Pi?

asked Dec 22, 2015 at 3:24

1 Answer 1

6
sudo apt-get install i2c-tools

Then use i2cset, i2cget, i2cdump.

man i2cset # for help
man i2cget # for help
man i2cdump # for help

Aternatively my pigpio library supports I2C from the command line usings pigs, see the i2c* commands, e.g. i2co.

answered Dec 22, 2015 at 3:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.