Skip to content

Commit f18acef

Browse files
author
Alan Shaw
committed
Specify speed to spin motor at
1 parent 0f1b282 commit f18acef

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

exercises/spin_motor_spin/exercise.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ exercise.addVerifyProcessor(function (callback) {
5858

5959
// Start was called before stop
6060
expect(start0.calledBefore(stop0), 'motor was not started before it was stopped!').to.be.true
61+
expect(start0.args[0], 'motor not started at 200').to.equal(200)
6162
expect(board.wait.callCount, 'board.wait was not called').to.be.gt(1)
6263

6364
var wait0 = board.wait.getCall(0)
@@ -69,6 +70,7 @@ exercise.addVerifyProcessor(function (callback) {
6970
expect(wait1.calledAfter(stop0), 'didn\'t use board.wait after motor stopped')
7071
expect(wait1.args[0], 'didn\'t use board.wait to wait 1 second before starting the motor again').to.equal(1000)
7172
expect(start1.calledAfter(wait1), 'motor didn\'t start again after 1 second')
73+
expect(start1.args[0], 'motor not started again at 200').to.equal(200)
7274

7375
callback(null, true)
7476
} catch(e) {

exercises/spin_motor_spin/problem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__Attach a motor to pin 9 and start it spinning!__
22

3+
* Spin the motor at **200** mph
34
* Use `board.wait` to stop the motor spinning after **2 seconds**
45
* Start it spinning again after another second
56
* Ensure this loop repeats infinitely

0 commit comments

Comments
 (0)