Last active
September 29, 2016 17:21
-
-
Save nseidle/43a262c37540ffc855cf5b7f08356056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is just a snippet. The full files are here: https://github.com/sparkfun/Genericized_Library_Examples | |
#include "Laser.h" //The example lib | |
Laser myLaser; //Instantiate an instance of the class | |
void setup() | |
{ | |
Serial.begin(9600); //We have to start the serial port before we call begin() | |
myLaser.begin(Serial); //Pass the port object to the library | |
} | |
void loop() | |
{ | |
myLaser.sendCommand("Fire the laser!"); //Send a serial command to the device | |
Serial.println("Command sent"); //For Uno | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment