// Define the pin where the potentiometer is connected
const int potentiometerPin = A0;
void setup() {
// Initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// Read the input on analog pin 0 (value will be between 0 and 1023)
int sensorValue = analogRead(potentiometerPin);
// Print the original sensor value
Serial.print("Original Sensor Value: ");
Serial.println(sensorValue);
// Use a pointer to modify the sensor value
int *sensorValuePtr = &sensorValue;
*sensorValuePtr = *sensorValuePtr / 4; // For example, scale down the value
// Print the modified sensor value
Serial.print("Modified Sensor Value: ");
Serial.println(sensorValue);
// Wait for a second
delay(1000);
}