DigitalWrite

From wikipost
Revision as of 09: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 navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
void digitalWrite(int pin, int state)
{
  if (state == HIGH)
  { 
    (PORTB |= (1 << pin)); 
  } else {
    (PORTB &= ~(1 << pin));
  }
}