Giter Club home page Giter Club logo

mstask's Introduction

msTask

This library is based on Paul Stoffregen's TimerOne library that provide ability to add more than one callback, which I called "task"

To use this library, you'll need to install Paul Stoffregen's TimerOne as well:

https://github.com/PaulStoffregen/TimerOne

Usage

Create task:

msTask fooTask(1000, Foo);
msTask barTask(5000, Bar);
  • The first parameter is task's period

  • The second is the callback function:

void Foo(){
	//your Foo task's code here
}

void Bar(){
	//your Bar task's code here
}

Init task

This function must be call in setup() once

msTask::init();

Stop a task

fooTask.stop();

Start a task

fooTask.start();

Change a task's period

fooTask.setPeriod(500);

Change a task's callback

fooTask.setCallback(Bar);

You can read example Blink+AnalogRead, FlashLED or TrafficLight to know how to use.

mstask's People

Contributors

maisonsmd avatar per1234 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

mstask's Issues

Error including "arduino.h"

Hi!

First, congratulations for your work!
Your lib is very simple and intuitive to use.

I'm trying to use your lib in my project using PlatformIO.
I've included your lib in platformio.ini using the directive lib_deps = msTask.

The library is downloaded and installed in the project correctly. But when I include the header for usage include <msTask.h> the compiler complains that the file arduino.h can't be found.

.piolibdeps/msTask_ID5677/src/msTask.h:12:21: fatal error: arduino.h: No such file or directory

I tried searching PlatformIO for help but had no success.
Any ideas?

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.