const int potPin = A0; // Connect the potentiometer to analog pin A0
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(A1, OUTPUT);
}
void loop() {
// Read the analog value from the potentiometer
int potValue = analogRead(potPin);
int potValue_Mapped = map(potValue,0,1023,0,180);
analogWrite(A1, potValue);
// Print the potentiometer value to the Serial Monitor
Serial.print("Potentiometer Value: ");
Serial.println(potValue_Mapped);
delay(100); // Optional delay for readability
}