IBusBM icon indicating copy to clipboard operation
IBusBM copied to clipboard

add support for the esp8266's single serial port

Open agustinbene opened this issue 1 year ago • 0 comments

Description of Changes

Feature Added: ESP8266 Hardware Serial Port Compatibility

This update modifies the library to support the ESP8266's single hardware UART port.

Test Environment

Transmitter: FlySky FS-i6 (original firmware)
Receiver: FS-iA6B

Connections:

  • GND to GND
  • 5V to 5V
  • iBus (Sens) to Rx (ESP8266)
  • Rx (ESP8266) to TX (ESP8266) with a diode

Test Code

#include <IBusBM.h>

IBusBM IBus; 

void setup() {
  IBus.begin(Serial);
  IBus.addSensor(IBUSS_RPM);
  IBus.addSensor(IBUSS_TEMP);
}

#define TEMPBASE 400    // base value for 0'C

// sensor values
uint16_t speed = 0;
uint16_t temp = TEMPBASE + 200; // start at 20'C

void loop() {
  IBus.setSensorMeasurement(1, speed);
  speed += 10;                // increase motor speed by 10 RPM
  IBus.setSensorMeasurement(2, temp++); // increase temperature by 0.1 'C every loop
  delay(500);
}

agustinbene avatar Aug 03 '24 15:08 agustinbene