Plaquette
 
Loading...
Searching...
No Matches
Plaquette.h
1/*
2 * Plaquette.h
3 *
4 * (c) 2015 Sofian Audry :: info(@)sofianaudry(.)com
5 * (c) 2015 Thomas O Fredericks :: tof(@)t-o-f(.)info
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef PLAQUETTE_H_
22#define PLAQUETTE_H_
23
24#include "PlaquetteLib.h"
25
26using namespace pq;
27
28// Plaquette builtin runtime functions (to be defined in sketch).
29void begin();
30void step();
31
32// Plaquette redefines setup() and loop() based on begin() and step().
33void setup() {
34 Plaquette.preBegin();
35 begin();
36 Plaquette.postBegin();
37}
38
39void loop() {
40 if (Plaquette.timeStep()) {
41 Plaquette.preStep();
42 step();
43 }
44}
45
46#endif
void preStep()
Updates all components (calls step() on all of them).
Definition PqCore.h:671
bool timeStep()
Performs additional tasks after the class to step().
Definition PqCore.h:681
void postBegin()
Performs additional tasks after the class to begin().
Definition PqCore.cpp:82
void preBegin(unsigned long baudrate=PLAQUETTE_SERIAL_BAUD_RATE)
Initializes all components (calls begin() on all of them).
Definition PqCore.cpp:55