Skip to content

Commit

Permalink
Add sentinel values
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan2909 authored Mar 24, 2023
1 parent a5fcb1a commit bbd9f64
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
radio.setGroup(0);

let pulse: number = null;
let time: number = null;
let movement: number = null;
let pulse = -1;
let time = -1;
let movement = -1;

IM01.overwriteFile("info.txt", `${control.deviceSerialNumber().toString()}\n${control.deviceName()}\n`);
IM01.appendFile("data.csv", "time,pulse,movement\n");
Expand All @@ -17,5 +17,8 @@ radio.onReceivedValue((name, value) => {
} else if (name == "movement") {
movement = value;
IM01.appendFileLine("data.csv", `${time},${pulse},${movement}`);
pulse = -1;
time = -1;
movement = -1;
}
});

0 comments on commit bbd9f64

Please sign in to comment.