Chapter 5. Output: making things happen

 

This chapter covers

  • Mastering more advanced LED-controlling techniques—animating LEDs and using full-color RGB LEDs
  • Using pulse-width modulation (PWM) support to make digital output signals behave more like analog output signals
  • The basics of bitshifting and binary operations in JavaScript
  • Integrating a third-party weather API to create a multi-colored LED “weather ball” gadget
  • Wiring up and controlling a parallel LCD module with Johnny-Five and the Uno
  • Combining multiple input and output components to build an advanced timer device
  • Making noises and playing tunes with piezo components and Johnny-Five

Now it’s time to do something noisy. Or something bright. Or something blinky or expressive. You’ve tried out a few basic LED tricks, but now we’re going to take a more comprehensive look at some of the ways you can integrate outputs into projects.

For this chapter, you’ll need the following:

  • Arduino Uno and USB cable
  • 2 standard LEDs, any color
  • 1 photoresistor
  • 1 common-cathode RGB LED
  • 3 push buttons
  • 1 16x2 parallel LCD module
  • 1 rotary potentiometer
  • 1 piezo
  • 3 10 kV resistors
  • 2 220 V resistors
  • 23 jumper wires in various colors
  • 1 half-size breadboard

5.1. Lighting things up

LEDs seem to do a lot more tricks than just turn on or off. If you look around at the electronics embedded in your own electronic gadgets, you’ll see them pulsing or fading out. You may even see them change color.

5.2. Working with parallel LCD displays

5.3. Making noise with a piezo

Summary