Basics · 12 min read

Binary Number System: Hex, Bits and Bitwise Operations on Arduino

Binary number system, hex and decimal conversions, bits and bytes, 0b and 0x on Arduino, &, |, ^, ~, <<, >> with bitRead, plus 74HC595 and register examples.

The binary number system uses only the digits 0 and 1 and is the foundation of all digital electronics. Every pin, every register and every byte in an Arduino's memory is really a binary number made of switches that are on or off: 1 means a pin is HIGH and 0 means it is LOW. Expressions you meet in code such as 0b10110101, 0xB5 or PORTB |= (1 << 5) may look scary, but once you understand binary and hexadecimal they all come down to a few simple rules.

In this guide you'll first see how to convert decimal, binary and hexadecimal numbers into each other by hand, what bits, nibbles and bytes are, and how negative numbers are stored in memory. Then you'll learn to write numbers on Arduino with 0b and 0x, read and change a single bit with AND, OR, XOR, NOT and shift operations, and use the bitRead, bitWrite and bitSet functions. Finally you'll prepare bytes for a 7-segment display and a 74HC595, and write directly to registers on the Uno, ESP32 and Pico.

What is a number system? Decimal, binary and hexadecimal

The decimal system we use every day has 10 digits, and each position is worth 10 times the one before: 181 is 1×100 + 8×10 + 1×1. The binary system has only two digits and each position is worth twice the one before; from right to left the place values are 1, 2, 4, 8, 16, 32, 64, 128. The hexadecimal system (hex for short) has 16 digits: after 0–9 come A=10, B=11, C=12, D=13, E=14, F=15. Hex is so popular in electronics because each hex digit corresponds to exactly 4 bits; it's the most practical way to write long binary numbers in a short, readable form.

DecimalBinaryHexDecimalBinaryHex
000000810008
100011910019
200102101010A
300113111011B
401004121100C
501015131101D
601106141110E
701117151111F

Conversions: between decimal, binary and hex

To convert decimal to binary, keep dividing the number by 2 and note the remainders; reading the remainders from bottom to top gives the binary number. For 181: 181/2 = 90 remainder 1, 90/2 = 45 remainder 0, 45/2 = 22 remainder 1, 22/2 = 11 remainder 0, 11/2 = 5 remainder 1, 5/2 = 2 remainder 1, 2/2 = 1 remainder 0, 1/2 = 0 remainder 1. Reading from bottom to top gives 10110101. Converting binary to decimal is easier: add up the place values of the positions that hold a 1. 10110101 = 128 + 32 + 16 + 4 + 1 = 181.

Place value1286432168421
10110101 (181)10110101
00001100 (12)00001100
11111111 (255)11111111

To convert binary to hex, split the bits into groups of four starting from the right and replace each group with its hex digit from the table: 1011 0101 → B 5 → 0xB5. The reverse is just as easy: 0x3C → 0011 1100. To convert hex to decimal, multiply each digit by a power of 16: 0xB5 = 11×16 + 5 = 181, 0x3FF = 3×256 + 15×16 + 15 = 1023. The last example should look familiar: the upper limit of the Uno's 10-bit analogRead value is 1023, which is ten 1s. You'll find the link between analog readings and bit counts in the ADC article.

Your computer's calculator in programmer mode and the Arduino Serial Monitor are the quickest ways to check conversions. Serial.println(181, BIN) prints 10110101 and Serial.println(181, HEX) prints B5. Doing the conversion by hand a few times, though, makes reading register tables and datasheets much easier.

Bits, nibbles, bytes and value ranges

A single binary digit is called a bit. 4 bits make a nibble, which is one hex digit; 8 bits make a byte, written with two hex digits. The rightmost bit in a byte is the least significant bit (LSB, bit 0) and the leftmost is the most significant bit (MSB, bit 7). Bit numbers always start at 0, so the bits of an 8-bit number are numbered 0–7. With n bits you can write 2ⁿ different values: 8 bits give 256, 10 bits 1024 and 16 bits 65536 different values.

