# jon black

"I am in a charming state of confusion"

Rendering a menu in arduino-menusystem version 2.1.1 isn't dictated by the API. For example, in the current_menu.ino example the menu is rendered in loop():

void loop()
{
Serial.println("");

{
Serial.print(cp_m_comp->get_name());

Serial.print("<<< ");

Serial.println("");
}

// Code ommitted
}


There are two problems with this approach:

1. Complex decision blocks would be needed to render each MenuComponent type differently, resulting in code that's difficult to read and maintain;
2. It's not obvious how the menu system should be rendered; the API provides

I take a ridiculous number of photos and videos on my phone. Every couple of months I'd get one of the most annoying notifications you can get on your phone. It's the kind of notification that's often followed by an expletive:

The problem with this message is that you can't solve it quickly. You either need to carefully delete photos that are poorly composed or out of focus, or move them off the device. For the latter, Google suggests two methods:

2. Move files with a USB cable.

In an increasingly connected world with age-old software like ssh and rsync, the only options on Android are sending your files to Google's cloud, which has massive privacy implications, or using a USB cable. In other words, Android sucks at transferring files.

When we sit down to write code we all desire coding nirvana, where the world around us melts away and we achieve an inner peace, the code appearing to write itself.

One of the obstacles to reaching such a relaxed and focused mental state is distraction from noise. Like a toddler incessantly poking your arm, it robs you of your attention.

This is why headphones are essential gear for programmers.

They enable us to shut out the world and concentrate on the code, making coding nirvana easier to attain. But with so many different types of headphones on the market, how do we know which ones to choose? Are some better than others for programmers?

There are four different types of headphones, and knowing how these types affect sound isolation is essential for understanding which are more suitable for programmers.

Earbuds sit loosely in the outer-ear facing,

The Arduino IDE leaves a lot to be desired. Granted, it's easy for beginners to build and upload sketches, but as a text-editor it makes you want to smash your keyboard against your monitor. Repeatedly.

Files open in new windows instead of a tab, and there are no advanced features like auto-complete; did I mention it looks like a relic from the Windows 95 era?

This article describes how you can free yourself from the shackles of the Arduino IDE and program your Arduino using vim.

# arduino-makefile

arduino-makefile by Sudar Muthu is a great project that allows you compile, upload, and monitor the serial port using a simple makefile.

How simple you ask? 4 lines! Seriously. And one of those is blank!

Let's work through an example together, from scratch. Let's create a makefile for the legendary Blink sketch.

## 1. Install the Arduino IDE

The Arduino IDE is still required

Beginner Arduino programs tend to focus on a single goal, such as blinking an LED or spinning a servo, where the timing is controlled using delay; the famous blink sketch is a prime example:

void setup() {
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}


This works well for single tasks like blinking an LED; however, delay prevents multiple tasks from running concurrently. We can easily add another LED to the blink sketch and have it blink in time with the existing LED...

void setup() {
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(13, LOW);
digitalWrite(12, LOW);
delay(1000);
}


...but if we want the LED's to blink at different rates, where for example the first LED stays on for three seconds and the second stays on for two seconds, we'll find that delay pauses