[analogWrite](https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/): `int analogPin = 3; // potentiometer connected to analog pin 3` Should be 'A3', not '3'.