Comments (2)
There are a couple of things wrong with that sample. I'm assuming the first, the incomplete #include line is irrelevant, as that would never complie ;)
More importantly, do you still need to do a Serial.begin(9600);
(or other baud rate) on the Intel Edison? I don't have one of those, but I would expect it is still needed. Give this code a try (you should be able to copy and paste the whole thing into a new sketch), and let me know what happens. I'm expecting output like
Waiting..............
Wait over
#include <elapsedMillis.h>
elapsedMillis stimer0; // global timer
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println();
Serial.print("Waiting...");
while (stimer0 < 1000)
{
Serial.print(".");
delay(100);
}
//if wait time elapsed
if (stimer0 > 1000)
{
Serial.println();
Serial.print("Wait over");
while (1); //this makes the code hang/stop... don't do this in normal practice!
}
}
from elapsedmillis.
Thanks for the quick reply and sorry about the coding errors. It was late and I was being sloppy. Nonetheless, it will still not work. I tested yours, pulled the header file into the sketch directly, but still nothing seems to work. I am able to print millis(), so I am confident that is not the problem.
On two Edison's, having the same problem.
#include "elapsedMillisEdison.h"
elapsedMillis timer1;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
Serial.println(timer1);
delay(1000);
}
Thanks for your help. I am heavily relying on multiple timers for my code and this library has been a blessing. Just need to figure out why it is not working on the Edison. Thanks.
from elapsedmillis.
Related Issues (14)
- Move all files to the root Don't have an extra folder
- Long delays are not working HOT 3
- elapsedSeconds has unnecessary float math HOT 2
- Link error in readme.md HOT 1
- value of elapsedMillis object not an unsigned long? HOT 2
- Add installation info and elapsedSeconds to doc HOT 1
- Convert readme file to markdown format
- Rename variable em to something more descriptive like elapsed HOT 1
- Create top level folder elapsedMillis or zip file with top level folder HOT 2
- elapsedMillis is not recognized as variable HOT 4
- Could you ask for inclusion of this library in Arduino's Board Manager? HOT 3
- Please update library.properties HOT 3
- Include this library in PlatformIO HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elapsedmillis.