SizeArduino typeUnsigned rangeSigned range
8 bits (1 byte)byte, uint8_t / int8_t0–255-128 to 127
16 bits (2 bytes)int on the Uno, word, uint16_t0–65535-32768 to 32767
32 bits (4 bytes)long, uint32_t; int on the ESP32 and Pico0–4,294,967,295-2,147,483,648 to 2,147,483,647

Negative numbers: two's complement

Microcontrollers store negative numbers using two's complement: in a signed number, if the leftmost bit is 1 the number is negative. To get the negative of a number you invert all its bits and add 1. 5 = 00000101; inverted 11111010; add 1 and you get 11111011 = 0xFB, which is -5. The same bit pattern is a different number depending on how you read it: 0xFF is 255 as a byte and -1 as an int8_t. That's why assigning raw bytes from a sensor to the right type matters so much. When a variable passes its upper limit it also wraps around: in a byte 255 + 1 = 0, and with int on the Uno 32767 + 1 = -32768; this is called overflow.

Writing numbers with 0b, 0x and B on Arduino

In Arduino code you can write the same number in three ways and it makes no difference to the compiler: 181 (decimal), 0b10110101 (binary, standard since C++14) and 0xB5 (hexadecimal). Arduino also recognises the B10110101 form left over from older code, but these are constants defined only for 8-bit values, and 0b is better in new code. Which form to choose depends on readability: binary is clearest for LED patterns and register settings, hex for addresses and colour codes, and decimal for measurements.

C++ (Arduino IDE)
1// Aynı sayının üç yazımı ve Seri Monitör'de gösterimi
2// Three ways to write the same number and print it
3void binaryYaz(byte deger) {               // baştaki sıfırlarla 8 bit yaz / print 8 bits with leading zeros
4  for (int i = 7; i >= 0; i--) {
5    Serial.print(bitRead(deger, i));
6  }
7  Serial.println();
8}
9
10void setup() {
11  Serial.begin(9600);
12  byte a = 0b10110101;                       // ikilik / binary
13  byte b = 0xB5;                             // onaltılık / hex
14  byte c = 181;                              // onluk / decimal
15  Serial.println(a == b && b == c ? "Ucu de ayni / All equal" : "Farkli / Different");
16  Serial.println(c, BIN);                    // 10110101
17  Serial.println(c, HEX);                    // B5
18  Serial.println(c, DEC);                    // 181
19  Serial.println(12, BIN);                   // 1100 (baştaki sıfırlar yok / no leading zeros)
20  binaryYaz(12);                             // 00001100
21  Serial.println(010);                       // 8: baştaki 0 sekizlik demek / leading 0 means octal
22}
23
24void loop() {
25}
In C++, putting a zero in front of a number makes it an octal number: 010 is eight, not ten, and 0255 is 173. If you write 08 or 09 to line up pin numbers or times, the compiler reports an error; write 010 and it silently does the wrong thing. Never put a leading zero on decimal numbers.

Bitwise operations: &, |, ^, ~, << and >>

Bitwise operations compare the bits in the same position of two numbers one by one. AND (&) gives 1 only if both bits are 1; OR (|) gives 1 if either bit is 1; XOR (^) gives 1 if the bits differ; NOT (~) inverts every bit. Left shift (<<) pushes the bits to the left and adds 0s on the right, multiplying the number by 2 at each step; right shift (>>) pushes the bits to the right, dividing by 2 at each step. These are the software counterparts of logic gates; you can see their truth tables in the logic gates article and the logic gate tool. The table below shows the results for a = 0b11001010 (202) and b = 0b10101100 (172):

