Rotary-Dial/examples/dialtoserial/dialtoserial.ino

23 lines
376 B
Arduino
Raw Normal View History

2018-04-26 16:10:33 +00:00
/**
* Print each digit over Serial as it is dialed.
* See the README for detailed documentation.
*/
2018-04-26 21:10:18 +00:00
#include "RotaryDialer.h"
2018-04-26 16:10:33 +00:00
2018-04-26 21:10:18 +00:00
#define PIN_READY D6
#define PIN_PULSE D5
2018-04-26 16:10:33 +00:00
RotaryDialer dialer = RotaryDialer(PIN_READY, PIN_PULSE);
void setup() {
2018-04-26 21:10:18 +00:00
Serial.begin(115200);
2018-04-26 16:10:33 +00:00
dialer.setup();
}
void loop() {
if (dialer.update()) {
Serial.println(dialer.getNextNumber());
}
}