Tab Content
Tab Title
Instructions
Tab Content
  1. Type “Servo standardServo;” after “#include <Servo.h>” and before “void setup(){”
     
  2. Press enter, then type “Servo continuousServo;” before “void setup(){”

 

STEM Connections

When programming one Servo, it was named myservo. Now that 2 Servos are being programmed to move at the same time, they should be named more appropriately, so we're using standardServo and continuousServo. You can always change the names later to be more appropriate for your project or easier to type.  You may also choose to use 2 standard Servos or 2 continuous Servos.  Whatever you decide to use, just be sure that they have different names and that you can easily tell the difference.  If you decide to change the name of the Servo, consistency is key.  So, if you refer to it as “car” in this line of code, you can’t later refer to it as “Car” .  Even a capitalization will throw off the code!

Tab Title
Implementation
Tab Content

Ensure that students are typing both lines of code before the “void setup(){”.

Encourage students to rename their Servos with a name that refers to the object it is controlling. For example, if the Servo is controlling a pink flower and making it spin, then naming it something like “pinkFlower” would make sense. Properly named Servos can be a big help when trying to troubleshoot.

Tab Title
Troubleshooting
Tab Content

“Servo” doesn’t change color to orange

  1. The word “Servo” should turn orange once completed, as shown in the video.
  2. Check that “Servo” is spelled correctly.
  3. Check that the ‘S’ in “Servo” is capitalized.
  4. Check that there is a space between “Servo” and the name of the Servo.
  5. If it changed colors to a different color, the Arduino software may have been updated.  As long as it is colored, the code should still work properly.
Instruction Category
Video