As per the previous software and the suggestions i've seen for using i2c with Trinket I just directly include the Wire library along with the TSL2561 and Adafruit_Sensor. If i understand right it should then be using the TinyWireM.h transparently in the background for all the calls to Wire.
Code: Select all
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>
and'TwoWire' has not been declared
Basically the same error seems to come up if you try to compile the sensorapi Example for the TSL2561 for Trinket 5V 8MHz. Note that both the sensorapi Example and my source code both compile fine for the Arduino Uno so i'm sure the issue is with the board definition or the way that Wire and WireTinyM are defined for the Trinket.'TwoWire' does not decalre a type
As i mentioned before i had it working a coupelof years ago. In that case I also had to make some manual hack to the Adafruit_TSL2561_U.h file in order to comment out the references to TinyWireM and make sure to include Wire.h. But it looks like in the newer version of Adafruit_TSL2561_U.h already used Wire.h only.
Code: Select all
46//ifdef __AVR_ATtiny85__
47// #include "TinyWireM.h"
48// #define Wire TinyWireM
49//#else
50 #include <Wire.h>
51//#endif