aboutsummaryrefslogtreecommitdiff
path: root/forth/elegoo/flash-led.fs
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-21 21:59:17 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-21 21:59:17 +0200
commit2f83a0bea9da444e3d70569eba3d6847ca02be03 (patch)
tree20163bbd478f40679d22f5e964aef94c688639f0 /forth/elegoo/flash-led.fs
parent125127ee67891e1813164e20aa848a80b9d2f2a0 (diff)
...
Diffstat (limited to 'forth/elegoo/flash-led.fs')
-rw-r--r--forth/elegoo/flash-led.fs23
1 files changed, 23 insertions, 0 deletions
diff --git a/forth/elegoo/flash-led.fs b/forth/elegoo/flash-led.fs
new file mode 100644
index 0000000..08fc643
--- /dev/null
+++ b/forth/elegoo/flash-led.fs
@@ -0,0 +1,23 @@
+-flash-led-avr
+marker -flash-led-avr
+\ PB5 is Arduino digital pin 13.
+
+$0023 constant pinb
+$0024 constant ddrb
+$0025 constant portb
+
+$0026 constant pinc
+$0027 constant ddrc
+$0028 constant portc
+
+$0029 constant pind
+$002a constant ddrd
+$002b constant portd
+
+1 #5 lshift constant bit5
+
+: init bit5 ddrb mset ; \ set pin as output
+: do_output portb c@ bit5 xor portb c! ; \ toggle the bit
+: main init begin do_output #500 ms again ;
+
+main