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)|(1<<TXEN))
99 ; led pins are outputs
100 ldi tmp,((1<<LED_R)|(1<<LED_G)|(1<<LED_B))
104 ; enable interrupts (global)
123 ; continuous mode action
153 ldi tmp,((1<<RDOWN)|(1<<GUP))
157 ldi tmp,((1<<GDOWN)|(1<<BUP))
161 ldi tmp,((1<<BDOWN)|(1<<RUP))
166 ; do the actual rgb calculation
222 ; reset lights if loop starts
232 ldi OUTR,((1<<LED_R)|(1<<LED_G)|(1<<LED_B))
236 ; check red + jump to green check
251 ; check green + jump to blue check
259 ; switch of green led
266 ; check blue + "do the light"
290 ; increase counter + jump back to main loop
314 cpi tmp,0x63 ; 0x63 = 'c'
315 breq SET_CONTINUOUS_MODE
316 cpi tmp,0x73 ; 0x73 = 's'
317 breq SET_SPECIFY_MODE