From 2f83a0bea9da444e3d70569eba3d6847ca02be03 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 21 Sep 2018 21:59:17 +0200 Subject: ... --- forth/elegoo/flash-led.fs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 forth/elegoo/flash-led.fs (limited to 'forth/elegoo/flash-led.fs') 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 -- cgit v1.2.3