wait function not working


quick question. trying code here, whenever press button, pin 5 high. shouldn't delay? know going wrong here?

code: [select]
void wait(long timenum) {
  delaymicroseconds(timenum*995);
}

while (digitalread(button) == low) {}//wait until button pushed before starting light show

  wait(5358);
  digitalwrite(5, high);

quote
us: number of microseconds pause (unsigned int)
...is reference page says.

so, 22 milliseconds.
not quite "immediately", close in human terms.


Arduino Forum > Using Arduino > Programming Questions > wait function not working


arduino

Comments

Popular posts from this blog

Valutazione Template - Joomla! Forum - community, help and support

SD Datastring Convention

First use of Arduino Uno : avrdude error on Blink uploading