Another Prop Controlled LED RC Airplane
This is the third RC plane I've put LEDs on. I've learned from my last two airplanes that I only need a few LEDs to be able to fly but more LEDs is a real crowd pleaser. As inclined as I am to please people, none of these people carry spare LiPos and if they did probably have the wrong connector. So how can I minimize the number of LEDs to get more flight time, but also not let our audience down?
Add a microcontroller. I can make some lights blink, which not only makes up for lack of LEDs but also cuts down on power as well
[video=youtube_share;_SwmvyhGOBQ]
Add a microcontroller. I can make some lights blink, which not only makes up for lack of LEDs but also cuts down on power as well
[video=youtube_share;_SwmvyhGOBQ]
{{ Airplane Anti-Collision, Position, and Nav light testing }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 BLED = 2 'Pin of Blue Canopy LED STR = 1 'Pin of thy Strobe Lights VAR long beacons [100] 'stack space long strobess [100] 'stack space long BLEDi PUB main dira[BLED] := 1 'enable output on blue LED pin dira[STR] := 1 'enable output on strobes pin cognew(beacon, @beacons) 'start a cog to run the blue beacon cognew(strobes, @strobess) 'start a cog to run the strobes PUB beacon dira[BLED] := 1 'enable output on blue LED pin BLEDi := 10 'sets the initial brightness percentage at 10% repeat repeat until BLEDi == 20 'get brighter CTRA := %0_0110<<26 + BLED FRQA := $7FFF_FFFF/50 * BLEDi BLEDi := BLEDi + 1 waitcnt(clkfreq / 20 + cnt) repeat until BLEDi == 5 'get dimmer CTRA := %0_0110<<26 + BLED FRQA := $7FFF_FFFF/50 * BLEDi BLEDi := BLEDi - 1 waitcnt(clkfreq / 20 + cnt) PUB strobes dira[STR] := 1 'enable output on strobes pin repeat 'strobe blink pattern outa[STR] := 1 waitcnt(clkfreq / 15 + cnt) outa[STR] := 0 waitcnt(clkfreq / 15 + cnt) outa[STR] := 1 waitcnt(clkfreq / 15 + cnt) outa[STR] := 0 waitcnt(clkfreq / 15 + cnt) outa[STR] := 1 waitcnt(clkfreq / 15 + cnt) outa[STR] := 0 waitcnt(clkfreq / 15 + cnt) outa[STR] := 1 waitcnt(clkfreq / 15 + cnt) outa[STR] := 0 waitcnt(clkfreq * 2 + cnt)
Comments
Nothing like a good field test.
I made it only three channel using NPNs to allow Vin to pass through the headers. Even though I cut the board in half I still have access to pins 0 through 21, which for this project I doubt I'll use. I added a fuse to the other side of the JST, and the three channel flashing LEDs are independent of the always on LEDs as well.
For the price of the Project Board and the work involved it blows away purchasing some of the controllers I've seen. There's a ton of room to expand as well, but I don't need to on this airplane at all.
For the blue LED in the center I'm going to have that blink different patterns based on how long the system has been on which should make a good battery timer.
The strobes blink a couple different patterns as well.