Advertisement
halfordC

LibraryLessonPart2

Aug 20th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. /*
  2.  * A Test librarydo make a light blink
  3.  * filename: Morse.cpp
  4. */
  5.  
  6. #include "Arduino.h"
  7. #include "Morse.h"
  8.  
  9. Morse::Morse(int pin)
  10. {
  11.   pinMode(pin, OUTPUT);
  12.   _pin = pin;
  13.  
  14. }
  15.  
  16. void Morse::dot()
  17. {
  18.   digitalWrite(_pin, HIGH);
  19.   delay(250);
  20.   digitalWrite(_pin, LOW);
  21.   delay(250);
  22. }
  23.  
  24. void Morse::dash()
  25. {
  26.   digitalWrite(_pin, HIGH);
  27.   delay(1000);
  28.   digitalWrite(_pin, LOW);
  29.   delay(250);
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement