Skip to content

Commit

Permalink
SN01 cpp polling removed
Browse files Browse the repository at this point in the history
  • Loading branch information
KalbeAbbas committed Nov 25, 2020
1 parent 64689f0 commit a66ea47
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions itr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ namespace ITR
let onReceivedDataHandler: (pm1: number, pm25: number, pm10: number) => void;
// SG35 Variables end


basic.showIcon(IconNames.Chessboard)

basic.pause(25 * 1000)


// SW01 function call start

Expand All @@ -236,7 +241,7 @@ namespace ITR

// SN01 function call start

startParallel(function () {
control.inBackground(function () {
while (true) {
parseNMEA()
basic.pause(10)
Expand All @@ -263,7 +268,6 @@ namespace ITR
serial.redirect(SerialPin.P1, SerialPin.P0, 115200)
serial.setRxBufferSize(200)

basic.showIcon(IconNames.Chessboard)
basic.pause(2000)
serial.writeString("ATE0" + cw01_vars.NEWLINE)
basic.pause(300)
Expand Down Expand Up @@ -1432,5 +1436,9 @@ namespace ITR
}
}
}

/*function startParallel(u: () => void) {
control.inBackground(a);
}*/

}

0 comments on commit a66ea47

Please sign in to comment.