This project was inspired by a forum member who asked a simple question: Can you interface a Trinket mini microcontroller to the Adafruit RGB LCD Shield. The shield is made to interface with more "classic" Arduino microcontrollers with an Arduino standard shield pin layout. Obviously the shield cannot stack onto Trinket but with four wires, the display shield can hook up to a Trinket project well. This is accomplished as both use the I2C or two-wire bus to communicate. As a further demonstration, the Adafruit I2C based DS1307 real-time clock module is used to display the time and date. The display shield's buttons allow for changing the hour in case of daylight savings time and toggle the backlight.

Libraries

The project uses three code libraries, all optimized for the ATtiny85 used on Trinket:

  • TinyWireM - implements the Wire library for I2C/two wire communication
  • TinyRTClib - Used to communicate with the DS1307 real-time clock
  • TinyAdafruit_RGBLCDShield - communicates with the Adafruit RGB LCD Shield
You may click on each link to download from the Adafruit Github repository.

These should be installed in your Arduino folder where your sketches are stored in the libraries folder. For an in-depth discussion of installing and managing Arduino libraries, see tutorial All About Arduino Libraries.

Getting Ready

Using the Introducing Trinket tutorial, modify the Arduino IDE to work with Trinket by adding the hardware definition file, the avrdude.conf file, changing the ld.exe program (or download the preset Arduino 1.05 from Adafruit). Install the driver for USBtinyISP if using the Windows operating system.
You must follow the instructions in the Introducing Trinket tutorial to set up your Arduino development environment properly, failure to do all the steps will not allow you to program a Trinket properly.
Last updated on 2014-04-17 at 12.26.05 AM Published on 2014-01-27 at 04.05.43 PM