AVR Atmega2560 Input Output Peripherals
AVR Atmega2560 Input Output Peripherals
AVR Atmega2560 Input Output Peripherals
h>
#include <avr/interrupt.h>
#include <util/delay.h>
void port_init(void)
PORTA =0X00; //set initial value of the PORTA pins (PA3-PA0) to logic 0
DDRL =0X18; //Setting PL3 and PL4 pins as output for PWM generation
PORTL =0X18; //PL3 and PL4 pins are used for velocity control using PWM
}
void forward (void) //both wheels forward
void buzzer_on(void)
void buzzer_off(void)
//Main Function
int main()
port_init();
motion_pin_config();
while(1)
forward();
_delay_ms(500);
stop();
buzzer_on();
_delay_ms(200);
buzzer_off();
//write your code here to moveto trace the straight line(in forward direction) using the
path traversed by the Firebird V for 5 seconds