Skip to content

Instantly share code, notes, and snippets.

@ArduinoBasics
Last active December 29, 2019 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArduinoBasics/d11c668351d41a10b26778259eaff904 to your computer and use it in GitHub Desktop.
Save ArduinoBasics/d11c668351d41a10b26778259eaff904 to your computer and use it in GitHub Desktop.
/*-----------------------------------------------------------------
* CPP FILE for BlinkMe
* Library Descriptionn: Simplifying LED blinking
* Library Name: BlinkMe
*
* Author: Scott C / ArduinoBasics
* Version: 2.0
* Date Created: 28 Dec 2019
-------------------------------------------------------------------*/
#include <Arduino.h>
#include <BlinkMe.h>
BlinkMe::BlinkMe(){
_dPin = 13; //default pin is D13 (onboard LED)
}
void BlinkMe::setOUTPUT(int dPin){
_dPin = dPin;
pinMode(_dPin, OUTPUT); //Set the digital pin to an OUTPUT
}
void BlinkMe::blink(unsigned long delay_1){
_delay_1 = delay_1;
digitalWrite(_dPin, HIGH); //Turn the LED on
delay(_delay_1); //Delay
digitalWrite(_dPin, LOW); //Turn the LED off
delay(_delay_1); //Delay
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment