Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int greenLedPin = 10;
- int yellowLedPin = 9;
- void setup() {
- pinMode(greenLedPin, OUTPUT);
- pinMode(yellowLedPin, OUTPUT);
- }
- void loop() {
- for (int brightness=0; brightness <256; brightness++) {
- analogWrite(greenLedPin, brightness );
- analogWrite(yellowLedPin, 256 - brightness );
- delay(10);
- }
- for (int brightness=256; brightness >0; brightness--) {
- analogWrite(greenLedPin, brightness );
- analogWrite(yellowLedPin, 256 - brightness );
- delay(10);
- }
- }
Add Comment
Please, Sign In to add comment