23 lines
424 B
C
23 lines
424 B
C
|
/*
|
||
|
* led.c
|
||
|
*
|
||
|
* Created: 06.10.2013 16:32:15
|
||
|
* Author: netz
|
||
|
*/
|
||
|
|
||
|
#include <avr/io.h>
|
||
|
|
||
|
void ledg(int mask) {
|
||
|
int rgb = 0;
|
||
|
rgb |= (mask & (1<<0)) ? (1<<0) : (0<<0);
|
||
|
rgb |= (mask & (1<<1)) ? (1<<1) : (0<<1);
|
||
|
rgb |= (mask & (1<<2)) ? (1<<2) : (0<<2);
|
||
|
|
||
|
PORTB &= ~((1<<PINB5) | (1<<PINB6) | (1<<PINB7));
|
||
|
PORTB |= (rgb<<PINB5);
|
||
|
}
|
||
|
|
||
|
void init_led()
|
||
|
{
|
||
|
DDRB |= (1<<PINB7) | (1<<PINB6) | (1<<PINB5);
|
||
|
}
|