PragmaticBookshelf

PragmaticBookshelf

Forum Sponsor

Build a Binary Clock with Elixir and Nerves (PragProg)

Frank Hunleth @fhunleth
Bruce A. Tate @redrapids

edited by Jacquelyn Carter @jkcarter

Want to get better at coding Elixir? Write a hardware project with Nerves. As you build this binary clock, you’ll build in resiliency using OTP, the same libraries powering many commercial phone switches. You’ll attack complexity the way the experts do, using a layered approach. You’ll sharpen your debugging skills by taking small, easily verified steps toward your goal. When you’re done, you’ll have a working binary clock and a good appreciation of the work that goes into a hardware system. You’ll also be able to apply that understanding to every new line of Elixir you write.

Combining software with hardware can be frustrating, but you can become proficient in no time by taking a simple, logical approach. Blinking a single LED is the traditional “hello-world” of embedded systems. Building your own binary clock is the logical next step. It blinks groupings of LEDs based on the system time. This guide walks you through a working project using the techniques used by experts who build software for hardware every day.

This common sense project moves forward in tiny, logical steps. As you progress, you can verify each step before moving on to the next. You don’t have to be a Nerves novice to benefit from this project. Become a better Elixir programmer as you build your own desktop showpiece. With a layered approach to software design, you’ll learn to control the complexity of your programs the way the experts do by focusing on one small slice of your system at a time.

When you’re done, you’ll have your own binary clock, and also more of the tools you need to design and build your own Nerves and Elixir projects. You’ll also be a better programmer with a deeper appreciation of layering techniques for controlling complexity.


Frank Hunleth is an embedded systems programmer, OSS maintainer, and Nerves core team member. When not in front of a computer, he loves running and spending time with his family.

Bruce Tate is a kayaker, programmer, and father of two from Chattanooga, Tennessee. The author of more than 10 books has been around Elixir from the beginning. He is the founder of Groxio, a company that trains Elixir developers.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

Most Liked

fhunleth

fhunleth

Co-author of Nerves

During the course of working on this book, I learned that Bruce really enjoys working with wood and had a lot of fun with that aspect. However, this is not a wood working or metal working book.

The focus is on designing embedded software using Elixir. It’s important to view the binary clock as an example project. If you were only interested in building a binary clock, Nerves and Elixir are overkill. However, the binary clock is a place to start if you’re looking to learn the basics and how to build your programs for larger embedded projects.

The Weather Station book is similar, but takes a different view at the software and focuses on reporting and displaying sensor data. In that case as well, you won’t have a full fledged weather station at the end, but you will know quite a bit more on the software side.

Since it sounds like you’re interested in the end product looks, I think that you’d be more satisfied not buying the book and instead following the build instructions for a Raspberry Pi clock you like. Perhaps the programming language doesn’t matter. Or maybe you can install Nerves Livebook and write a small notebook to control it. If you’d like to see how to move your project to be a self-contained firmware image with Nerves and pull in networking and more all in Elixir, these books will help. You’ll hopefully feel better about buying them then, too.

Hope this helps.

Where Next?

Popular in Books Top

PragmaticBookshelf
Ellie Fairholm and Josep Giralt D’Lacoste edited by Nicole Tache The days of separate dev and ops teams are over—knowledge silos and the...
New
shankardevy
I am happy to announce that I am completing final rounds of my Phoenix book (which is now a series of books/booklets). ...
New
PragmaticBookshelf
Joseph Koski Series editor: Sophie DeBenedetto @SophieDeBenedetto Developmental editor Adaobi Obi Tulton @aotulton Combine advanced fu...
New
AstonJ
Classing this as a free online book :003: By Sean Callan with help from the community Lessons about the Elixir programming language...
New
PragmaticBookshelf
Peter Ullrich (@PJUllrich) edited by Michael Swaine @michaelswaine Data is at the core of every business, but it is useless if nobody ca...
New
PragmaticBookshelf
Stephen Bussey @sb8244 edited by Jacquelyn Carter @jkcarter Elixir will change the way you think about programming. Use your Ruby experi...
New
PragmaticBookshelf
Svilen Gospodinov edited by Jacquelyn Carter @jkcarter Learn different ways of writing concurrent code in Elixir and increase your appli...
New
AstonJ
by Benjamin Tan Wei Hao The Little Elixir & OTP Guidebook gets you started programming applications with Elixir and OTP. You begin w...
New
PragmaticBookshelf
Isaak Tsalicoglou Built for the curious, this isn’t your average programming book—it’s nearly 500 pages of hands-on mentorship beyond cod...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement