A/D Values different than expected

I’m on to a new phase of my project, and unfortunately I am once again having strange issues. I am using a photoresistor to determine the color of painted balls, and the circuit works fine. When I test using LynxTerm, the values I get are perfect – I can easily tell which balls are black or white (as well as whether a ball is actually present). However, the values my BS2 is getting are very different from them and don’t seem to be accurate. Any advice? I’m testing the ball twice, once with a red LED on and once with it off. The values the stamp reports make white and black seem one and the same.

I’m using the following:

sensorValue VAR Byte
SEROUT 16, 396, "VA", 13]
SERIN 16, 396, [sensorValue]

I know that both SERIN and SEROUT are the correct BAUD and pin because they work perfectly for movement and queries, but these values just don’t add up.

What version of the firmware are you running? I suspect it is version 1-03XE. If you upgrade to version 1-06XE it will fix the problem. It is the same as version 1.03XE with the following changes. Pulse Offset bug fixed. Added a 600uS transmit delay and a 70uS pacing for the query commands. This will allow communication with slower processors, such as the BS2. Sorry you had to struggle with it. :stuck_out_tongue:

[edit] Added reply just as the one above was made. :laughing: I cannot check it now, but I will try it out as soon as I get a chance when I get home. Thanks :smiley:

As an example, here is the data that I’m receiving:

                                          LynxTerm
                 No ball                  Black                   White

LED=Off        98                        0                          3  

LED=On        165                      150                       223



                             Basic Stamp 2 reported values
                 No ball                  Black                   White

LED=Off        246                      192                       193                         

LED=On        245                      254                       255

As you can see, the first set of numbers would be absolutely perfect … if they worked :cry:

Ok you piqued my curiosity. You must provide images of your project. :smiley:

Jim you beat me to it, I was just gona ask the same thing. We need pictures of this project it sounds very interesting!

The link appears to be broken :cry:

lynxmotion.com/images/files/ … 1-06XE.abl

Brings me to a page not found error. Is there another source I can try?

Thanks

It’s a permission thing with the new server. We will fix it. Sorry…

I have made the changes, but your cache may still prevent you from receiving it. I will email it to you.

It works perfectly now :smiley: :smiley: Thanks very much, the deadline is fast approaching and I was really starting to worry :blush:

I’d be happy to. I’ll get them as soon as I can (later tonight or tomorrow). :smiley: