aboutsummaryrefslogtreecommitdiff
path: root/forth/forth/avr/task-test-arduino-mega2560.fs
diff options
context:
space:
mode:
Diffstat (limited to 'forth/forth/avr/task-test-arduino-mega2560.fs')
-rw-r--r--forth/forth/avr/task-test-arduino-mega2560.fs48
1 files changed, 48 insertions, 0 deletions
diff --git a/forth/forth/avr/task-test-arduino-mega2560.fs b/forth/forth/avr/task-test-arduino-mega2560.fs
new file mode 100644
index 0000000..2f47a29
--- /dev/null
+++ b/forth/forth/avr/task-test-arduino-mega2560.fs
@@ -0,0 +1,48 @@
+\ *******************************************************************
+\ *
+\ Filename: task-test-arduino-uno.txt *
+\ Date: 02.10.2013 *
+\ FF Version: 5.0 *
+\ MCU: ArduinoMega2560R3 *
+\ Copyright: Mikael Nordman *
+\ Author: Mikael Nordman *
+\ *******************************************************************
+\ FlashForth is licensed according to the GNU General Public License*
+\ *******************************************************************
+\ Demo for the ArduinoMega2560R3. Blinks red led in background task.
+single
+-task1
+marker -task1
+ram hex
+\ Registers for Atmega 2560.
+$0025 constant portb
+$0024 constant ddrb
+$0023 constant pinb
+$80 constant pin7
+ram variable delay
+: ledoff pin7 portb mclr ;
+: ledon pin7 portb mset ;
+
+0 18 20 0 task: task1
+: taskloop
+ $100 delay !
+ pin7 ddrb mset \ Output
+ begin
+ delay @ ms
+ pin7 portb mtst
+ if
+ ledoff
+ else
+ ledon
+ then
+ again
+;
+
+: t1go
+ ['] taskloop task1 tinit
+ task1 run
+;
+
+' t1go is turnkey
+warm
+