About us
Services
Professional development training Workshops and events Media art production and community art projects Mehackit Maker Kit
Blog Suomeksi courses

Summary

Transcript

You're almost ready to move on to making your own projects and learning more while you're at it. That should be fun! Before that let's recap what you've learned in this chapter. You connected a servo motor and you learned it needs a control signal from the Arduino to move. You used a library for the first time. You imported the servo library which is a collection of code that makes programming servo motors easier. You set up two different movement modes: back and forth movement and a mode where you controlled the motor with a potentiometer. To switch between these modes with a button you stored information of the current state of both your motor and the button into variables. You changed the mode after checking what those states were. You used the same variables to control signal lights, too, so your servo system was easier to use. And at last you either experimented with mechanisms and made your servo more practical or interesting or you made the servo motor seek light by using two LDRs. Either way the skills you've practiced in the final exercise will be useful in your future projects.

New Arduino commands, structures and concepts in this chapter

Using the Servo library

  • include
  • attach 
  • write
  • !=  (not equal to)
  • !  (logical not)
  • /*   */   (block comments)
Previous Next

Electronics and Programming Basics

  • Front page
  • Cranck Up the Voltage and Get Coding
    • An Electric Welcome
    • Code That Light
    • Exercise 1: LEDs Are Awesome!
    • Exercise 2: Traffic Lights
    • Summary
  • Switch Stuff On and Off
    • It's a Switch
    • Doorbell
    • Exercise 1: Your Own Switch
    • Exercise 2: Reaction Game
    • Summary of Chapter 2
  • Sense the Whole World
    • Automatic Dimmer
    • Noises From the Dark
    • Exercise 1: Imporve the Musical Instrument
    • Exercise 2: Burglar Alarm
    • Summary
  • Let's Move!
    • Movement in Modes
    • Exercise 1: Mad Mehcanisms
    • Exercise 2: Light Follower
    • Summary

Mehackit

contact@mehackit.org


Visit

Mehackit Oy

Töölöntorinkatu 3 K1

00260 Helsinki, Finland