Some devices like the Raspberry Pi cannot read analog values directly so rely on analog to digital converters, like the MCP3008 ADC. The MCP3008 supports the SPI interface. The 10-bit chip can be accessed as an SPI device or manually via raw GPIO pins.
You can use Mcp3008.cs in your project to access analog devices. Reading Analog Input from a Potentiometer demonstrates a concrete example using this class.
The following fritzing diagram illustrates one way to wire up the Mcp3008, with a Raspberry Pi and a potentiometer.