aboutsummaryrefslogtreecommitdiff
path: root/forth/flash-led.fs
diff options
context:
space:
mode:
Diffstat (limited to 'forth/flash-led.fs')
-rw-r--r--forth/flash-led.fs13
1 files changed, 13 insertions, 0 deletions
diff --git a/forth/flash-led.fs b/forth/flash-led.fs
new file mode 100644
index 0000000..e9b8657
--- /dev/null
+++ b/forth/flash-led.fs
@@ -0,0 +1,13 @@
+-flash-led-avr
+marker -flash-led-avr
+\ PB5 is Arduino digital pin 13.
+
+$0024 constant ddrb
+$0025 constant portb
+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