update
This commit is contained in:
parent
d773ce3b47
commit
e3ac3b2b67
20
server.js
20
server.js
@ -146,3 +146,23 @@ io.on('connection', (client) => {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
const imu = require("node-sense-hat").Imu
|
||||
|
||||
const IMU = new imu.IMU()
|
||||
|
||||
IMU.getValue((err, data) => {
|
||||
if (err !== null) {
|
||||
console.error("Could not read sensor data: ", err)
|
||||
return
|
||||
}
|
||||
|
||||
console.log("Accelleration is: ", JSON.stringify(data.accel, null, " "))
|
||||
console.log("Gyroscope is: ", JSON.stringify(data.gyro, null, " "))
|
||||
console.log("Compass is: ", JSON.stringify(data.compass, null, " "))
|
||||
console.log("Fusion data is: ", JSON.stringify(data.fusionPose, null, " "))
|
||||
|
||||
console.log("Temp is: ", data.temperature)
|
||||
console.log("Pressure is: ", data.pressure)
|
||||
console.log("Humidity is: ", data.humidity)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user