OperationWhat does it do?Result (binary)HexDecimal
a & bBits that are 1 in both100010000x88136
a | bBits that are 1 in at least one111011100xEE238
a ^ bBits that differ011001100x66102
~a (byte)Every bit inverted001101010x3553
a << 1 (byte)One place left, the leftmost bit drops off100101000x94148
a >> 2Two places right, the two rightmost bits drop off001100100x3250

Note two details in the table. When the result of a << 1 is stored in a byte, the leftmost bit falls off and 148 remains; done in an int the same operation gives 404, because an int has room for the overflowing bit. ~a is similar: as a byte it's 53, but calculated as an int the upper bits are inverted too and the result is -203. In bitwise operations you must always know which type holds the result. And don't mix up & and &&: the first works on individual bits, the second checks whether two conditions are true.

Bit masks: reading, setting and clearing a single bit

In real projects bitwise operations are almost always used with a mask. A mask is a number in which only the bits you care about are 1, usually built with (1 << n): (1 << 3) = 0b00001000. You do four basic operations with a mask, and Arduino offers a ready-made function for each of them. The code below keeps the state of 8 LEDs in a single byte instead of 8 separate bool variables and mirrors it to the LEDs on D2–D9:

GoalWith a maskArduino functionExample (n = 3)
Set the bit to 1x |= (1 << n);bitSet(x, n);00000000 → 00001000
Clear the bit to 0x &= ~(1 << n);bitClear(x, n);11111111 → 11110111
Toggle the bitx ^= (1 << n);bitWrite(x, n, !bitRead(x, n));00001000 → 00000000
Read (test) the bit(x >> n) & 1bitRead(x, n);00001000 → 1
Write a given value to the bitx = (x & ~(1 << n)) | (v << n);bitWrite(x, n, v);v = 1 → 00001000
Value of bit n1 << nbit(n);bit(3) = 8
C++ (Arduino IDE)
1// 8 LED'in durumu tek bir baytta / the state of 8 LEDs in one byte
2const byte LED_PINLERI[8] = {2, 3, 4, 5, 6, 7, 8, 9};   // bit 0 -> D2 ... bit 7 -> D9
3byte durum = 0b00000000;
4
5void goster() {                                // baytı LED'lere yansıt / mirror the byte to the LEDs
6  for (byte i = 0; i < 8; i++) {
7    digitalWrite(LED_PINLERI[i], bitRead(durum, i));
8  }
9}
10
11void setup() {
12  Serial.begin(9600);
13  for (byte i = 0; i < 8; i++) pinMode(LED_PINLERI[i], OUTPUT);
14}
15
16void loop() {
17  durum |= (1 << 3);                           // bit 3'ü aç (D5) / set bit 3 (D5)
18  durum ^= 0b10000001;                         // bit 0 ve 7'yi tersle / toggle bits 0 and 7
19  goster();
20  Serial.println(durum, BIN);
21  delay(500);
22
23  durum &= ~(1 << 3);                          // bit 3'ü kapat / clear bit 3
24  bitWrite(durum, 5, !bitRead(durum, 5));      // bit 5'i tersle / toggle bit 5
25  goster();
26  if (durum & (1 << 5)) {                      // bit 5 açık mı? / is bit 5 set?
27    Serial.println(F("Bit 5 acik / Bit 5 is on"));
28  }
29  delay(500);
30}

Preparing bytes for a 7-segment display

The eight parts of a 7-segment display (segments a–g and the decimal point) fit exactly into one byte. If you assign bit 0 to segment a, bit 6 to segment g and bit 7 to the decimal point (DP), every digit can be expressed as a single number. The digit 2, for example, is drawn with segments a, b, d, e and g: 1 + 2 + 8 + 16 + 64 = 91 = 0x5B. On common-anode displays a segment lights on LOW, so you invert the same table with ~. For segment wiring details see the 7-segment display article.

DigitSegments litBinary (DP g f e d c b a)Common cathodeCommon anode (~)
0a b c d e f001111110x3F0xC0
1b c000001100x060xF9
2a b d e g010110110x5B0xA4
3a b c d g010011110x4F0xB0
4b c f g011001100x660x99
5a c d f g011011010x6D0x92
6a c d e f g011111010x7D0x82
7a b c000001110x070xF8
8a b c d e f g011111110x7F0x80
9a b c d f g011011110x6F0x90

Sending the byte to outputs with a 74HC595

The 74HC595 shift register spreads one byte over eight outputs using only three pins, and it's the chip where you see bitwise operations most clearly: each bit of the byte you send lights or turns off one output. When shiftOut is used with MSBFIRST, bit 7 is sent first and ends up in Q7, while bit 0 lands in Q0. So if you connect Q0 to segment a, Q6 to g and Q7 to DP, the table above works directly. For all the chip's pins and daisy-chaining, see the 74HC595 shift register article.

ConnectionArduino UnoESP32Raspberry Pi Pico
DS (14), serial dataD11GPIO 23GP19
SH_CP (11), clockD13GPIO 18GP18
ST_CP (12), latchD10GPIO 5GP17
OE (13) / MR (10)GND / 5VGND / 3V3GND / 3V3(OUT)
Q0–Q6 / Q7Segments a–g / DP, each through a resistorSameSame
C++ (Arduino IDE)
1// 74HC595 + ortak katotlu 7 segment: 0-9 sayacı / 0-9 counter
2const byte DATA_PIN = 11;    // DS (14)
3const byte CLOCK_PIN = 13;   // SH_CP (11)
4const byte LATCH_PIN = 10;   // ST_CP (12)
5const bool ORTAK_ANOT = false;   // ortak anotsa true / true for common anode
6
7// bit 0 = a ... bit 6 = g, bit 7 = DP
8const byte RAKAMLAR[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F};
9
10void yaz595(byte desen) {
11  if (ORTAK_ANOT) desen = ~desen;                    // segmentler LOW ile yanar / segments light on LOW
12  digitalWrite(LATCH_PIN, LOW);
13  shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, desen);    // bit 7 önce -> Q7 / bit 7 first -> Q7
14  digitalWrite(LATCH_PIN, HIGH);                     // çıkışlara aktar / copy to the outputs
15}
16
17void setup() {
18  pinMode(DATA_PIN, OUTPUT);
19  pinMode(CLOCK_PIN, OUTPUT);
20  pinMode(LATCH_PIN, OUTPUT);
21}
22
23void loop() {
24  for (byte i = 0; i < 10; i++) {
25    byte desen = RAKAMLAR[i];
26    if (i % 2 == 1) desen |= 0x80;                   // tek sayılarda noktayı yak / DP on odd digits
27    yaz595(desen);
28    delay(700);
29  }
30}

Writing directly to registers: PORTB and DDRB

On the Uno's ATmega328P the pins are grouped into 8-pin ports, and each port has three registers: DDRx holds the pin direction (1 = output), PORTx the output level and PINx the level that is read. Pins D8–D13 are on port B; D13 (the built-in LED) is PB5, bit 5 of PORTB. pinMode and digitalWrite actually change these bits, but because they first translate the pin number into a port, they take a few microseconds. Writing to the register directly is a single machine instruction and finishes in 2 clock cycles at 16 MHz, about 125 nanoseconds. It also lets you change several pins on the same port at exactly the same moment.

Uno pinPort and bitUno pinPort and bit
D0–D7PD0–PD7 (PORTD)D8–D13PB0–PB5 (PORTB)
A0–A5PC0–PC5 (PORTC)D13 (built-in LED)PB5
C++ (Arduino IDE)
1// Uno: D13'ü register ile yönet / drive D13 through registers (ATmega328P)
2void setup() {
3  Serial.begin(9600);
4  DDRB |= (1 << DDB5);                // D13 çıkış (pinMode) / D13 as output
5  DDRD &= ~(1 << DDD2);               // D2 giriş / D2 as input
6  PORTD |= (1 << PORTD2);             // D2 dahili pull-up / internal pull-up on D2
7}
8
9void loop() {
10  PORTB |= (1 << PORTB5);             // D13 HIGH
11  delay(200);
12  PORTB &= ~(1 << PORTB5);            // D13 LOW
13  delay(200);
14  PINB = (1 << PINB5);                // PINx'e 1 yazmak pini tersler / writing 1 to PINx toggles
15  delay(200);
16  PINB = (1 << PINB5);
17  bool buton = !(PIND & (1 << PIND2));   // D2 GND'ye çekilince true / true when D2 is pulled to GND
18  Serial.println(buton ? "Basili / Pressed" : "Serbest / Released");
19}
Register code is board-specific: a PORTB line that works on the Uno controls different pins on a Mega, controls nothing on an ESP32 or Pico and won't even compile there. Also, bits 0 and 1 of PORTD are the serial port pins; a line that writes the whole port at once, such as PORTD = 0xFF, can break Serial. Change only the bits you care about with a mask, and use register code only where speed really matters.

Driving pins through registers on the ESP32

On the ESP32 pins are controlled by 32-bit registers, and unlike AVR there are separate set and clear registers: every 1 bit you write to GPIO_OUT_W1TS_REG (write 1 to set) makes the matching pin HIGH, every 1 bit you write to GPIO_OUT_W1TC_REG (write 1 to clear) makes it LOW, and 0 bits don't touch any pin. Because this needs no read-modify-write, it's safe with interrupts and across the two cores. These two registers only cover GPIO 0–31; for 32 and above the GPIO_OUT1 registers are used.

C++ (Arduino IDE)
1// ESP32: GPIO 2'yi W1TS / W1TC register'larıyla yak-söndür
2// ESP32: blink GPIO 2 with the W1TS / W1TC registers
3#include "soc/gpio_reg.h"
4
5const int LED_PIN = 2;                         // birçok kartta dahili LED / onboard LED on many boards
6
7void setup() {
8  pinMode(LED_PIN, OUTPUT);                    // yön ve pin işlevi / direction and pin function
9}
10
11void loop() {
12  REG_WRITE(GPIO_OUT_W1TS_REG, 1UL << LED_PIN);   // HIGH (yalnız bu bit) / HIGH (only this bit)
13  delay(300);
14  REG_WRITE(GPIO_OUT_W1TC_REG, 1UL << LED_PIN);   // LOW
15  delay(300);
16}

Combining and splitting sensor data

I2C and SPI sensors usually send 16-bit readings as two separate bytes: the high byte (MSB) first, then the low byte (LSB). To combine them you shift the high byte 8 places to the left and OR it with the low byte: int16_t raw = (msb << 8) | lsb;. If an accelerometer sends 0xFC and 0x18, for example, the result is 0xFC18; read as an int16_t, this number is -1000 because the leftmost bit is 1. In the other direction, to send a number or write it to EEPROM there are highByte(x) and lowByte(x), and word(high, low) to join two bytes. You'll find I2C communication itself in What is I2C?, and a sensor that works with two-byte raw data in the MPU6050 article.

ExpressionResultExplanation
(0xFC << 8) | 0x180xFC18Combines two bytes into one 16-bit number
(int16_t)0xFC18-1000Negative in a signed read because the leftmost bit is 1
highByte(1000)0x031000 = 0x03E8; the high byte
lowByte(1000)0xE8The low byte (232)
word(0x03, 0xE8)1000Joins the two bytes again
(state >> 4) & 0x0FUpper nibbleExtracts the upper 4 bits of a byte (e.g. a register field)

Bits on the Raspberry Pi Pico and in MicroPython

The same operators apply in MicroPython, plus there are ready-made conversion functions: bin(), hex() and int(text, base). Because Python integers grow without limit, you need to mask the results of ~ and << with & 0xFF if you want them to fit in a byte. The Pico's RP2040 chip also has separate set, clear and XOR registers like the ESP32, and you can write to them directly with machine.mem32. The code below blinks the Pico's built-in LED on GP25 with the XOR register (on the Pico W the built-in LED is wired to the Wi-Fi chip, so use an external LED there).

