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

AstonJ
By Simon St. Laurent If you’re new to Erlang, its functional style can seem difficult, but with help from this hands-on introduction, y...
New
PragmaticBookshelf
Sean Moriarity @seanmor5 edited by Tammy Coron @Paradox927 From finance to artificial intelligence, genetic algorithms are a powerful to...
New
germsvel
:waving_hand: Hi there, I’ve been working on a Test-Driven Development with Phoenix book. It teaches TDD and BDD by building a chat app ...
New
AstonJ
by Ben Marx, José Valim, Bruce Tate Bring Elixir into your company, with real-life strategies from the people who built Elixir and use i...
New
waseigo
by Isaak Tsalicoglou Why this book is being written A few years ago I got fed up with the menial manual labor I was engaged in in our f...
New
vincentvanbush
Hey! Happy to announce the Elixir Adoption Guide by Curiosum, announced during this year’s ElixirConf EU, is out to the public now :slig...
New
PragmaticBookshelf
Svilen Gospodinov edited by Jacquelyn Carter @jkcarter Learn different ways of writing concurrent code in Elixir and increase your appli...
New
peerreynders
by Darin Wilson and Eric Meadows-Jönsson Languages may come and go, but the relational database endures. Learn how to use Ecto, the prem...
New
peerreynders
Don’t forget you can get 35% off the ebook using the code ‘devtalk.com’ :023: This title will be available on or about 2018-11-10
New
collegeimprovements
by @whatyouhide and @idlehands Elixir offers new paradigms, and challenges you to test in unconventional ways. Start with ExUnit: almost...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
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
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement