More hardware tests (#119)
This commit is contained in:
committed by
Peli de Halleux
parent
e1f7a5b8cf
commit
3acf4e9ac5
9
tests/ultrasonic.ts
Normal file
9
tests/ultrasonic.ts
Normal file
@ -0,0 +1,9 @@
|
||||
tests.test("Ultrasonic sensor", function () {
|
||||
brick.print("Place object ", 0, 50)
|
||||
brick.print("one finger's length", 0, 60)
|
||||
brick.print("in front of sensor", 0, 70)
|
||||
brick.print("and click enter", 0, 80)
|
||||
brick.buttonEnter.pauseUntil(ButtonEvent.Click)
|
||||
brick.clearScreen()
|
||||
tests.assertClose("Distance", sensors.ultrasonic1.distance(), 7, 6)
|
||||
})
|
Reference in New Issue
Block a user