Skip to content

Commit

Permalink
Fix reaction-time code
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwork committed Jun 2, 2024
1 parent 0017b77 commit fe8eaec
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/projects/reaction-time/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ let end = 0
let false_start = false
let running = false
input.onPinPressed(TouchPin.P0, () => {
running = false
false_start = false
basic.showNumber(3)
basic.showNumber(2)
basic.showNumber(1)
basic.clearScreen()
running = false
false_start = false
})
input.onPinPressed(TouchPin.P1, () => {
Expand All @@ -120,12 +120,12 @@ let end = 0
let false_start = false
let running = false
input.onPinPressed(TouchPin.P0, () => {
running = false
false_start = false
basic.showNumber(3)
basic.showNumber(2)
basic.showNumber(1)
basic.clearScreen()
running = false
false_start = false
basic.pause(1000 + randint(0, 2000))
})
input.onPinPressed(TouchPin.P1, () => {
Expand All @@ -150,12 +150,12 @@ input.onPinPressed(TouchPin.P1, () => {
})
input.onPinPressed(TouchPin.P0, () => {
running = false
false_start = false
basic.showNumber(3)
basic.showNumber(2)
basic.showNumber(1)
basic.clearScreen()
running = false
false_start = false
basic.pause(1000 + randint(0, 2000))
if (!(false_start)) {
start = input.runningTime()
Expand Down Expand Up @@ -209,12 +209,12 @@ input.onPinPressed(TouchPin.P1, () => {
}
})
input.onPinPressed(TouchPin.P0, () => {
running = false
false_start = false
basic.showNumber(3)
basic.showNumber(2)
basic.showNumber(1)
basic.clearScreen()
running = false
false_start = false
basic.pause(1000 + randint(0, 2000))
if (!(false_start)) {
start = input.runningTime()
Expand Down Expand Up @@ -242,12 +242,12 @@ let end = 0
let false_start = false
let running = false
input.onPinPressed(TouchPin.P0, () => {
running = false
false_start = false
basic.showNumber(3)
basic.showNumber(2)
basic.showNumber(1)
basic.clearScreen()
running = false
false_start = false
basic.pause(1000 + randint(0, 2000))
if (!(false_start)) {
start = input.runningTime()
Expand Down

0 comments on commit fe8eaec

Please sign in to comment.