Nikkilae / PPM-reader

An interrupt based PPM signal reader for Arduino
GNU General Public License v3.0
77 stars 44 forks source link

10 channels for firmware upgraded FS-iA6B or FS-iA10B #2

Closed aytunch closed 6 years ago

aytunch commented 6 years ago

Hi, i use your library for my projects and it works super responsive. But i could not find a way to use the library for 10 channels. is there a limitation for 6? and why? int channelAmount = 10; does not work out of the box for me. Am I doing something wrong?

Nikkilae commented 6 years ago

Hi! Glad you're finding use for the library.

There shouldn't be a limit for only 6 channels in the library, so I don't see why it wouldn't support 10 channels as long as you give the channel amount to the PPMReader class constructor like in my example sketch. Could you show the code that you've tried? When you try to use 10 channels, are 6 of the channels working and 4 not working, or are none of them working at all?

I currently only have access to FS-iA6B receivers (factory firmware) which can only output 6 channels in PPM so unfortunately I can't properly test my library with more than 6 channels. I do suspect that your problem is related to your transmitter or receiver not actually outputting more than 6 channels in PPM. What's your transmitter? Are you sure that your transmitter supports transmitting more than 6 channels?

andrewerrington commented 6 years ago

Hi there! I just downloaded this software today. I am using a FlySky FS-i6S 10-channel transmitter with a FlySky FS-iA10B receiver. The receiver is set to PPM mode, and I literally just used your demo code in the README file. I am using a clone Arduino UNO with interruptPin set to 2 and channelAmount set to 10.

In the serial monitor I get 10 numbers per line, but number 9 and 10 always read 0. All the other numbers match the bargraph indicators on the transmitter LCD (generally 1000-1500-2000).

I haven't looked at the source yet, but if there's something obvious I could try then I'm happy to give it a go.

Nikkilae commented 6 years ago

Hi Andrew. I can't try an FS-iA10B receiver myself because I don't currently have one, but with some googling I found out that your receiver may only be able to output only 8 channels when using PPM. Some of the other output modes (PWM and whatnot) should support all the way up to 10 channels.

https://github.com/benb0jangles/FlySky-i6-Mod-/issues/23 https://discuss.ardupilot.org/t/connecting-an-fs-ia10b-receiver-to-pixhawk/27833

I think this is the reason you're getting only 8 channels in Arduino. But feel free to look around my library's source to see if you find any reason why it might not work properly.

andrewerrington commented 6 years ago

Ok, no worries. I concur with your observations. I can confirm that your code works correctly when 10 channels are specified (i.e. it doesn´t crash when 10 channels are requested but only 8 are present). I can also confirm that the 8 channels sent by the FS-iA10B receiver are correctly and reliably decoded, and the last two are sensibly reporting 0 all the time. Thank you.