pfeerick / elapsedMillis

Arduino 'port' of the elapsedMillis library
MIT License
85 stars 26 forks source link

Library not functioning on Intel Edison #10

Closed doctim77 closed 3 months ago

doctim77 commented 8 years ago

Curiously, the library does not appear to be functioning on the Intel Edison.

This is a sample code. Does not print to the serial monitor. If I comment out the timer however, it prints just fine.

Any thoughts why this may be the case? I am perplexed.

# include <elapsedMillis.h>

elapsedMillis stimer0; // global timer
void setup() {

}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Waiting...");
  while (stimer0 < 1000)
  {
    //do nothing, just pause
  }

}
pfeerick commented 8 years ago

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!
  }
}
doctim77 commented 8 years ago

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.

pfeerick commented 3 months ago

Given the Intel Edison has been discontinued for quite some time now, and there is basically no functional/actually working support for it now for the Arduino platform, I'm gonna call this issue unresolvable. I managed to get my hands on an Edison and Arduino dev board, but a simple Blink sketch is uncompilable on Linux due to the BSP having been badly broken, and on Windows while it actually compiles on, I can't get the damn drivers working, in order to be able to flash the needed image to be able to use the Edison with Arduino... 🤦And most likely, it is an issue in the BSP anyway, so probably wouldn't have been fixable here anyway. 😢