Unit 8 - Dealing with the Analog World

Computers by their very nature are digital devices. Digital data are discrete. At some level all numbers a computer knows are broken down into a series of nes and zeros. Luckily we don't have to do that ourselves to program them. A quick example of digital vs. analog would be the number of students in a classroom at school. You can have 28 or 29, but you can't have 28.7 students. The number of students represents discrete data so can be easily turned into digital data. The total mass of students in the room is continuous. There might be 1909 kg of students in the room. If one ate a Big Mac then there would be 1909.27 kg of students in the room. We can have vary fine gradations in mass. The total mass is like analog data. We live in an analog world. If we convert the analog mass to digital number of students we could not represent the added student flesh due to the Big Mac.

  1. Simple Analog Read - This is your first foray into analog to digital conversion. This is really at the heart of how a lot of sensors work
    • Assignment 8.1 - Modify your program from 7.3 to respond to your slide potentiometer. Note, you'll probably find map() to be useful.
  2. Etch-a-Sketch - Lets make something that is actually kind of useful!
    • Assignment 8.2 - Create a slide pot version of Example 5-9 and draw a cool picture. As always post the code and picture to your blog. Bonus: Use keyPressed()to blank your canvas to start over.
  3. Photoresistors - Let's play with light dependent resistors to learn how analog read actually works.
    • Assignment 8.3 - Write a sketch to move your Robot around the screen based on the motion of your hand above your breadboard.
  4. Analog Write - Learn how to fade LEDs.