This method also uses the fact that an AVR pin – as on most Atmel-based Arduinos – will toggle when you write a 1 to its bit in its input register. But avr-gcc as configured for the Arduino IDE is not so allowed, which is a reasonable default for embedded programming. In some cases the computation could occur at compile time if compiler is smart enough or is allowed to optimize. These functions – digitalPinToPort(), portInputRegister(), and digitalPinToBitMask()– can be used at run time to compute physical ports and pins from Arduino pin numbers. This more-portable method uses some standard (although not well-documented at ) functions to get port numbers, port pointers, and bit masks from a pin number. This answer uses a slightly more portable method of producing a brief pulse on a given digital pin. The other answer has provided correct information and useful documentation on the question as asked.