MicroPython
1from machine import Pin, mem32
2import time
3
4x = 181
5print(bin(x), hex(x))                          # 0b10110101 0xb5
6print("{:08b}".format(12))                     # 00001100 (baştaki sıfırlarla / with leading zeros)
7print(int("10110101", 2), int("B5", 16))       # 181 181
8
9a, b = 0b11001010, 0b10101100
10print(a & b, a | b, a ^ b)                     # 136 238 102
11print(~a & 0xFF, (a << 1) & 0xFF, a >> 2)      # 53 148 50 (bayta sığdırılmış / masked to a byte)
12
13led = Pin(25, Pin.OUT)                         # pin işlevini ve yönü ayarla / set function and direction
14SIO_GPIO_OUT_XOR = 0xD000001C                  # RP2040 SIO: çıkışı tersle / toggle outputs
15for _ in range(6):
16    mem32[SIO_GPIO_OUT_XOR] = 1 << 25          # yalnız GP25'i tersle / toggle only GP25
17    time.sleep_ms(250)

Project ideas with bitwise operations

  • Binary counter: Build a counter that counts from 0 to 255 on 8 LEDs and see the binary system with your own eyes; one button adds one, the other subtracts one.
  • Knight Rider effect: Shift a byte with << and >> to sweep the LEDs back and forth; step-by-step setup in the Knight Rider and running LED article.
  • Digital clock: Show the time on a four-digit 7-segment display and blink the second digit's decimal point every second with the 0x80 mask.
  • LED matrix icons: Draw each row of an 8×8 matrix as a byte; design hearts, arrows or letters with 0b. The MAX7219 LED matrix article uses this method.
  • Settings flags: Keep on/off settings such as sound on, bright screen and alarm set in the bits of a single byte and write them to EEPROM in one go.
  • Address selection with a DIP switch: Read a 4-way DIP switch to get a device address between 0 and 15.

Common mistakes and how to fix them

MistakeWhat happens?Correct form
if (x & 0x04 == 0)== is evaluated first, the expression becomes x & 0 and is always falseif ((x & 0x04) == 0)
Using 2 ^ 3 for a power^ is XOR; 2 ^ 3 = 11 << 3 or pow(2, 3)
1 << 15 or 1 << 20 on the UnoThe 16-bit int overflows: -32768 or 01UL << 20 (unsigned long)
Assuming Serial.println(x, BIN) prints 8 bitsLeading zeros are not printed: 12 → 1100Print 8 bits in a loop with bitRead
Putting a 0 in front of a number (010)It becomes octal: 010 = 8Remove leading zeros from decimal numbers
Using the result of ~ in an intThe upper bits are inverted too: ~0x0F = -16Assign the result to a byte or mask it with & 0xFF
Writing && instead of &Two conditions are compared, not bitsSingle & for bits, && for conditions
If you're unsure about a bitwise operation, print the result in three forms: Serial.println(x), Serial.println(x, BIN) and Serial.println(x, HEX). Seeing the same value in decimal, binary and hex shows at once whether the mask or shift touched the bits you expected.

Binary and hexadecimal numbers and bitwise operations look abstract at first, but you meet them every day in electronics, from driving a row of LEDs with a single byte to combining sensor data. Learned together with the Arduino programming basics, they make your code both shorter and faster. In the BlueGrays app you can explore 7-segment counters, a digital clock, running LEDs, Knight Rider and LED matrix projects with step-by-step circuit diagrams and code written with these bitwise operations.

Frequently asked questions

What is the binary number system?

The binary number system uses only the digits 0 and 1, and each position is worth twice the one before. From right to left the place values are 1, 2, 4, 8, 16, 32, 64, 128. Because 1 represents a high voltage and 0 a low voltage in digital circuits, all computers and microcontrollers work with this system.

How do you convert a decimal number to binary?

Keep dividing the number by 2 until it reaches 0 and write down the remainder at each step; reading the remainders from bottom to top gives the binary number. For 13: 6 remainder 1, 3 remainder 0, 1 remainder 1, 0 remainder 1, so the result is 1101. To check, add up the place values of the 1s: 8 + 4 + 1 = 13.

Why is the hexadecimal (hex) system used?

Each hex digit corresponds to exactly 4 bits, so it's the easiest way to write long binary numbers briefly and without mistakes. An 8-bit byte is written with two hex digits, for example B5 instead of 10110101. That's why I2C addresses, colour codes, register values and memory addresses are always given in hex.

What do 0b and 0x mean on Arduino?

Numbers starting with 0b are read as binary and those starting with 0x as hexadecimal; 0b10110101, 0xB5 and 181 are the same number. Which one you write makes no difference to the compiler, only to readability. Arduino also accepts the 8-bit B10110101 form from older code.

What do bitRead and bitWrite do?

bitRead(x, n) returns bit number n of x as 0 or 1; bitWrite(x, n, v) sets the same bit to the value v. bitSet and bitClear set a bit directly to 1 or 0. These functions make masking and shifting readable; bit numbers start at 0.

What do the << and >> operators do on Arduino?

<< shifts the bits to the left and multiplies the number by 2 at each step; >> shifts them to the right and divides by 2 at each step. 1 << 3 is 8, and masks that select a single bit are built this way. Because int is 16 bits on the Uno, you need to write 1UL << n for shifts larger than 15.

See all projects
LED Chaser
AR-5Intermediate

LED Chaser

Lights that switch on one after another, as if they were running. The Arduino lights six LEDs one at a time; each glows for a brief moment and goes out, so the light walks from start to end and then…

4.6(87)
217
Knight Rider LED Effect
AR-6Intermediate

Knight Rider LED Effect

The classic scanner light: a dot of light slides from one end of six LEDs to the other and then comes back.

4.8(107)
214
Displaying Numbers 0-9 on a 7-Segment Display
AR-41Intermediate
Premium

Displaying Numbers 0-9 on a 7-Segment Display

Write those familiar numbers you see in elevators and digital clocks yourself. On a display made of seven little light bars, the Arduino shows a digit from 0 to 9, one each second, and then starts…

4.5(30)
43
Displaying Numbers 0-99 on a 7-Segment Display
AR-42Advanced
Premium

Displaying Numbers 0-99 on a 7-Segment Display

A two-digit display made of little bars, like the ones on a calculator, counts from 0 to 99.

4.5(27)
35
Displaying 0-9999 on a 4-Digit 7-Segment Display
AR-47Intermediate
Premium

Displaying 0-9999 on a 4-Digit 7-Segment Display

On a four-digit number display, numbers race from 0 to 9999 and then start again from zero.

4.4(19)
25
Digital Clock with 4-Digit 7-Segment Display
AR-48Intermediate
Premium

Digital Clock with 4-Digit 7-Segment Display

A four-digit glowing digital clock, much like the one on a kitchen oven. The DS1302 clock module keeps the time, and every second the Arduino reads the hours and minutes and shows them on the…

4.8(56)
73
Dot Matrix Clock and Calendar (MAX7219, DS1307)
AR-84Intermediate
Premium

Dot Matrix Clock and Calendar (MAX7219, DS1307)

A glowing board for your desk or wall that shows the time and date in scrolling text.

5.0(37)
59
Pixel Snake 8x8 Matrix
AR-88Advanced
Premium

Pixel Snake 8x8 Matrix

Build the classic snake game with your own hands and play it. On a colorful 8x8 light matrix, you steer a green snake with a joystick and eat red apples; with every apple the snake grows, speeds up a…

4.7(39)
57