LAB 2: Analog and Digital IO
This lab was used to explain embedded IO and it's applications
Simulation startup
Turning the potentiometer increases the voltage read by the Arduino's Analog to Digital Converter (ADC). This voltage is converted to an 10 bit value corresponding to a number between 0 and 1023 -> 2^10=1023. The incoming voltage is then converted to a 5V range and output from the decive via serial if that value has changed
The button state is also read using a digital input and debounced to ensure each click is only registered once. A counter associated with the change in button state increments indefinitely and is also output via the serial connection