Lab: Digital Input and Output with an Arduino
Code:
Lab: Analog In with an Arduino
Code:
Notes:
The ADC in the Arduino can read the input voltage at a resolution of 10 bits. That’s a range of 1024 points. The microcontroller makes analog and digital conversions, converting 3.3V to a value of 0 to 1023. So on the serial monitor, we should get a value of 0 to 1023 from the potentiometer.
The analog value is divided by 4 to get it into a range from 0 to 255. Because, Bytes take up 8 bits, and can therefore store 28 or 256 different values, from 0 to 255. The highest value in this case brightness should be 255.
Lab: Sensor Change Detection
- Button (Count Button Presses, Long & Tap &Short Presses)
Code: