Button Press Command Task Call Test

Button Press Command Task Call

Program


---

Button Press Command Task Call

Test Program 18 Sep 2020

---

prog_vars =

d/count 0

d/total_presses 0

d/cat 0

d/dog 0

prog_vars.


prog_start =

print "prog started"

/d1 0

rdbg 7

bdbg 5

pticks 1

chup 50

-- Set Port A1 as an input with a pullup

btp a1 left_side

btp a2 right_side


prog_start.


prog_loop =

patdog

inc /count

patcat

get a1

bms 50

prog_loop.



left_side =

inc /total_presses

"Left /total_presses"

tg c1

test_cat

left_side.


right_side =

inc /total_presses

"right /total_presses"

tg c2

test_dog

right_side.


test_cat =

inc /count

inc /cat

"CAT count /count cat /cat"

test_cat.



test_dog =

dec /count

inc /dog

"DOG count /count dog /dog"

test_dog.


prog_stop =

print "prog stopped"

prog_stop.