It might seem a bit strange at first, but it will make more sense once you see the source file that goes with it. We'll call our library "Morse", so our header file will be Morse. The header file has definitions for the library: basically a listing of everything that's inside while the source file has the actual code. You need at least two files for a library: a header file (w/ the extension. Let's start turning the sketch into a library! Finally, there's the call to pinMode ( ) that initializes the pin as an output. Second, there's the pin variable which the functions use to determine which pin to use. First, of course, we have the dot ( ) and dash ( ) functions that do the actual blinking. The sketch has a few different parts that we'll need to bring into our library. If you run this sketch, it will flash out the code for SOS (a distress call) on pin 13.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |