Category

Microcontrollers

Category

The Gecko Zero EFM32 Weather Station Evaluation Board from Silicon Labs is intended to show off the low-energy or energy harvesting capabilities of the EFM32 Zero.  The ARM-based board has physical and cap sensitive buttons along with the LCD.

It comes pre-loaded with a demo program, which is the classic Space Invaders.

If you’re interested in more about the board, I wrote a road test of Gecko EFM32 on element 14. (Spoilers: I wasn’t impressed.  Not a bad board, but rough development environment.)

What happens when you have a random chip or sensor you want to interface with an Arduino, but don’t know how? You search for a pre-existing library of course. And where are many libraries hosted and available from?  A place where eager developers hack together code, post updates, and collaborate with others: Github!

Warning, the title of this post is a little bit misleading. It isn’t just one-click to get cleanly formatted code, it’s actually two.

There are two things seasoned programmers will tell new programmers, that they don’t understand (at first):

  1. Always comment your code
  2. Properly indent code

The problem?  As a new programmer, you might not know how to do #2 until you get some experience.

When most people say “Arduino” they mean an ATmega328 based board like the Uno.  This means a simple 8-bit microcontroller with only 2K of RAM.  That’s 2,048 bytes of memory to work with.  So when someone asked me if the Arduino could do speech recognition, to be honest, I laughed.  Then my jaw dropped when I saw µSpeech.  A speech recognition library for the Arduino Uno’s ATmega328.

There is one mistake that all C programmers make, regardless of experience.  You’ll do it often when you get started, but never completely stop.  The mistake?  Confusing the “assignment” operator with the “comparison” operator.  Take a look at this line of code:

[cpp] if (something = 0) {
[/cpp]

Notice the problem?  If not, then you might fall into this common trap.  The most annoying part?  A C-Compiler won’t give an error.  That code is legal C.  Legal code doesn’t mean you’ll get the results you expect.  In fact, this is probably not even close to what you wanted.   This simple mistake and why it “works” is explained below.