Giter VIP home page Giter VIP logo

Comments (2)

pfeerick avatar pfeerick commented on June 20, 2024

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.

doctim77 avatar doctim77 commented on June 20, 2024

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)

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.