// Program: AnalogInput-E_v2.ino
// The code configures the GPIO pin 36 as the analog input
// for the Potentiometer R10.
#define potfin 36
// const int potPin = 36; // Declaring a label for the GPIO pin 36
// int potValue = 0; // Variable for storing the potentiometer value
// int mappedValue;
void setup() {
Serial.begin(115200);
}
void loop() {
int potValue = 0; // Variable for storing the potentiometer value
int mappedValue;
float mappedValue
potValue = analogRead(potPin); // Reading potentiometer value
Serial.print("Potentiometer value = ");
Serial.println(potValue);
/* This block makes scaling of potValue to 0 ~ 250 */
mappedValue = map(potValue, 0, 4095, 0, 250); // Make scaling to 0 ~ 250
Serial.print("Scaled value = ");
Serial.print(mappedValue);
Serial.println("%");
Serial.println();
delay(1000);
}