Quote Originally Posted by Ioannis View Post
OK, this is not logic at all.

Please post all the test code that you used to light the two led's.

There is something that we are missing here.

Ioannis
Standby: 'WAIT FOR BUTTON TO STARTUP
Button SWITCH,1,255,0,b1,1,STARTUP 'Check Button 1 (Skip to heartbeat if Not Pressed)

Heartbeat:
'HEART BEAT INDICATOR ON LED
For DUTYCYCLE = 0 to 255 STEP 3 'THIS IS THE DELAY 255 MAX. COUNT LESS FASTER
PWM LED, DUTYCYCLE, 1 'THE NUMBER WILL DETERMINE SPEED SMALLER FASTER
Next
For DUTYCYCLE = 255 to 0 Step -2
PWM LED, DUTYCYCLE, 1 'THE NUMBER WILL DETERMINE SPEED SMALLER FASTER
Next

GOTO STANDBY


startup:

HIGH relay ' SWITCH ON POWER TO PROJECTOR
' OPTION TO SEND IR TO PROJECTOR
' OPTION TO SEND RS232 TO PROJECTOR

'TESTING WITH TIME =20
FOR TIMES = 20 TO 1 STEP -1 '1m FOR PROJECTOR WARMUP
HIGH LED 'INDICATOR FOR SYSTEM START-UP
PAUSE 250 'INDICATOR FOR SYSTEM START-UP
LOW LED 'INDICATOR FOR SYSTEM START-UP
PAUSE 250 'INDICATOR FOR SYSTEM START-UP
NEXT TIMES


running: 'WAIT FOR INTERUPT TO SHUTDOWN
Button SWITCH,1,255,0,B1,1,SHUTDOWN 'Check Button 1 (Skip to ledup if Not Pressed)
'SHUTDOWN IF BUTTON IS PRESSED
ledup:
HIGH LED 'INDICATOR FOR SYSTEM RUNNING
GOTO RUNNING 'LOOP UNTIL BUTTON IS PRESSED



shutdown:

' OPTION TO SEND IR TO PROJECTOR
' OPTION TO SEND RS232 TO PROJECTOR
'TESTING WITH TIME =20
FOR TIMES = 20 TO 1 STEP -1 '120s (2m) FOR PROJECTOR COOLDOWN
HIGH LED 'INDICATOR FOR SYSTEM START-UP
PAUSE 250 'INDICATOR FOR SYSTEM START-UP
LOW LED 'INDICATOR FOR SYSTEM START-UP
PAUSE 250
NEXT TIMES
LOW RELAY 'SHUT OFF POWER TO PROJECTOR

GOTO STANDBY

END

you see I'm tring to create a delay power switch, to allow for projector to cool down before the power is cut off. normally in my office, they just hit the power button on the remote control and throw the switch as they leave the room, usually done in the same breath. i want to create a delay so.... the power will be cut off only after 2m, to allow for cooling of the lamp, this will make the lamp last longer before the next change is required.
so here we have 3 states:
standby: power realy is OFF, LED gives a heartbeat light
startup: power relay is ON, LED Flashes for 30s (does not allow you to switch OFF the power)
running: power relay is ON, LED is ON
shutdown: LED flashes (2m to allow cooling) relay OFF
go to standby wait for next cycle

very simple requirement, but I cannot get the relay to go 'ON' at the same time LED to go "ON"