#include
int main (void)
{
PORTB = 0x10; // Toggle the LED
DDRB = 0x10; // Set LED as output
return 0;
}
PORTB is an 8 bits register that represent the port B in ATmega128. to have 1 in fifth bit which stands for PB4 (start from 0), I put 0x10 in hex that is equal to 16 in decimal and 0b00010000 in binary. All of them give you same result. Have fun :)
No comments:
Post a Comment