Rywo

exercise 2

Jun 18th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. int greenLedPin = 10;
  2. int yellowLedPin = 9;
  3. void setup() {
  4. pinMode(greenLedPin, OUTPUT);
  5. pinMode(yellowLedPin, OUTPUT);
  6. }
  7. void loop() {
  8. for (int brightness=0; brightness <256; brightness++) {
  9. analogWrite(greenLedPin, brightness );
  10. analogWrite(yellowLedPin, 256 - brightness );
  11. delay(10);
  12. }
  13. for (int brightness=256; brightness >0; brightness--) {
  14. analogWrite(greenLedPin, brightness );
  15. analogWrite(yellowLedPin, 256 - brightness );
  16. delay(10);
  17. }
  18.  
  19.  
  20.  
  21. }
Add Comment
Please, Sign In to add comment