Complete the code to start the motor by setting the pin HIGH.
digitalWrite(motorPin, [1]);Setting the motor pin to HIGH turns the motor on by providing voltage.
Complete the code to set the motor pin as an output.
pinMode(motorPin, [1]);To control a motor, the pin must be set as OUTPUT to send signals.
Fix the error in the code to stop the motor by setting the pin LOW.
digitalWrite(motorPin, [1]);Setting the motor pin to LOW stops the motor by cutting off voltage.
Fill both blanks to control motor speed using PWM.
analogWrite(motorPin, [1]); // speed value between 0 and [2]
Speed values start at 0 (off) and go up to 255 for full speed in Arduino PWM.
Fill all three blanks to create a dictionary of motor speeds for different directions.
motorSpeeds = [1]: 255, [2]: 0, [3]: 128}
This dictionary maps directions to speed values: full speed forward, stop, and half speed.
