A simple script adapting Shawn Hymel's ADXL343 I2C tutorial code for the EuroPi module.
Output | Value |
---|---|
CV1 | X |
CV2 | Y |
CV3 | Z |
CV4 | 1-X |
CV5 | 1-Y |
CV6 | 1-Z |
Refer to Table 19 on Page 21 of the ADXL343's Datasheet for a complete description of what each hex address is referring to in the accelerometer_europi.py code.
For I2C, you only need to use 4 pins on the ADXL343: VIN, GND, SDA, and SCL. Connect these pins to the EuroPi (the I2C breakout header lists VIN as 3V3) and use this code to let the EuroPi read data from the ADXL343 breakout board:
i2c = machine.I2C(1, scl=machine.Pin(3), sda=machine.Pin(2), freq=400000)