Skip to content

Commit e15d0d7

Browse files
author
Alan Shaw
committed
Fix solution code
1 parent 4a69fc9 commit e15d0d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exercises/fire_alarm/solution/solution.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,20 @@ board.on('ready', function () {
3636
}
3737
})
3838

39+
var blazing = false
40+
3941
function fire () {
42+
if (blazing) return
4043
led.strobe(1000)
4144
siren()
45+
blazing = true
4246
}
4347

4448
function noFire () {
49+
if (!blazing) return
4550
led.stop().off()
4651
stopSiren()
52+
blazing = false
4753
}
4854

4955
var sirenTimeout = null

0 commit comments

Comments
 (0)