I don't know why the text is still blank here
There is no special error, and what I want is to save the accelerometer and heart rate in a text file every 5 seconds append and then know the file size in the text collected during the day.
Can you give me some advice on how to do it?
let thisDate = new Date();
let recFilename = `RawDataLogger-${thisDate.getFullYear()}${("0" + (thisDate.getMonth() + 1)).slice(-2)}${("0" + (thisDate.getDate() + 1)).slice(-2)}.txt`;
var timer = setInterval(function(){
refreshData();
//정상값 출력
//console.log(accelData.text);
//console.log(hrmData.text);
},5000)
function refreshData() {
// Populate ArrayBuffer
buffer[0] = thisDate.getTime();
buffer[1] = accelData.text;
// Write ArrayBuffer to file
append("utf8.txt" , buffer);
}
function append(filename, buffer) {
let fd = fs.openSync(filename, 'w+');
fs.writeSync(fd, buffer);
fs.closeSync(fd);
console.log("is append" , buffer);
}
can you help?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.