Protoboard inside v5.1 Skywalker RC Airplane
First project LED lighting
So the code is optimized to make the whole prop the LED controller, as I add new things that will need to shrink down, pins and cogs.
So the code is optimized to make the whole prop the LED controller, as I add new things that will need to shrink down, pins and cogs.
{{
Airplane Anti-Collision, Position, and Nav light testing
}}
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long beacons [100] 'stack space
long strobess [100] 'stack space
PUB main
'enable output pins
dira[16] := 1 'green nav
dira[17] := 1 'land/taxi
dira[18] := 1 'red nav
dira[19] := 1 'white pos
dira[20] := 1 'beacon/AC
dira[21] := 1 'strobes
cognew(beacon, @beacons)
cognew(strobes, @strobess)
repeat
outa[16] := 1
outa[17] := 1
outa[18] := 1
outa[19] := 1
PUB beacon
dira[20] := 1 'beacon/AC
repeat
outa[20] := 1
waitcnt (clkfreq / 10 + cnt)
outa[20] := 0
waitcnt (clkfreq * 1 + cnt)
PUB strobes
dira[21] := 1 'strobes
repeat
outa[21] := 1
waitcnt(clkfreq / 10 + cnt)
outa[21] := 0
waitcnt(clkfreq / 10 + cnt)
outa[21] := 1
waitcnt(clkfreq / 10 + cnt)
outa[21] := 0
waitcnt(clkfreq / 10 + cnt)
outa[21] := 1
waitcnt(clkfreq / 10 + cnt)
outa[21] := 0
waitcnt(clkfreq / 10 + cnt)
outa[21] := 1
waitcnt(clkfreq / 10 + cnt)
outa[21] := 0
waitcnt(clkfreq * 2 + cnt)



Comments
[video=youtube_share;ZzdsfVvy4to]
About the flying area, and proximity to people: They love it!