background image

Utilities 

There is a set of command-line utility programs that can help get an I2C interface working. You can 
get them with the apt package manager. 

COPY CODEsudo apt-get install -y i2c-tools 

In particular, the 

i2cdetect

 program will probe all the addresses on a bus, and report whether any 

devices are present. Call 

i2cdetect -y 1

 to probe the first I

2

C bus, which is what the Qwiic HAT is 

connected to. 

COPY CODEpi@raspberrypi:~/$ i2cdetect -y 1 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

This map indicates that there is a peripheral at address 0x60. We can read and write its registers 
using the 

i2cget

i2cset

 and 

i2cdump

 commands. 

 

 

Содержание Qwiic Shield

Страница 1: ...ered to the PCB to The Qwiic Shields have 4x Qwiic connect ports all on the same I2 C bus Logic level converters are included for the Qwiic connect port s SDA and SCL lines so you do not have to worry...

Страница 2: ...e are also buses for ground 5V and 3 3V on the shield for Arduino outlined below The headers also allow for every pin on the microcontroller of your choice to still be accessed through the female head...

Страница 3: ...der has been soldered to the PCB to The Qwiic shield for the Particle Photon also includes 4x Qwiic connect ports a prototyping area and buses for 3 3V and ground However they are much smaller The Pho...

Страница 4: ...those headers to your shield properly These tips are also useful when installing the headers for the Qwiic shield for Photon Once you ve attached headers to your Qwiic shield you re ready to plug it i...

Страница 5: ...Qwiic HAT for Raspberry Pi The Qwiic HAT has 4 Qwiic connect ports all on the same I2 C bus In addition to this some of the pins on the Raspberry Pi are broken out for the user...

Страница 6: ...Qwiic HAT simply plug it into the headers on the Raspberry Pi make sure that the USB arrow on the HAT is pointing towards the USB on the Raspberry Pi Once the HAT is plugged in you can start plugging...

Страница 7: ...stalled run the gpio commands shown below COPY CODE gpio v gpio readall It should respond with some information about the wiringPi version and the Pi that its running on then draw a table illustrating...

Страница 8: ...rogram will probe all the addresses on a bus and report whether any devices are present Call i2cdetect y 1 to probe the first I2 C bus which is what the Qwiic HAT is connected to COPY CODEpi raspberry...

Страница 9: ...Arduino you ll need to grab a logic level converter to boost your signals up to 5V Also be aware that all Qwiic devices have pull up resistors on the I2 C lines So if your device does not have it you...

Страница 10: ...abled board Using pliers snap off a row of 4 pins from the right angle male header Using diagonal cutters you will need to sacrifice one socket in order cut off a row of 4 pins from the female header...

Отзывы: