// E4.4 const int ledPin = 3; void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { byte brightness; if (Serial.available() > 0) { brightness = Serial.parseInt(); brightness = constrain(brightness, 0, 255); analogWrite(ledPin, brightness); } }