Writing to text file

Beaglebone Black related support

Writing to text file

Postby Chucky » 01 May 2017, 20:15

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');

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!
Posts: 1
Joined: 01 May 2017, 20:01

support RuneAudio Donate with PayPal

Return to Beaglebone Black

Who is online

Users browsing this forum: No registered users and 0 guests