while(1)
{
buzzer_on();
//delay
_delay_ms(1000);
buzzer_off();
//delay
_delay_ms(1000);
}
}
We are now going to compile this code to generate the hex file which we will load on the
Robot's microcontroller. Select "Build" menu and click on "Rebuild All". It will compile the
"buzzer_test.c" code and will generate "buzzer_test.hex" file for the robot's microcontroller.
You can verify successful compilation in the bottom most "Build" window of the AVR Studio.
© NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA
SPARK V ATMEGA16 Hardware Manual
Figure 4.24
Figure 4.25
57
Need help?
Do you have a question about the SPARK V ATMEGA16 and is the answer not in the manual?