#define analogIn 14
#define led 2
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(led, OUTPUT);
pinMode(analogIn, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int val = analogRead(analogIn);
Serial.print("Val = ");
Serial.println(val);
val = map(val,0,4095,0,255);
analogWrite(led,val);
}