Why don't you just learn how to use the ADC module from userspace LInux,
then setup the ADC yourself, and read from the file in oneshot mode every
cycle ? It's not that difficult . . .

On Mon, Apr 17, 2017 at 5:53 PM, Mala Dies <[email protected]> wrote:

> *var b = require('bonescript');*
> *var x = celsius;*
> *var z = farenheit;*
> *var inputPin = "P9_39";*
>
> *getBeagleTemp();*
>
> *function getBeagleTemp() {*
> *    var value = b.analogRead(inputPin, x, z);*
>
> *    var millivolts = value * 1800;*
> *    var x = (millivolts - 500)/10;*
> *    var z = z (9/5 * x) - 32;*
> *    setTimeout(getBeagleTemp, 10000);*
>
> *    console.log(z);*
> *}*
>
> *Hello...*
>
> I tried this software outside of the Cloud9 IDE. I ran into an error. It
> says that it could not find the module *bonescript. *Directly afterwards,
> I tried to download, via npm, bonescript to see if there were any updates.
> I received a bunch of error codes. I guess I am just going to try the
> Cloud9 IDE for now.
>
> Um, if anyone needs to see the bonescript download error codes, let me
> know. Oh and the first error while downloading bonescript was a node issue.
> Bonescript must use an update version of node while what I need is an
> outdated version of node.
>
> Seth
>
> P.S. If anyone can make that software work, let me know. Oh and BBB!
>
>
>
> On Saturday, April 15, 2017 at 4:21:18 PM UTC-5, Mala Dies wrote:
>>
>> I keep getting 49.xxxxxxx and 57.xxxxxxx as the temperatures but I know
>> it is incorrect. Any suggestions?
>>
>> Seth
>>
>>
>> On Saturday, April 15, 2017 at 4:17:37 PM UTC-5, Mala Dies wrote:
>>>
>>> *var b = require('bonescript');*
>>>
>>> *function readTemp() {*
>>> *    b.analogRead('P9_39', displayTemp);*
>>> *}*
>>> *function displayTemp(reading) {*
>>> *    var millivolts = reading.value * 1800;*
>>> *    var tempC = (millivolts - 500) / 10;*
>>> *    var tempF = (tempC * 9/5) + 32;*
>>> *    console.log("Temp C=" + tempC + "   Temp F=" + tempF);*
>>> *}*
>>>
>>> *setInterval(readTemp, 10000);*
>>>
>>> I found this software and changed it a bit. I use P9_39 or P9_40, i.e.
>>> whichever. I get a read out but it is not what I thought it would be for
>>> tempF.
>>>
>>> Seth
>>>
>>> P.S. I got this software from a book, I think. It is either from,
>>> "Programming the BeagleBone Black," or the software on the updated images,
>>> e.g. analog2.js. I will research it again.
>>>
>>>
>>>
>>> On Friday, April 14, 2017 at 10:16:23 PM UTC-5, Mala Dies wrote:
>>>>
>>>> Hello,
>>>>
>>>> I am on P9_40 with my TMP36 temperature sensor. I used the book, "30
>>>> BeagleBone Black Projects." It is lesson number 11. It has some BoneScript
>>>> lessons but I think the book is outdated. Does anyone know of the updates
>>>> and how it pertains to temperature sensors?
>>>>
>>>> Seth
>>>>
>>>> P.S. Here is the software I cannot get to read. I am going to try and
>>>> set it up in Cloud9 instead of on PuTTY and see what happens.
>>>>
>>>> var b = require('bonescript');
>>>>
>>>> var inputPin = "P9_40";
>>>>
>>>> getBeagleTemp();
>>>>
>>>> function getBeagleTemp();
>>>>     var value = b.analogRead(inputPin);
>>>>
>>>>     var millivolts = value * 1800;
>>>>     var temp_c = ( millivolts - 500)/10;
>>>>
>>>>     setTimeout(getBeagleTemp, 1000);
>>>>
>>>>     console.log(temp_c);
>>>> }
>>>>
>>> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beagleboard/e1dac766-ff75-4dec-af98-0e9c6db1407e%40googlegroups.com
> <https://groups.google.com/d/msgid/beagleboard/e1dac766-ff75-4dec-af98-0e9c6db1407e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORpxg95BfTo_16SVq8FmRV%3DZHjiD6VKQTe2oHqeX5LW%2Byw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to