top of page

Light Following Robot

In this program, the JackBord robot will follow a light. This uses two LDR light sensors, each controlling the opposite motor.

Program


---

Light Following Robot Program

Robot will follow a light.

Uses two LDR light sensors, each controlling

the opposite motor.

---


prog_vars =

d/count 0

prog_vars.


prog_start =

"Light Following Robot Program"

"Setup"

-- Send left light sensor reading into right motor

-- on channel 160

gvr b1 -50 75 160

-- Send right light sensor reading into left motor

-- on channel 170

gvr b2 -50 75 170

prog_start.


prog_loop =

patdog

prog_loop.


prog_stop =


-- Stop the program.

print "Prog End!"

-- Clear the gvr commands

boff

-- Stop the motors

stop

prog_stop.




bottom of page