// Code from Optimizing Arduino Code: no setup(), no loop()
// https://youtu.be/-XPrSScamXc
//DDRD = B11111110; // sets Arduino pins 1 to 7 as outputs, pin 0 as input
//DDRD = DDRD | B11111100; // this is safer as it sets pins 2 to 7 as outputs
// without changing the value of pins 0 & 1, which are RX & TX
//See the bitwise operators reference pages and The Bitmath Tutorial in the Playground
//PORTD is the register for the state of the outputs. For example;
//PORTD = B10101000; // sets digital pins 7,5,3 HIGH
//You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRD register or with pinMode().
//PIND is the input register variable It will read all of the digital input pins at the same time.
int main() {
// initialize digital pin LED_BUILTIN as an output.
DDRB = 0xFF;
while (true) {
PINB = 0xFF;
for (long i = 0; i < 500000; i++) {
asm("");
}
}
}