Much thanks to Mem for the ServoDecode lib. excellent work!
I got the code working for my VEX receiver but I am not sure about the values outputted by the lib. For example when I moved the stick on the receiver to max the channel returns ~1886 and minimum ~ 1096. When the stick is centered it's about ~1502 which is about right.
It seems like I am not getting the full range in the channels.
When I add the ServoTimer lib I also notice that the servo does not swing to full 180 deg... more like 110 deg. and 60 deg. the other way.
This is the settings in the lib.
#define MIN_IN_PULSE_WIDTH (450 * TICKS_PER_uS)
#define MAX_IN_PULSE_WIDTH (2250 * TICKS_PER_uS)
#define SYNC_GAP_LEN (2000 * TICKS_PER_uS)
There are the VEX transmitter attributes ( from ARTOO-DETOO DOT NET – R2-D2 Building Blog » Arduino)
- 20 ms total before repeat.
- Each channel is sent as a high signal followed by a 1 ms low. The width of the high signal determines the value sent. A zeroed channel has a width of 1ms. A full positive channel is 1.5ms and a full negative channel is 0.5 ms.
- On the Vex there are six channel (The six peaks that you see) for a total of about 12ms buffered by approximately 8 ms.
Can anyone help translating the VEX transmitter attributes to the ServerDecode settings?
Thanks