O'Reilly logo

Learning BeagleBone Python Programming by Alexander Hiam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Potentiometers

Another option for user input is to use the ADC to read the position of a potentiometer. Let's revisit some of the things you learned in Chapter 4, PWM and ADC Subsystems, to make our program a bit more interesting.

For this circuit, you will need:

  • Breadboard
  • 2x potentiometers
  • 1x 5 mm LED
  • 1x CdS photocell (also known as photoresistor / light-dependant resistor / LDR)
  • 2x 10 kΩ resistor
  • 1x 4.7 kΩ resistor
  • 1x 68 Ω resistor
  • 1x 2N3904 NPN transistor
  • 1x LM358 (or similar rail-to-rail op-amp)
  • Jumper wires

Put it all together on your breadboard, as shown in the figure:

Potentiometers

This circuit might look a lot more complicated than what we've done so far, but really ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required