Giter VIP home page Giter VIP logo

arduino-led-blinker's Introduction

Arduino LED Blinker

Simple library for Arduino that offers control over LEDs without the use of delay functions.

Turn LEDs on/off, toggle them, make them blink or even run custom patterns! All without the use of delay functions, so your firmware can run continuously smooth!

Features

  • Easy control of LEDs
  • Simple blinking
  • Custom pattern support
  • No delay functions

Installation

  • Download the ZIP archive of the project (from GitHub's Clone or download menu).
  • Open the Arduino IDE
  • Go to Sketch -> Include Library -> Add .ZIP Library...
  • Select the ZIP you just downloaded

Quick start

Include the library in your project

#include <LEDBlinker.h>

To create an LED Blinker you must specify the LED's pin

LEDBlinker led(1);

The constructor also accepts a second argument describing the interval for the blink() and run_pattern() methods, in miliseconds

LEDBlinker led(1, 250);

Setting the blinking interval:

led.set_interval(500);

Setting a pattern (necesarry for run_pattern()):

int pattern[] = {1,1,1,0,1,0,1,0};
int size = sizeof(p)/sizeof(p[0]); //8

led.set_pattern(pattern, size);

Turning the LED ON/OFF:

led.on();
led.off();

Making te LED blink (should be in a looping method):

led.blink();

Running the LED pattern (should be in a looping method):

// the pattern defaults to a simple blinking pattern unless otherwise set
led.run_pattern();

arduino-led-blinker's People

Contributors

fulf avatar

Watchers

 avatar

Forkers

agmanufacture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.