thomasfredericks / metro-arduino-wiring Goto Github PK
View Code? Open in Web Editor NEWMetro library for Arduino or Wiring
License: MIT License
Metro library for Arduino or Wiring
License: MIT License
When compiling in Arduino IDE 1.6.11, I receive the following error:
Metro.cpp:41:16: warning: extra tokens at end of #ifdef directive
#ifdef NOCATCH-UP
This issue appears to be resolved by changing #ifdef NOCATCH-UP
to#ifdef NOCATCH_UP
.
Could someone explain me what does it mean this define NOCATCH-UP and what happen in not defined? Below is part of code which I can't understnd.
#ifdef NOCATCH-UP
previous_millis = now ;
#else
previous_millis += interval_millis ;
#endif
The library and example code is very brief and clear. But I think the Metro::reset() should be called once at the begaining of every example. Maybe in setup().
IMHO, the consequence of not calling Metro::reset() is not severe as the code repeats the HIGH/LOW sequence anyway. But not initilizing previous_millis by calling Metro::reset() causes the first round of the loop being excuted immediately rather than waiting for 250ms.
Or the constructor function could initialize previous_millis by calling Metro::reset().
please try the following code:
# include // Include Metro library # define METROWITHDOT 1.0 // in minutes # define METROWITHOUTDOT 1 // in minutesMetro metroHeartbeat = Metro(1000);
Metro metroWithDotDefine = Metro(METROWITHDOT * 60 * 1000); // works
Metro metroWithOutDotDefine = Metro(METROWITHOUTDOT * 60 * 1000); // does not work
Metro metroWithDot = Metro(1.0 * 60 * 1000); // works
Metro metroWithOutDot = Metro(1 * 60 * 1000); // does not work
Metro metro1MinuteWithDot = Metro (60000.0); // works
Metro metro1MinuteWithOutDot = Metro (60000); // works
int counter = 1;
void setup()
{
Serial.begin(9600);
}
void loop()
{
if (metroHeartbeat.check() == 1)
{
Serial.print("Heartbeat: ");
Serial.println(counter, DEC);
counter++;
}
if (metroWithDotDefine.check() == 1)
{
Serial.println("MetroWithDotDefine_____triggered");
}
if (metroWithOutDotDefine.check() == 1)
{
Serial.println("METROWITHOUTDOTDEFINE_TRIGGERED");
}
if (metroWithDot.check() == 1)
{
Serial.println("MetroWithDot___________triggered");
}
if (metroWithOutDot.check() == 1)
{
Serial.println("METROWITHOUTDOT________TRIGGERED");
}
if (metro1MinuteWithDot.check() == 1)
{
Serial.println("Metro1MinuteWithDot____triggered");
}
if (metro1MinuteWithOutDot.check() == 1)
{
Serial.println("Metro1MinuteWithOutDot_triggered");
}
}
i never see any serial printout in capital letters ;(
can you confirm?
Henning
Tried to load the .zip library into Wiring and get the following error:
Specified folder/zip file does not contain a valid library
I'm using the latest version of Metro-Arduino-Wiring-master
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.