Reading analog sensors with the Raspberry Pi

Adafruit just posted an awesome tutorial on reading analog sensors with the Raspberry Pi. It’s a great walkthrough that can be applied to your next Raspi project as well as any project where you just need one more analog input.

Earlier, the folks over at Adafruit posted a tutorial on using a MCP3008 ADC with the Raspi to directly read analog values using a Raspi. Sometimes, though, you don’t need eight analog inputs and a 12-bit ADC to get a project off the ground. Adafruit’s tutorial for reading analog values without an ADC relies on a single 1μF ceramic capacitor attached between a digital input and ground. By pulling the sensor line high for a millisecond or two, the capacitor charges at different rates depending on the value of the analog sensor.

Yes, it’s just an RC timing circuit but seeing as how the Raspi doesn’t have an analog input, we figure this tutorial could help out a few people.

analog joystick ports on desktop PC’s before USB f***** everything up was just a simple RC circuit and thats why often (VERY VERY OLD) fast computers needed to have the CPU slowed down in order to work with VERY old software that used the joystick…

(and expected the CPU to slow down its attempts to read the joy,[EDIT: the entire software?] later on, CPUs were so fast there was no more assumed delay)

and hence the turbo button.

which should have been called “slowdown” and had the logic inverted for the LED ect…

The other reason for slowing down the CPU when playing games (e.g. slowing a 286 down to 4.77 MHz) was because the games often had assumptions about how fast they were, so if the CPU was too fast the Space Invaders would come down and kick your ass before you could shoot back at most of them.