btnlt kit
This commit is contained in:
parent
9c25fca3c3
commit
4572ecbe11
9 changed files with 439 additions and 1 deletions
23
ESPMegaPRO-DevKit-BTNLT/src/main.cpp
Normal file
23
ESPMegaPRO-DevKit-BTNLT/src/main.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <ESPMegaProOS.hpp>
|
||||
|
||||
// Function Prototypes
|
||||
void setup();
|
||||
void loop();
|
||||
void inputCallback(uint8_t pin, uint8_t state);
|
||||
|
||||
ESPMegaPRO espmega = ESPMegaPRO();
|
||||
|
||||
void setup() {
|
||||
espmega.begin();
|
||||
espmega.inputs.registerCallback(inputCallback);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
espmega.loop();
|
||||
}
|
||||
|
||||
void inputCallback(uint8_t pin, uint8_t state) {
|
||||
// Match PWM Channel with the same number as the input pin
|
||||
espmega.outputs.digitalWrite(pin, state);
|
||||
Serial.printf("Input %d changed to %d\n", pin, state);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue