int LEDpin = 9; int brightness = 5; //0 to 100 int cycle = 0; void setup() { Serial.begin(9600); } void loop() { pinMode(LEDpin, OUTPUT); cycle = random(0,100); if (brightness > cycle) digitalWrite(LEDpin, HIGH); else digitalWrite(LEDpin, LOW); }
No comments:
Post a Comment