Lesson Plan

Adding A Button To Control Opening Your Box

Your box can move—now you’ll give it an input. In this lesson, you’ll add a button and use it to control when the box opens.

Tutorial Video

What You’ll Learn

  • Connect a push button to the circuit
  • Understand the button as an input
  • Use the button state in your program to control the servo

Follow Along

  1. Connect the button by following the wiring in the video.
  2. Add the button blocks to your program.
  3. Test the program by pressing the button and checking that the box responds as expected.

Check Your Work

Before moving on, make sure your project behaves like the example shown in the video. If something isn’t working, compare your wiring and code carefully with the video before changing multiple things at once.

What’s Next?

Next, you’ll add and program a second LED.


Additional Resources

Videos

Documents

Other