Appendix A. Arduino Code Reference
Gets the voltage value of a particular analog input pin. The values range from 0 to 1023, which represents the voltages 0 to 5. See Analog Input.
If the IOREF jumper is set to 3.3V, then the maximum input voltage for the analog input pins is 3.3 volts. However, this will not adjust the scale of
analogRead(), which will always be based on 0 to 5 volts.
- The pin number
integer (between 0 and 1023, representing 0 to 5 volts)
int sensorReading = analogRead(0);
Gets the value from analog pin 0 and stores it in a new integer variable called
Sets the resolution of the value returned by
analogRead(). Galileo’s analog-to-digital ...