This commit is contained in:
2021-06-21 19:59:16 -05:00
parent 3ccbd309b2
commit 68f02588e2
10 changed files with 527 additions and 12 deletions

33
ESP32/IBUSM/src/main.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <Arduino.h>
#include "IBusBM.h"
IBusBM IBus;
int saveval = 0;
void setup()
{
Serial.begin(115200);
delay(100);
IBus.begin(Serial2, IBUSBM_NOTIMER);
delay(100);
Serial.println("Start IBus2PWM_ESP32");
}
void loop()
{
uint16_t val;
IBus.loop();
for (int i=0; i<10; i++) {
Serial.print(IBus.readChannel(i));
Serial.print(" ");
}
Serial.println("");
val = IBus.readChannel(2); // get latest value for servo channel 1
if (saveval != val)
{
//Serial.println(map(val, 1000, 2000, 0, 500));
saveval = val;
}
delay(800);
}