-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibtnr.fs
More file actions
32 lines (25 loc) · 761 Bytes
/
libtnr.fs
File metadata and controls
32 lines (25 loc) · 761 Bytes
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
: \ESC 43 #, ;
: \\ 0 #,
begin
1+ key
dup \ESC drop drop
dup \ESC = drop
dup \ESC = -if 32 #, emit then drop
dup \ESC = invert -if over emit then drop
dup BL max \ESC xor while
drop drop
repeat
drop drop 1- drop
;
: wiggle blink blink blink blink blink ;
\ literals
: dlit dup 1+ ; \ simple and does what's wanted
: jlit dlit dlit swap - ; \ always exactly '1'
: nxt jlit + echo ; \ show next char
: led 25 #, ;
: blik led on 100 #, ms led off 800 #, ms ;
: blinks ( n -- )
1- for blik next ." ok " ;
\ arbitrary flag values -77 and -22 - systematic choices are a TODO item.
: stop -77 #, fl! ." core_1 (loop1) " led off ;
: start -22 #, fl! 2 #, ms ." core_1 (loop1) " ;