Something is backwards
Maintenance man
Posts: 17
Hi to all. I am working with a 555 timer and light sensitive resistor switch to make a high or low to the input on pin 4 of the 555 timer. I know that there has to be a high on pin 4 to make the 555 go high/ low. I am using pin 10 as the input and pin 0 as the output going to a LED. I want the LED to flash for 3 seconds then off for 3 seconds then repeat while there is a shadow on the sensor, then turn off when there is no shadow on it. My program works the opposite where the LED flashes 3 seconds then 3 seconds off then repeats when there is no shadow on the sensor and turns off when I put a shadow on the sensor. If someone could please let me know what I need to do with my program to correct this problem. I tried switching the highs and lows around, but my program would not properly work. I know it is something simple but I guess I am just not seeing it. Thank you all for your help.
'(STAMP BS2) n VAR work blink: n = IN10 IF n = 1 THEN blink HIGH 0 PAUSE 3000 LOW 0 PAUSE 3000 GOTO blink off: n = in 10 IF n = 0 then off HIGH 0 GOTO off
Comments
Are you sure the photocell (LDR, ugh) is high & low as you intend it to be? A simple hardware voltage divider must be properly calibrated to use a photocell with a simple IF check. RCtime with a cap is probably easier to start with.
BTW, should be "n var word" not work. Also, your program as written can never get to label "off". And if it did, it could never leave.
--Rich