//Cortez, Shara Joy M.
//NW301
int potPin = A0;
int potValue = 0;
int led = 9;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
potValue = analogRead(potPin);
analogWrite(led, potValue / 4);
if (potValue < 256) {
Serial.println("LED Brightness: Low");
} else if (potValue < 768) {
Serial.println("LED Brightness: Medium");
} else {
Serial.println("LED Brightness: High");
}
delay(10);
}