On Mon, 10 Jul 2017 16:10:50 -0700 (PDT), Mala Dies
<
fun...@gmail.com> declaimed the following:
>
>I have another set of software that I picked up along the way, i.e.
>probably from that book, "Evil Genuis," series from Mr. Rush. Anyway, here
>goes it. Oh but first, I know people are getting tired of seeing the same
>ole, same ole. This does not discourage me from posting.
>
What is discouraging is the lack of any attempts to analyze/debug the
problem... Posting code samples from books, stating an invalid result, and
that is where the effort seems to end.
>*var b = require('bonescript');*
>
>*var inputPin = "P9_40";*
>
>*getBeagleTemp();*
>
>*function getBeagleTemp() {*
>* var value = b.analogRead("P9_40");*
>
>* var millivolts = value * 1800;*
>* var x = (millivolts - 500)/10;*
>* var z = (x * 9/5) - 32;*
>* setTimeout(getBeagleTemp, 10000);*
>
>* console.log("x=" + x + "\tz=" + z);*
>*}*
>
>I am getting temperatures in the Fahrenheit of 201 and in Celsius of 129.
>This is not my temp. in the house.
>
Again, work the results backwards to figure out the numbers (again,
ignore Fahrenheit).
x = 129
129 = (mV - 500) / 10
1290 = mV - 500
1790 = mV
{Not important, since it just converts the voltage back to the analogRead
0..1 range
mV = val * 1800
1790 = val * 1800
1790/1800 = val
0.9944 = val
}
Before, the reported temperature was near -50, now it is near +130.
-50 is GND (0.0V), +130 is maximum (safe) for BB (1.8V). The minor
differences could be capacitive coupling and cross-talk on the wiring.
My only logical conclusion is that you have changed the wiring some,
and are not properly connected to the TMP36, instead somehow being
connected to either the GND or the ADC-Voltage source.
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/