Arduino/Arduinomorse Library: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 19: | Line 19: | ||
Open your Arduino development environment, and pick Sketch > Include Library. | Open your Arduino development environment, and pick Sketch > Include Library. | ||
[[Image: | [[Image:Arduinomorse1.png|500px]] | ||
Now we pick the zip file to add to Arduino's list of libraries: | Now we pick the zip file to add to Arduino's list of libraries: | ||
[[Image:Arudinomorse2.png|500px]] | [[Image:Arudinomorse2.png|500px]] | ||
[[Image:Arduinomorse2.png|500px]] | |||
Finally, it should show up in the external libraries menu, at the very bottom: | Finally, it should show up in the external libraries menu, at the very bottom: | ||
[[Image:Arudinomorse3.png|500px]] | [[Image:Arudinomorse3.png|500px]] | ||
[[Image:Arduinomorse3.png|500px]] | |||
When you select the ArduinoMorse library, it will add a <code>#include <morse.h></code> to your header: | When you select the ArduinoMorse library, it will add a <code>#include <morse.h></code> to your header: | ||
[[Image:Arduinomorse4.png|500px]] | [[Image:Arduinomorse4.png|500px]] | ||
=Usage= | =Usage= | ||
Revision as of 23:27, 19 July 2015
This page walks you through the installation of the Arduinomorse library from Github user Mark Fickett.
Setup
Download
The first step is to download the Arduinomorse library from GitHub: https://github.com/markfickett/arduinomorse
Create Zip File for Arduino
For more information on installing libraries for use in the Arduino Development Environment generally: Arduino Installing Libraries
Assuming you aren't modifying the Arduinomorse library, or assuming you've finished with your modifications, you will zip up the resulting Arduinomorse folder (that contains your copy of the git repository) into a zip file, arduinomorse.zip. What's important is that the zip file contain a folder, and that the folder contain the arduinomorse.h header, which we're including in our sketch.
Loading Library in Arduino Development Environment
The third step is to load this as a library in the Arduino development environment, which will add the relevant header files to somewhere where Arduino will find them when you #include them.
Open your Arduino development environment, and pick Sketch > Include Library.
Now we pick the zip file to add to Arduino's list of libraries:
Finally, it should show up in the external libraries menu, at the very bottom:
When you select the ArduinoMorse library, it will add a #include <morse.h> to your header:
Usage
Simple Arduino Sketch
The following is a very simple sketch, which sends a string with morse code with a fixed WPM speed. It is a non-blocking morse code message. Note that this github issue indicates you could use blocking sending for such a trivial example.
#include <morse.h>
#define PIN_STATUS 13
LEDMorseSender sender(PIN_STATUS);
void setup() {
sender.setup();
sender.setWPM(40);
sender.setMessage(String("this is the longest string in the known universe"));
sender.startSending();
}
void loop() {
sender.continueSending();
}