diff options
author | rodri <rgl@antares-labs.eu> | 2021-06-05 11:10:23 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2021-06-05 11:10:23 +0000 |
commit | edf5f145013aa28ffbc7f19f874cd489a92f8449 (patch) | |
tree | 05a7dfdae1b63a79bdfbb1fab84af35a51b5b99c /c/blink | |
download | avrtoys-edf5f145013aa28ffbc7f19f874cd489a92f8449.tar.gz avrtoys-edf5f145013aa28ffbc7f19f874cd489a92f8449.tar.bz2 avrtoys-edf5f145013aa28ffbc7f19f874cd489a92f8449.zip |
Diffstat (limited to 'c/blink')
-rw-r--r-- | c/blink/blink.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/c/blink/blink.c b/c/blink/blink.c new file mode 100644 index 0000000..bb4495a --- /dev/null +++ b/c/blink/blink.c @@ -0,0 +1,23 @@ +#include <avr/io.h>
+#define F_CPU 16000000UL
+#include <util/delay.h>
+
+enum{
+ Delay = 300
+};
+
+int
+main()
+{
+ int led;
+
+ led = 1<<PB1;
+ DDRB |= led;
+
+ for(;;){
+ PORTB ^= led;
+ _delay_ms(Delay);
+ }
+ return 0;
+}
+
|