Skip to content

Instantly share code, notes, and snippets.

@monpetit
Created May 19, 2015 05:30
Show Gist options
  • Save monpetit/8895ba4fc93b586f537f to your computer and use it in GitHub Desktop.
Save monpetit/8895ba4fc93b586f537f to your computer and use it in GitHub Desktop.
const int pin = 8;
void setup()
{
pinMode(pin, OUTPUT);
volatile uint8_t* port = portOutputRegister(digitalPinToPort(pin));
uint8_t mask = digitalPinToBitMask(pin);
while (1) {
*port ^= mask;
}
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment