britneybeatey

Learning Analog Writing

Jun 7th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /* Britney Beatey
  2. * 6/7/2017
  3. * Version 3
  4. * Learning analog writing
  5. */
  6.  
  7. const int pinButton = 2;
  8. const int pinLed = 6;
  9. boolean buttonDown = 0;
  10. boolean ledOn = 0;
  11.  
  12. void setup()
  13. {
  14. // put your setup code here, to run once:
  15. pinMode (pinButton, INPUT);
  16. pinMode (pinLed, OUTPUT);
  17. Serial.begin (9600);
  18. digitalWrite (pinLed, HIGH);
  19. delay (100);
  20. digitalWrite (pinLed, LOW);
  21.  
  22. for(int i = 0; i<= 200; i++)
  23. {
  24. analogWrite (pinLed, i);
  25. delay (80);
  26. }
  27. digitalWrite (pinLed, LOW);
  28. }
  29.  
  30. void loop() {
  31. // put your main code here, to run repeatedly:
  32. }
Add Comment
Please, Sign In to add comment