hi
i am new to embedded programming and am currently using a stk500 with a atmega32 mcu. i recently was able to program a simple led blink program which turns on and off all the leds connected to port b of the mcu as shown below:
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB=0xFF;
while(1)
{
PORTB=0xFF;
_delay_ms(100);
PORTB=0x00;
_delay_ms(100);
}
}
this code works fine but then i want to just turn on the led and so i tried
#include <avr/io.h>
int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
while(1)
{
}
}
after programming my mcu i expected all leds to light up but none of them lighted up, maybe im missing something?
i am new to embedded programming and am currently using a stk500 with a atmega32 mcu. i recently was able to program a simple led blink program which turns on and off all the leds connected to port b of the mcu as shown below:
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB=0xFF;
while(1)
{
PORTB=0xFF;
_delay_ms(100);
PORTB=0x00;
_delay_ms(100);
}
}
this code works fine but then i want to just turn on the led and so i tried
#include <avr/io.h>
int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
while(1)
{
}
}
after programming my mcu i expected all leds to light up but none of them lighted up, maybe im missing something?