Quote Originally Posted by mystified View Post
clean
What's that for?

define adc_bits 10 'adc settings
define adc_clock 3 ' adc setting
define adc_sampleus 50 'adc setting
Those aren't any good as they are written (unless there's something wrong with cut-and-paste, which happens sometimes)

tone=1+(rdg)*102 'converts adc value to a tone value of 1 to 120
' necessary to divide by 10 to avoid 65536 word limit
'adc of 0=tone of 1, adc of 1023 = tone of 120
sound mpin,[tone,20] 'provides a tone proportional to input volt duration = 20x12=120 min
Check your math...
If rdg = 1 then
tone = 1 + 1 * 102 = 103
If rdg = 2 then
tone = 1 + 2 * 102 = 205
If rdg = 3 then
tone = 1 + 3 * 102 = 307
if rdg = 500 then
tone = 1 + 500 * 102 = 51001
Where is this 'divide by 10' you speak of?
You declare tone as a word variable, yet the PBP manual states that values from 0-127 produce tones, 128-255 produces white noise, and therefore only values from 0-255 are legal, implying that tone should be a byte variable...
Why not hook up an LCD to make sure your A/D is working in the first place? Then you can actually visualize your values to be output for tones.