int led_pin = 11;
int input_value;
int brightess:
void setup(){
pinMode(led_pin, OUTPUT);
Serial.begin(9600);
}
void loop(){
input_value = analogRead(A0);
brightness = map(input_value, 0, 1023, 0, 255):
analogWrite(led_pin, brightness);
Serial.println("input_value : " + String(input_value) + " , brightness : " + String(brightness));
}
Comments
Please log in or sign up to comment.