A 100% C ++ library for parallelization with an Arduino.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
README.md
RunLoop.h
RunLoop.jpg
RunLoopClassHierarchy.jpg
RunLoopConfig.hpp
RunLoopHardwareTimer.cpp
RunLoopHardwareTimer.hpp
RunLoopHardwareTimer0.cpp
RunLoopHardwareTimer0.hpp
RunLoopHardwareTimer1.cpp
RunLoopHardwareTimer1.hpp
RunLoopHardwareTimer2.cpp
RunLoopHardwareTimer2.hpp
RunLoopHardwareTimer3.cpp
RunLoopHardwareTimer3.hpp
RunLoopHardwareTimer4.cpp
RunLoopHardwareTimer4.hpp
RunLoopHardwareTimer5.cpp
RunLoopHardwareTimer5.hpp
RunLoopInterrupt.cpp
RunLoopInterrupt.hpp
RunLoopInterruptPin0.cpp
RunLoopInterruptPin0.hpp
RunLoopInterruptPin1.cpp
RunLoopInterruptPin1.hpp
RunLoopInterruptPin10.cpp
RunLoopInterruptPin10.hpp
RunLoopInterruptPin11.cpp
RunLoopInterruptPin11.hpp
RunLoopInterruptPin12.cpp
RunLoopInterruptPin12.hpp
RunLoopInterruptPin13.cpp
RunLoopInterruptPin13.hpp
RunLoopInterruptPin2.cpp
RunLoopInterruptPin2.hpp
RunLoopInterruptPin3.cpp
RunLoopInterruptPin3.hpp
RunLoopInterruptPin4.cpp
RunLoopInterruptPin4.hpp
RunLoopInterruptPin5.cpp
RunLoopInterruptPin5.hpp
RunLoopInterruptPin6.cpp
RunLoopInterruptPin6.hpp
RunLoopInterruptPin7.cpp
RunLoopInterruptPin7.hpp
RunLoopInterruptPin8.cpp
RunLoopInterruptPin8.hpp
RunLoopInterruptPin9.cpp
RunLoopInterruptPin9.hpp
RunLoopInterruptPinA0.cpp
RunLoopInterruptPinA0.hpp
RunLoopInterruptPinA1.cpp
RunLoopInterruptPinA1.hpp
RunLoopInterruptPinA2.cpp
RunLoopInterruptPinA2.hpp
RunLoopInterruptPinA3.cpp
RunLoopInterruptPinA3.hpp
RunLoopInterruptPinA4.cpp
RunLoopInterruptPinA4.hpp
RunLoopInterruptPinA5.cpp
RunLoopInterruptPinA5.hpp
RunLoopObject.cpp
RunLoopObject.hpp
RunLoopTimer.cpp
RunLoopTimer.hpp
keywords.txt
library.properties

README.md

RunLoop

Alt text

Arduino parallelization library.

Synopsis

A 100% C ++ library for parallelization with an Arduino... Alt text

Features

  • RunLoop objects with hierarchy, idle state, etc.
  • Software timers.
  • Hardware timers: Timer0, Timer1, Timer2, Timer3, Timer4, Timer5 (3,4,5 only availables with Arduino Mega).
  • Software and hardware timers fully interchangeable.
  • Hardware interrupts (pins supported according to your arduino board).
  • Full C++ approach with inheritance or delegation paradigm for asynchronous callbacks with timers and interrupts.
  • C compatiility with enhanced C function callbacks.

Limitations

  • PWM not implemented yet with hardware timers.

Code Example

See sample code directory: https://github.com/MarScaper/runloop/tree/master/examples

Software timer with callback:

../..
RunLoopTimer *timer = new RunLoopTimer();
timer->attachInterrupt(fire);
timer->setDelay(1000);
this->addToRunLoop(timer);
../..

Timer0 (Hardware Timer) with delegate:

../..
RunLoopTimer *timer = new RunLoopHardwareTimer0();
timer->setTimerDelegate(this);
timer->setDelay(1000);
this->addToRunLoop(timer);
../..

Pin 2 Interrupt with delegate:

../..
RunLoopInterrupt *interruptPin2 = new RunLoopInterruptPin2(INPUT_PULLUP,RISING);
interruptPin2->setInterruptDelegate(this);
this->addToRunLoop(interruptPin2);
../..

Motivation

This library is part of a personnal project to improve my EM10 Takahashi mount thanks to Arduino.

Click on this video to see buzzer, led, IR remote and lcd working together with the library... Alt text for your video

License

Copyright (c) 2017 by Sebastien MARCHAND Web:www.marscaper.com - Email:sebastien@marscaper.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.