The seesaw firmware that ships with the ATtiny817 breakout 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, 1, 2, 3, 6, 7, 18, 19, 20

Example Code

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 Attiny8x7, analog in can be 0-3, 6, 7, 18-20
#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.

This guide was first published on Oct 20, 2021. It was last updated on 2021-10-20 12:04:17 -0400.

This page (Analog In) was last updated on Nov 11, 2021.

Text editor powered by tinymce.