// Arduino Uno with a 'main' function.
// There is no Arduino layer.
//
// The generated assembly can be viewed:
// Right click on source code.
// Select "Command Palette F1"
// Type "asse" to search for:
// "View Compiled Assembly Code Listing"
// Select that and wait for the project to be compiled.
// If that is successful, then a new tab appears.
// It is a file "sketch.lst"
// That is the generated assembly code.
// It also works with Arduino code.
// With Arduino code is is allowed to use
// direct register access or make a block
// of assembly code.
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB = (1 << PORTB5);
while(1)
{
for (int i = 0; i < 200; i++)
{
PORTB |= (1 << PORTB5);
_delay_us(1000UL);
PORTB &= ~(1 << PORTB5);
_delay_us(1000UL);
}
_delay_us(500000UL);
}
}