Hello everyone,
I am currently working on a project in which I am interfacing a tmp36 temperature with the beaglebone black, for the purpose of measuring temperature and I was wondering how would I be able to store these temperature readings into a text file?
P.s I am programming in javascript and below is a copy of my code.
var b = require('bonescript');
console.log("Started");
var tempPin = 'P9_40';
b.analogRead(tempPin, printTemp);
function printTemp(aRead) {
console.log("Geting temp");
var x = (aRead.value * 1800/1024);
console.log("value " + aRead.value);
console.log("x: " + x);
var cel = 100*x -50;
var fah = (cel *9/5)+32;
console.log("Fah: " + fah);
console.log("Cel: " + cel);
}
Any help would be greatly appreciated, thanks in advance!