fix mapping bug
This commit is contained in:
parent
989107c8e3
commit
ffe55fd978
3 changed files with 27 additions and 2 deletions
25
ESPMegaPRO-OS-SDK/src/map_test.cpp
Normal file
25
ESPMegaPRO-OS-SDK/src/map_test.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <ESPMegaProOS.hpp>
|
||||
|
||||
ESPMegaPRO espmega = ESPMegaPRO();
|
||||
|
||||
void setup() {
|
||||
espmega.begin();
|
||||
uint8_t outputPinMap[16] = {8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7};
|
||||
espmega.outputs.loadPinMap(outputPinMap);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
espmega.loop();
|
||||
// Loop through all outputs, turning them on one at a time
|
||||
// for 1.5 seconds each
|
||||
for (uint8_t i = 0; i < 16; i++) {
|
||||
Serial.printf("Turning on output %d\n", i);
|
||||
espmega.outputs.digitalWrite(i, true);
|
||||
// Print out the state of all outputs
|
||||
for (uint8_t j = 0; j < 16; j++) {
|
||||
Serial.printf("Output %d: %d\n", j, espmega.outputs.getState(j));
|
||||
}
|
||||
delay(1500);
|
||||
espmega.outputs.digitalWrite(i, false);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue