where did I go wrong?
martintelefont
Posts: 9
Hi all
well I tried to adapt some stamp 1 code to the stamp 2. Basic scenario P0 connects to a 10k thermistor which connects to a .1 uF capacitor which goes to ground
on the debug i get "c" when DEBUG W0 or "162" when DEBUG DEC
Any thoughts?
well I tried to adapt some stamp 1 code to the stamp 2. Basic scenario P0 connects to a 10k thermistor which connects to a .1 uF capacitor which goes to ground
on the debug i get "c" when DEBUG W0 or "162" when DEBUG DEC
Any thoughts?
' {$STAMP BS2} ' {$PBASIC 2.5} ' Program THERM.BAS co0 CON 162 co1top CON 255 co1btm CON 2125 co2bt1 CON 25 co2top CON 3 co2btm CON 50 Check_temp: RCTIME 0,46,W0 W1 = W0*W0/co2bt1*co2top/co2btm W0 = W0*co1top/co1btm+W0 W0 = co0+W1-W0 DEBUG DEC W0 PAUSE 1000 ' Wait 1 second for next GOTO Check_temp ' temperature reading.
Comments
Also remember that the BS2 has different timing than the BS1 (like for RCTIME) and that expressions are not always evaluated from left to right on the BS2 as they are on the BS1. You can use parentheses on the BS2 to group items the way you want them.