Answer the question
In order to leave comments, you need to log in
How to write a program to blink an LED on an Atmel328p controller?
I work in Atmel sudio 6.1, AVR Dragon programmer, Atmel328p chip.
You need to write a program that will blink an LED.
Program code
#define F_CPU 250 //Частота на которой будет работать микроконтроллер. В настройках компилятора указана эта же частота
#include <util/delay.h> //Библиотека определения функции задержки
#include <avr/io.h> //Библиотека прерываний
int main(void)
{
DDRB = 0x01;
while(1);
{
PORTB |=(1<<PB5);
_delay_ms(50);
PORTB &= ~(1<<PB5);
_delay_ms(50);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question