Shop OBEX P1 Docs P2 Docs Learn Events
Something is backwards — Parallax Forums

Something is backwards

Maintenance manMaintenance man Posts: 17
edited 2011-11-30 09:29 in BASIC Stamp
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

  • ercoerco Posts: 20,256
    edited 2011-11-29 11:11
    Much depends your hardware hookup. Got a pic & schema of how your photocell is hooked up to pin 10?

    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.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-11-30 08:47
    You might get more replies if you change the subject of your message to indicate what it is about.
  • RiJoRiRiJoRi Posts: 157
    edited 2011-11-30 09:29
    Please post a schematic showing your setup! I can not envision what you are trying to do with the 555.

    --Rich
Sign In or Register to comment.