Binary Arithmetic And Port Manipulation

Photo of talofer99

Made by talofer99

About the project

One port to role them all.

Project info

Difficulty: Easy

Platforms: Arduino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Tiny Breadboard Tiny Breadboard x 8
Arduino MKRFOX 1200 Arduino MKRFOX 1200 x 1

Software apps and online services

Arduino IDE Arduino IDE

Story

In this tutorial I will cover the basics of binary arithmetic and its practical uses in arduino.

Setting and storing the state of 8 leds, with only one byte of data.

Also covering some of the less known and used bit functions of Arduino, like bitSet, bitClear and some other bit functions.

For more read about binary arithmetic and its practical uses in arduino

https://playground.arduino.cc/Code/BitMath

Some more info on ports in arduino

https://www.arduino.cc/en/Reference/PortManipulation

Schematics, diagrams and documents

Schematics

Code

The finished example code

Show the steps (commented out) before using the port

Credits

Photo of talofer99

talofer99

Maker @ heart

   

Leave your feedback...