RC Servo Simple Claw

This program uses an RC Servo on port pin A1 as a claw to grip toilet rolls.

Create an open and close button on the show page. Open angle is 0 degrees and closed angle is 60 degrees.

Program


---

RC Servo Demo 3 Program: Simple Claw

This program uses an rc servo on port pin A1

as a claw to grip toilet roles.

Create an open and close button on the show page.

Open angle is 0 deg

Closed angle is 60deg

tmt3NneW

---


prog_vars =

d/run_no 0

d/claw_angle 0

prog_vars.


prog_start =

pclear

ptl 10 0 ^ts=25^tc=red^ "RC Servo Demo 3: Simple Claw"

-- open the claw by default.

svp a1 0

-- Display the buttons

pb 100 100 ^n=Open^p=svp a1 0^

pb 200 100 ^n=Close^p=svp a1 60^

-- Display the quit button

pb 300 100 ^n=Quit^p=exitprog^

prog_start.


prog_loop =

-- Waste time

patcat

prog_loop.


prog_stop =

print "Bye"

ptl 200 200 ^ts=45^ "Bye"

svp a1 0

prog_stop.