Renamed example dirs to examples.

This commit is contained in:
2022-07-29 14:01:15 +02:00
parent d89f30e4ce
commit ac69187b5f
7 changed files with 30 additions and 2 deletions

29
examples/blink.c Normal file
View File

@@ -0,0 +1,29 @@
#include <util/delay.h>
#include <stdio.h>
#include "../ard/serial.h"
#include "../ard/pins.h"
#include "../ard/util.h"
void prepare();
void loop();
int main(){
prepare();
while(1){
loop();
}
}
void prepare(){
pins_init();
serial_init(9600);
pin_mode(13, OUTPUT);
}
void loop(){
digital_write(13, LOW);
_delay_ms(1000);
digital_write(13, HIGH);
_delay_us(1000000);
}

3
main.c
View File

@@ -18,7 +18,6 @@ int main(){
void prepare(){
pins_init();
serial_init(9600);
pin_mode(13, OUTPUT);
}
@@ -26,5 +25,5 @@ void loop(){
digital_write(13, LOW);
_delay_ms(1000);
digital_write(13, HIGH);
_delay_ms(1000);
_delay_us(1000000);
}