Home / Codes


Arduino Programming: Static Variables

Arduino Static Variables

Here we are with another tutorial on Arduino programming. This time, we will look at static variables and how you can use them to your advantage. What is a Static Variable? A static variable is a variable that stores its data as long as the program is running. Consider a …

Read More »

Using Ternary Operator in Arduino

Nested ternary example circuit

If your Arduino code involves decision making, then it’s very likely you’re using conditional statements. Using if … else… is common;  switch statements can be used as well. But there is a third way, using ternary operator, that will really make your code shorter. Example Scenario Say we are reading …

Read More »

Creating an Arduino Class

creating arduino class

The Arduino platform runs on C++ and with this comes all the pros (and cons) of the language. One of those pros is the use of classes and in general, object oriented coding. This article aims to guide you in creating your own Arduino classes which can make your sketches …

Read More »

Using Arrays in Arduino Programming

arduino array

An array is a data structure for storing multiple variables of the same data type. Mastering arrays will definitely make your Arduino sketches more efficient. If you’re a beginner when it comes to Arduino array, then this tutorial is for you.

Read More »

Feature: FastLED Arduino Library

arduino led strip

Description FastLED is a fast, efficient, easy-to-use Arduino library for programming addressable LED strips and pixels such as WS2810, WS2811, LPD8806, Neopixel and more. FastLED is used by thousands of developers, in countless art and hobby projects, and in numerous commercial products.

Read More »

Implementing Bubble Sort in AVR/Arduino

bubble sort algorithm

This is a short note on implementing the Bubble Sort algorithm on the AVR and Arduino microcontrollers. Bubble sort or sinking sort is one of the many sorting algorithms. In this algorithm,  a list is repeatedly read where each line is compared to adjacent elements and swaps them if they …

Read More »

How to Save and Retrieve a String to Arduino EEPROM

Arduino EEPROM

An Arduino’s EEPROM, depending on the type of board, can store up to 4 KB of data. The Arduino UNO, in particular, stores 1024 bytes or 1024 ASCII characters. With that space, how can we store a sentence? Or a paragraph? This is what this article is all about.

Read More »