DigitalWrite

From wikipost
Revision as of 19:36, 24 January 2013 by Admin (talk | contribs) (Created page with "<pre> void digitalWrite(int pin, int state) { if (state == HIGH) { (PORTB |= (1 << pin)); } else { (PORTB &= ~(1 << pin)); } } </pre>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
void digitalWrite(int pin, int state)
{
  if (state == HIGH)
  { 
    (PORTB |= (1 << pin)); 
  } else {
    (PORTB &= ~(1 << pin));
  }
}