Datasheet
Wire (i2c)
You can use I2C with the Trinket! If you have our board manager package v1.6.4 or later (thats the version of the trinket
support package, not IDE) then Wire will work on Attiny85
On the Trinket boards, pin #0 is SDA (I2C data), pin #2 is SCK (I2C clock).
More...
We also know the following libraries work:
Adafruit NeoPixel - control up to ~100 Neopixels via a Trinket!
SoftwareSerial - the built in SoftSerial library can (at least) transmit data on any digital pin.
More as we do more testing and verification!
void PWM4_init() {
// Set up PWM on Trinket GPIO #4 (PB4, pin 3) using Timer 1
TCCR1 = _BV (CS10); // no prescaler
GTCCR = _BV (COM1B1) | _BV (PWM1B); // clear OC1B on compare
OCR1B = 127; // duty cycle initialize to 50%
OCR1C = 255; // frequency
}
// Function to allow analogWrite on Trinket GPIO #4
void analogWrite4(uint8_t duty_value) {
OCR1B = duty_value; // duty may be 0 to 255 (0 to 100%)
}
© Adafruit Industries https://learn.adafruit.com/introducing-trinket Page 24 of 43