Basic stamp 2 programing

You can’t change the output of the sensor. However, you can manipulate the output value from the sensor within your program.

If you get a high value when you cover the cell, you can use an IF statement to change that to a 0 or whatever you require for a return value. This is the beauty of programming. :smiley:

So, you can do something like (pseudo code):

IF output > 0 THEN output = output * -1 ' Make output value negative ELSEIF output <= 0 output = 1 ENDIF
So, you can manipulate the output value from the sensor, but you can not change what the sensor actually returns. I think this is where you are misunderstanding something.

8-Dale

Yeah, I have tried every posible configuration on my end and I only get values that go up. I have tried pull-ups, pull downs and swaped parts and code. The only way I know how to do it is in code.

Did the instructor provide schematics for the wiring of the photo cell? Also, does the input into the chip where the photo cell would connect float, or is it tied high or low? Does the chip have an increasing output value as an increasing voltage is applied to the input?