Arduino

by

How to Write Binary and Hexadecimal Numbers in Arduino

For an introduction to binary and hexadecimal notation, read this post. In the Arduino IDE, representing numbers in binary or hexadecimal notation often comes in handy. For example, since the ATmega328’s registers are eight bits, I often set the bits of a register by assigning the register an eight-bit binary number. To assign a variable

by

Save Power by Disabling Arduino Peripherals

A relatively easy way to same a few milliamp hours of battery energy is to disable features of the ATmega328 your Arduino project isn’t using. Below are some examples of code you can use in your setup function to do this. void setup(void) { // The following saves some extra power by disabling some //

by

An Efficient Low-Power Arduino Switching Voltage Regulator

The voltage regulator built onto the Arduino Uno is a linear-type regulator and is horribly inefficient. If you are running the ATmega238 at 5V using a 9 V battery, approximately half of the battery’s energy will be dissipated as heat by the regulator. This post demonstrates a DC/DC switching-type voltage regulator circuit that can be

by

Arduino Bit Masks and Bitwise Operations

A bit mask (or bitmask) is a sequence of bits that can be used with bitwise operations to change or flip bits in a byte or nibble. That may be a convoluted definition so let me give an example using Arduino-style code to try to clarify. byte myByte B01001011; myByte = myByte & B00010001; This

by

Using 74HC595 Shift Registers with Arduino

Using a shift register like the 74HC595 you can convert a serial signal to a parallel output. This is incredibly helpful if you need more digital outputs then the 14 that the ATmega328 on the Arduino Uno provides. The Arduino IDE includes a shiftOut() function that can be used to control an 8-bit shift register