ATtiny85 8MHz and ADXL345 via I2C with Arduino code

From ivc wiki
Revision as of 22:22, 13 May 2015 by Ivc (talk | contribs)
Jump to navigationJump to search

This is a small setup based on the ATtiny85 to make use of the advanced features of the ADXL345 accelerometer.

Parts

  • Adafruit Trinket 3V ATtiny85 board
    • No need for level shifting for ADXL345 I2C
    • Comes with [Trinket Bootloader] to upload binary with USB during the first 10 seconds of power-up/reset
    • Red LED on #1/PB1 is handy for debugging
  • GY-291 ADXL345 Digital 3-Axis accelerometer breakout
    • On-board 3.3V LDO for ADXL345
    • I2C 4.7k pull-ups
    • CS 4.7k pull-up - enable I2C, not SPI
    • SDO 4.7k pull-down - I2C address 0x53
    • Comes with 2.54mm pin header

Wiring

  • ATtiny -> ADXL345
  • USB -> VCC
  • GND -> GND
  • #0/PB0 -> SDA
  • #2/PB2 -> SCL

Code

Code