Skip to content

Flash code

Kravitz Lab edited this page Feb 24, 2026 · 3 revisions

How to flash your Tumbly

  1. Install the Arduino IDE and follow Adafruit instructions for configuring the M0 board
  2. Open Arduino IDE
  3. Click SketchInclude LibraryManage Libraries
  4. Search for "Tumbly"
  5. Click Install to install the Tumbly Arduino library
image

Usage

  1. Click Examples > Tumbly > Tumbly.ino
  2. Double-click the button on the M0 to enter boot loader mode. Connect via microUSB.
  3. Select "Adafruit Feather M0" in the Arduino IDE
image
  1. Click the arrow to flash your Tumbly!
image

#include <Tumbly.h>

void setup() {
  // Optional: configure before begin()
  // setDeviceId(1);
  // setSleepTime(10);
  // setDoorTimes(20, 4);   // Open 8pm, close 4am
  // setDoorPositions(-10, 100);
  
  begin();
}

void loop() {
  ReadSensors();
  TimedDoor();
  LogData();
  UpdateDisplay();
  GoToSleep();
}

Clone this wiki locally