iBus transmission and read it in Arduino

Hi,

I am using an Arduino Uno and wanted to transmit data from FSi6 to FS-iA6B and read received data in an arduino. After searching, I found the below link which is iBUStelemetry.

I am not able to make out how to get the data from this library and print it on the serial monitor. I have hooked up receiver ground and power pins to ground and power pins of arduino. Signal from the receiver is connected to D2.

The author has included an example, but I am not much clear how data is read and printed on the serial monitor. Can someone please help by telling how do I read data from receiver using this library?

Thanks,
Praveen

anybody?

no idea if this is correct as I have never used this library but looking at it, I think something like this may give you a read back to serial monitor.

#include <iBUStelemetry.h>

iBUStelemetry telemetry(4); //pin 4 is Rx pin

byte i;

void setup(){
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  
  telemetry.begin(115200);
  telemetry.addSensor(2);
  
  Serial.println("READY!");
}

void loop(){
  telemetry.setSensorMeasurement(1, i++); //have no idea what this does!
  delay(1000);
  
  while(telemetry.available()) {
    Serial.println(telemetry.read());
  }
}

hope that helps

Thanks for the response. The telemetry.read() returns a byte. I had tried this, but received a series of 1's (set to display binary) and no changes whatsoever. Since this is iBUS, need to get different values for each of the 8 or 10 channels as per the remote specs. I was expecting something like the below, but not sure what code to use.

for (i = 0; i < noOfCh; i++){
	chvals[i] = IBus.readChannel(i);
}

Regarding the below code:

telemetry.setSensorMeasurement(1, i++); //have no idea what this does!

When a battery is connected, this seems to iterate between the three case statements and gives out different values. Not useful for me though.

However, thanks for trying to help.

Any more help on this please?

Hello,

i solved the same problem using a different library:

Maybe this works for you too?

Hi! Is there a code that's read pwm and convert it to ibus?

Goran123:
Hi! Is there a code that's read pwm and convert it to ibus?

Did you have found a code that convert PWM to IBUS ?
I look for one too.

Thanks