3 ; 3 leds (red, green, blue) on different ports.
4 ; cm mode: continuous mixed colors
5 ; rgb mode: keep one special color
7 ; modes switchable by uart
9 ; author: hackbard@hackdaworld.dyndns.org
12 .include "../include/2313def.inc"
53 ; timer/counter capt 1
55 ; timer/counter compare
57 ; timer/counter overflow 1
59 ; timer/counter overflow 0
63 ; uart data register empty
80 ; enable timer overflow interrupt
83 ; enable uart + rx complete interrupt
84 ldi tmp,51 ; 9600 baud, 0,2% error @ 8mhz
86 ldi tmp,((1<<RXCIE)|(1<<RXEN))
99 ; led pins are outputs
100 ldi tmp,((1<<LED_R)|(1<<LED_G)|(1<<LED_B))
104 ; enable interrupts (global)
118 ; continuous mode action
148 ldi tmp,((1<<RDOWN)|(1<<GUP))
152 ldi tmp,((1<<GDOWN)|(1<<BUP))
156 ldi tmp,((1<<BDOWN)|(1<<RUP))
161 ; do the actual rgb calculation
217 ; reset lights if loop starts
227 ldi OUTR,((1<<LED_R)|(1<<LED_G)|(1<<LED_B))
231 ; check red + jump to green check
246 ; check green + jump to blue check
254 ; switch of green led
261 ; check blue + "do the light"
285 ; increase counter + jump back to main loop