Step 9Program The PICAXE
The actual code starts after the line below:
symbol Relay = 1
symbol Motor = 2
BEGIN:
readadc 4,b1
' this line measures the outside light level
if b1 > 240 then goto OPEN
' increase this number (240) to make the blinds open later in
' the morning - decrease it to open earlier
if b1< 200 then goto CLOSE
' increase this number (200) to make the blind close earlier in
' the evening - decrease it to close later
goto BEGIN
OPEN:
if b3 = 1 then goto BEGIN
' this command prevents the blinds from trying to open again if
' they are already closed
high Relay
pause 10
' this command delays applying current to the motor until the
' relay contacts are closed
High Motor
pause 6600
' adjust this number (6600) to tweak the blind open position
' increase to open more - decrease to open less (see note below)
low Motor
pause 10
' this command delays opening the relay contacts until after
' current is cut off to the motor
low Relay
let b3 = 1
' this command prevents the blinds from trying to open again if
' they are already closed
goto BEGIN
CLOSE:
if b3 = 2 then goto BEGIN
' this command prevents the blinds from trying to close again if
' they are already closed
high Motor
pause 6150
' adjust this number (6150) to tweak the blind closed position -
' increase to close more - decrease to close less
' (see note below)
low Motor
let b3 = 2
' this command prevents the blinds from trying to close again if
' they are already closed
goto BEGIN
' NOTE: when making adjustments to the open and closed blind
' positions, it is usually best to adjust only one of these
' settings as each will affect the other
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|



















































