-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTwoLeds.ino
50 lines (40 loc) · 911 Bytes
/
TwoLeds.ino
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* TwoLeds – this example demonstrates using RotaryEncoder with a button.
*
* Dependencies for the library:
* http://www.pjrc.com/teensy/td_libs_Encoder.html
*
* Dependencies for the example:
*
* RotaryEncoderWithButton library
* SimpleTimer library
*
* Created on: Aug 9, 2014
* Author: Konstantin Gredeskoul
*
* (c) 2014 All rights reserved. Please see LICENSE.
*/
#include <TaskScheduler.h>
#include <M5StickC.h>
#include <Arduino.h>
#include "RotaryEncoderWithButton.h"
//#include <SimpleTimer.h>
//RotaryEncoderWithButton rotary(2,3,4);
RotaryEncoderWithButton rotary(26,36,0);
uint32_t data;
int i;
void t1Callback();
Task t1(5, TASK_FOREVER, &RotaryEncoderWithButton::ReadAB);
Scheduler runner;
void setup() {
M5.begin();
Serial.begin(115200);
rotary.begin();
runner.init();
runner.addTask(t1);
delay(100);
t1.enable();
}
void loop() {
runner.execute();
}