millis() blink != 50/50


there has been spate of millis() questions.
seems might hardest part of arduino grasp.
i'm trying expand on example equal on , off times , have blink different on_time , off_time.
code: [select]

long waituntil = 0;
boolean led13state = true;

void setup()
{
  pinmode(13, output);
}

void loop()
{
 if (led13state = true)
 {
   digitalwrite(13, led13state);
   if (millis() >= waituntil)
     {
       led13state = !(led13state); // led13state = false
       waituntil = millis() + 50;
     }
 }
 if (led13state = false)
 {
   digitalwrite(13, led13state);
   if (millis() >= waituntil)
     {
       led13state = !(led13state); // led13state = true
       waituntil = millis() + 950;
     }
 }
}


it gets once, on 50ms, off 950ms, , on stays.

code: [select]
  if (led13state = false)
the second hardest concept might = vs ==.


Arduino Forum > Using Arduino > Programming Questions > millis() blink != 50/50


arduino

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO