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

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'