Skip to content

Commit 4bdd4a8

Browse files
author
Alan Shaw
committed
Fix solution code
1 parent 2d86d1f commit 4bdd4a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

exercises/fire_alarm/solution/solution.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ board.on('ready', function () {
4747
// Convert to celsius (TMP36)
4848
var temp = ((this.value * 0.004882814) - 0.5) * 100
4949

50-
if (!isReset && temp > threshold) {
51-
panic()
50+
if (temp > threshold) {
51+
if (!isReset) {
52+
panic()
53+
}
5254
} else {
5355
calm()
5456
isReset = false // clear the reset flag when temp drops below threshold

0 commit comments

Comments
 (0)