SparkFun Electronics Commentsurn:uuid:214d0e4e-f1b1-d287-ce26-ac5b4c9f82492024-03-29T04:02:48-06:00SparkFun ElectronicsMr. Ben on Adventures in Science: Using an RC Hobby Controller with ArduinoMr. Benurn:uuid:dc8bae94-2d29-1563-b2c3-f14c971d892a2017-08-25T08:54:20-06:00<p>Great post Shawn! My plastic bot still uses an Arduino mini from code I borrowed from Sparkfun Nick several years ago.</p>
hephlant on Adventures in Science: Using an RC Hobby Controller with Arduinohephlanturn:uuid:b81646dc-d8c1-7333-e026-3805fba9ff7c2017-08-24T23:29:58-06:00<p>This is certainly a good intro, but using a pin for every pwm signal is a bit of a waste. Most receivers offer an extra servo header used to program the receiver to accept a transmitter. What would normally be the signal pin here usually carries a PPM stream with all the PWM values smashed into one channel with slightly different timings.
I wrote a (probably inefficient) interrupt driven decoder a few years ago for a few robotics competitions. It's stable as is, but could really use some TLC to get it into a library.
Here's a link if anybody wants to use it:
https://github.com/RetrieverRobotics/resources/blob/master/personal_RX.h<p>Right now it needs to be used on an actual interrupt pin (in limited supply on boards like the UNO), but since it's tracking a CHANGE interrupt, could probably be adapted to use one of the PinChangeInterrupt libraries.</p><p>Usage:</p><pre><code>#include "whatever_you_name_the_file.h"
OrangeRX instance_name(interrupt_pin);
void a_unique_handler(void) {
instance_name.isr();
}
void setup() {
instance_name.begin(a_unique_handler);
}
void loop() {
if(instance_name.packetAvailable()) {
instance_name.channelValue( _channel_ );
}
//instance_name.debug() // assumes that Serial.begin() has been called
}
</code></pre><p>P.S. I have trouble writing short comments. Oh well. : p</p></p>