The seesaw firmware that ships with the ATtinyxxx breakouts includes analog capabilities on specific pins. This example reads the analog value of a pin.
Follow the steps on the Arduino page to get set up.
Analog Pins
The ATtiny817 breakout with seesaw firmware provides analog on the following pins:
- 0-3, 6, 7, 18-20
The ATtiny816 and ATtiny1616 breakout with seesaw firmware provides analog on the following pins:
- 0-5, 14-16
Open up File -> Examples -> Adafruit Seesaw -> analog -> analogRead and upload to your Arduino wired up to the breakout.
/* * This example shows how read the ADC on a seesaw. * The default ADC pins on the SAMD09 Breakout are 2, 3, and 4. */ #include "Adafruit_seesaw.h" Adafruit_seesaw ss; // on SAMD09, analog in can be 2, 3, or 4 // on Attinyxy7, analog in can be 0-3, 6, 7, 18-20 // on Attinyxy6, analog in can be 0-5, 14-16 #define ANALOGIN 2 void setup() { Serial.begin(115200); while (!Serial) delay(10); // wait until serial port is opened if(!ss.begin()){ Serial.println(F("seesaw not found!")); while(1) delay(10); } Serial.println(F("seesaw started OK!")); } void loop() { Serial.println(ss.analogRead(ANALOGIN)); delay(50); }
Once you've successfully loaded the sketch onto your board, open the Serial Monitor (Tools->Serial Monitor). Your output should look something like the following.
Text editor powered by tinymce.