Hardware Reference
In-Depth Information
RespondingtoInputswithanLEDBarGraph
Using the same circuit but adding an IR distance sensor, you can make a bar
graph that responds to how close you get. To mix it up a bit more, try using
multiple LED colors. The circuit diagram in FigureĀ 7-7 shows the circuit modi-
fied with different colored LEDs and an IR distance sensor.
Figure 7-7: Distance-responsive bar graph
Using the knowledge you already have from working with analog sensors
and the shift register, you should be able to make thresholds and set the LEDs
accordingly based on the distance reading. FigureĀ 7-8 shows the decimal values
that correspond to each binary representation of LEDs.
Search WWH ::




Custom Search