by ben2008 » Mon Dec 07, 2009 10:30 pm
by ben2008
Mon Dec 07, 2009 10:30 pm
Hi and sorry,
this question is very common i guess, but i did not find an answer in at least 2h.
how can i turn an LED on the CM5 (atmega128) on?
I already programmed a lot with AVR and C and get my robo to do funny things ... i also got an time interrupt .. but ... i dont get that leds to blink ...
i tried something like this
- Code: Select all
DDRE = 0; //set port E to input direction
PORTE |= _BV(PE4); //enable pull-up resistor 4
EIMSK |= _BV(INT4); //enable interrupt 4
PORTD = PIND ^ ( 1 << PD7 );
PORTC &= ~_BV(PC3); //turns AUX-LED on
PORTC &= ~_BV(PC4); //turns AUX-LED on
PORTC &= ~_BV(PC5); //turns AUX-LED on
PORTC &= ~_BV(PC6); //turns AUX-LED on
I dont know exactly what i am doing by editing PORTC oder DDRE but i only want to get that led on (any led on the cm5)
Hi and sorry,
this question is very common i guess, but i did not find an answer in at least 2h.
how can i turn an LED on the CM5 (atmega128) on?
I already programmed a lot with AVR and C and get my robo to do funny things ... i also got an time interrupt .. but ... i dont get that leds to blink ...
i tried something like this
- Code: Select all
DDRE = 0; //set port E to input direction
PORTE |= _BV(PE4); //enable pull-up resistor 4
EIMSK |= _BV(INT4); //enable interrupt 4
PORTD = PIND ^ ( 1 << PD7 );
PORTC &= ~_BV(PC3); //turns AUX-LED on
PORTC &= ~_BV(PC4); //turns AUX-LED on
PORTC &= ~_BV(PC5); //turns AUX-LED on
PORTC &= ~_BV(PC6); //turns AUX-LED on
I dont know exactly what i am doing by editing PORTC oder DDRE but i only want to get that led on (any led on the cm5)