Microcontrollers have limited memory, processing power and output pins. For example, the Atmega328 runs on 16MHz with 32K of flash memory (where your compiled program resides) with 1K of EEPROM (data that isn’t lost when powered down). So, as you progress with your Arduino skills, you’ll start seeing code that looks like this:
DDRD = DDRD | B11111100; //Mark pins 2 to 7 as outputs without changing value of pins 0 and 1 which are outputs
The code given above is perfectly valid in the Arduino and the full explanation is available on the Port Manipulation reference page.
But don’t panic! This is just simple bit math. Thankfully, there’s an entire reference page that has been written just to address such concerns. If you’re new to manipulating bits, I would highly recommend going through the Bit Math tutorial by CosineKitty. Of course, it will take some time to get used to. But once you’ve worked with it, manipulating bits is no sweat. You don’t have to do the whole page at a go, but just do keep it close at hand once you start pushing the limits of the Blinky program. I’ve found it very useful and I’m sure you will to.
