Hi,
I looked through your schematic.
- I think Diode D1 is there for protection of the Picaxe? Noble thought, but it will negatively affect your ADC measurements because the Picaxe takes its supply voltage VCC as reference (VCC being 100%), and your diode introduces a voltage drop of about 0.7V from the 5V supply. That drop will change with temperature and with supply current, and be somewhat different from one diode to the next. I recommend removing D1 altogether.
- Add a 0.1uF ceramic capacitor between Picaxe pin1 (reset) and ground.
- Add a resistor (about 180 Ohms) between the SEROUT pin and the connectors - this will protect the output against accidental short circuits.
- the impedance of your voltage divider is close to the maximum allowed (10 kOhm) for accurate measurements - its effective source impedance is somewhere between 5kOhm (slider on the very bottom) and close to 10 kOhm (slider close to top). You may want to think about making all three resistors smaller by 10x, or at least make R3 10k instead of 100k (the latter is the better solution if your circuit is battery powered and you want to minnimize current drain). You can use one of those multi-turn trimmers (instead of single turn) to make accurate adjustments easily.
- I've just re-read your post - you say you want to get values between 10 and 500. Why not simply use the full ADC range (0 to 1023) and change the scaling. In that case a single potentiometer would do, i.e. remove R5 and R6 completely and make R3 = 10 kOhm. Then change the code to
Symbol Dly=W0
readadc 0,W1
Dly=w1/2 min 10
Your current schematic will give you values of approx. 500 to 550, which your code would reduce to 50 to 55 - nor quite what you intend to do.
Wolfgang