Instructables

Step 5: The Arduino sketch

Picture of The Arduino sketch
So, um, well, I'm not really going to explain how the code works here, but, all I can say is that to generate the IR pulses, I got the code from this blog, that I heavily modified to work with my heli, and then I got the nunchuk handling part from Tod E. Kurt (todbot.com) and used it to control the heli.

To send an IR packet, you call this function :
SendCommand(throttle, yaw, pitch, trim);
with,
- throttle 0-255
- yaw 0-255
- pitch : 1=backwards, 2=forward, 0=none
- trim 0-255

So don't forget to read the description at the beginning of the code, an that's pretty much it !
Oh, I almost forgot ! You can get the code here ^^

Now, let's head to step 6 : the hardware setup.
 
Remove these adsRemove these ads by Signing Up