
const int PotePin = A0; //Define potentiometer port
const int LedPin = 15; //Define led port  GPIO15 >>> D10 
int sensorVal = 0;  //Defining variables
int newVal = 0;  //Defining variables
void setup() {
  Serial.begin(115200);  //Set bit rate
  pinMode(PotePin, INPUT); // Define potentiometer input mode
  pinMode(LedPin, OUTPUT); // Define LED output mode
}

void loop() {
  sensorVal = analogRead(PotePin);
  newVal = map(sensorVal,0,1024,0,255);
  Serial.println(newVal);
  analogWrite(LedPin,newVal);
}
