# jon black

"I am in a charming state of confusion"

The amount of pressure that software engineers put on themselves is monstrous. Our view of world as a finite, discernible system causes us to aim for nothing less than perfection. With such high expectations, it's no wonder that we procrastinate, struggling to find a place to start. Thankfully, according to The Book of Life, this is a very honourable problem:

People who don’t know where to start are often perfectionists. It’s an honourable problem: you’re doing nothing not because you’re lazy but because you’re very ambitious. Perfectionism is one of the causes of procrastination – because it makes us so worried about getting things wrong.

Yet in spite of this honour, and when faced with the daunting task of creating perfection, we lay down our arms and reach for the white flag. We then compose a list of our inadequacies and view our perceived failure, and

When you get started with programming one of the first obstacles is picking a language. A mistake beginners often make is asking experienced developers where they should start:

The truth is it doesn't matter.

The first programming language I was taught was Pascal. This was long after my childhood experiments with ST BASIC. The year was 1998 and I was 17 years old. In case you're not familiar with pascal, here's its "hello, world":

program HelloWorld;
begin
WriteLn('Hello World')
end.


I've not used this language since. If you were to ask me to write a program using this language now, I'd need a book. In fact, I had to search for the example above.

That doesn't mean it was a waste of time. Through Pascal I learned basic programming concepts such as variable assignment, loops and if statements; it even introduced me to object oriented programming.

I

Introducing arduino-fsm, a library that makes it easy to use a finite state machine in an Arduino project.

# Design

This library is composed of two classes: Fsm and State:

 State Represents a state in the state machine. A state has two callback functions associated with it: on_enter and on_exit, which are called when the state is entered into and exited from, respectively. Fsm Represents the state machine. Transitions are added using the add_transition function. This function takes pointers to two states, an event id, and a callback to a function that's called when the transition takes place. Calling trigger with the event id invokes the transition, but only if the Fsm is in the start state, otherwise nothing happens.

# Tutorial

First create the Fsm and State instances at the top of your source file.

#include <Fsm.h>

#define FLIP_LIGHT_SWITCH 1
Fsm fsm;
State

Introducing the arduino-menusystem library that makes it easy to incorporate a menu system into an Arduino project.

# Design

The library is implemented according to the composite design pattern. When using this library you need to create Menu's, MenuItem's, and a single MenuSystem.

 Menu A Menu represents an item in the menu that contains other Menu's and MenuItem's. Use add_menu_item() and add_menu() to build its contents. MenuItem A MenuItem represents an action. When select() is called the MenuItem's callback function is called. MenuSystem The MenuSystem contains the core functions for interacting with the menu system: next(), prev(), select(), and back().

# Tutorial

First create the various Menu's, MenuItem's, and MenuSystem at the top

There are an insane number of devices connected to The Internet, and it's growing at a crazy rate. In 2012 Cisco estimated around 8.7 billion, and that figure in 2015 jumps to a massive 15 billion.

Think about that for a second.

In three years, the number of devices has grown 58%. If that were to continue, in 15 years there'd be a staggering 146.1 billion devices!