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
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"
Hi,
Sounds like you're getting bit by the ever so clasic read-modify-write issue caused by not having analog functionallity on related pins turned off.it seems it is not possible to have 2 outputs HIGH at the same time....? i tried to lite up 2 leds:
/Henrik.Code:CMCON = 7 ' Turn off comparator on 12F675 ANSEL = 0 ' None of the I/O connected to the ADC
What Henrik stated must be placed on top of your program.
Try it and reply the results.
Ioannis
Thanks henrik, Ill try that on Monday. Have a great weekend..!
Philip
Hi henrik, I seem to have lost A.0 & A.1 & A.3 as outputs....? I tried to swap the led around the port, but they won't light up.
A.2 is the LED
A.4 is the RELAY and
A.5 is the Button
Bookmarks