Created
February 17, 2020 21:22
-
-
Save erdemarslan/24a42f1b0232b0da77f5065a67354b74 to your computer and use it in GitHub Desktop.
Read Raspberry Pi CPU Temperature on Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn; | |
temp = spawn('cat', ['/sys/class/thermal/thermal_zone0/temp']); | |
temp.stdout.on('data', function(data) { | |
console.log('Result: ' + data/1000 + ' degrees Celcius'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment