-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathESP32forth-knight-rider-short-version.txt
47 lines (27 loc) · 1.34 KB
/
ESP32forth-knight-rider-short-version.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
( KNIGHT RIDER -- SHORTER VERSION )
DECIMAL
: init 15 OUTPUT PINMODE 4 OUTPUT PINMODE
5 OUTPUT PINMODE 18 OUTPUT PINMODE
19 OUTPUT PINMODE 23 OUTPUT PINMODE
12 OUTPUT PINMODE 13 OUTPUT PINMODE
14 OUTPUT PINMODE 15 OUTPUT PINMODE
4 OUTPUT PINMODE 5 OUTPUT PINMODE ;
low VALUE WOW
: all ( n --) to wow WOW 15 pin WOW 4 pin
WOW 5 pin WOW 18 pin
WOW 19 pin WOW 23 pin
WOW 12 pin WOW 13 pin
WOW 14 pin WOW 2 pin ;
CREATE ARRAY
15 , 2 , 4 , 5 ,
18 , 19 , 23 , 12 ,
14 , 13 , 14 ,
12 , 23 , 19 , 18 ,
5 , 4 , 2 , 15 ,
0 VALUE P# ( Pin number )
: PINN P# PIN :
50 VALUE DEL4 ( delay to blink 1 led )
: LED# ( n--) CELLS ARRAY + @ TO P# ;
: BLINK ( n--) LED# LOW PINN DEL4 MS HIGH PINN ;
: KNIGHT-RIDER HIGH ALL 20 0 DO I BLINK LOOP ;
: RUN ( --) init 10 0 DO KNIGHT-RIDER LOOP ;