Using ADC MCP3008 with Windows 10 IoT
In this tutorial, we will see how to read analog value with RPi3 using an Analog/Digital Converter MCP3008.
Why should we use an Analog/Digital Converter ?
The Raspberry Pi computer does not have a way to read analog inputs. It's a digital-only computer. The MCP3008 is a low cost 8-channel 10-bit analog to digital converter with SPI Interface The precision of this ADC is similar to that of an Arduino Uno, and with 8 channels you can read quite a few analog signals from the Pi. This chip is a great option if you just need to read simple analog signals, like from a temperature or light sensor.
Implementation
I created a traditional UWP App with UI.
Mcp3008Helper
Some functions allowing us to interact with the ADC
AdcDeviceModel
A class wrapping interactions with ADC
MainPageViewModel
The viewmodel which allows us to show the value returned by ADC