So im having a little trouble understanding variables with Picaxe. I have read the manuals and watch some videos and just still confusing to be honest.
So im using the picaxe 08 chip. Basically all im trying to do is use a photo cell that will have a constant laser aimed on it. When the beam is broken I want it to trip a relay on for a certain amount of time
Now Ive been told by a member here on the forum that a photocell will have to use the readadc command, which I am but Im just not completely understanding how to use variables.
So can anyone help me out here?
So here is the code I have so far.
And here is a video of what its doing so far,
Here are a few pictures too.
So im using the picaxe 08 chip. Basically all im trying to do is use a photo cell that will have a constant laser aimed on it. When the beam is broken I want it to trip a relay on for a certain amount of time
Now Ive been told by a member here on the forum that a photocell will have to use the readadc command, which I am but Im just not completely understanding how to use variables.
So can anyone help me out here?
So here is the code I have so far.
Code:
main:
readadc c.1,b0
if b0 > 50 then high 4 goto ldr1 endif
if b0 < 50 then low 4 goto ldr2 endif
goto main
ldr1:
high c.4
wait 5
goto main
ldr2:
goto main
And here is a video of what its doing so far,
Here are a few pictures too.