summary refs log tree commit diff
path: root/saber.ino
blob: 3ee7ca4dd27108e34aff9ea56e802008d8c2d203 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "input.h"
#include "blade.h"

// TODO for simple storage #include <EEPROM.h>

void setup() {
  Serial.begin(9600);
  Serial.println("Hello, world!");

  setup_input();
  setup_blade();
}

void loop() {
  uint32_t knob = read_knob();
  if(knob != 0) {
    change_hue(16 * knob);
  }

  byte button = read_button();
  if(button == EVENT_CLICK) {
    toggle_blade();
  }
  if(button == EVENT_HOLD) {
    Serial.println("long press");
  }

  draw_blade();
}