Programming

In a full production environment it is often desirable to be able to install the firmware on a device without needing either the source code or a full IDE environment with which to perform the upload. This is especially important when dealing with proprietary or copyrighted source code where distributing the source code to third parties would not be appropriate.

Document Category: 

Common Arduino Errors and Warnings

This is my attempt to collate and explain the most common errors and warnings you get when compiling code for the Arduino and Arduino-like boards.

Errors

Expected primary expression before '.' token

This is usually because you used a class name instead of an instance of a class. One example would be if you created an instance of the LiquidCrystal class:

LiquidCrystal lcd(4, 5, 6, 7, 8, 9, 10);

And then used something like:

LiquidCrystal.print("foo");

instead of:

Arrays? Pointers? What the C?

Arrays and pointers are always a problem for newcommers to C and C++ programmers. Especially if they have come from higher level, more "dumbed down" languages like Java or Basic.

You may think that an array is an array, right? And an array in one language works the same as an array in another language, cus they're, like, arrays, aren't they? Well, you couldn't be more wrong. Certainly when it comes to arrays in C and C++, anyway.

I guess you're probably used to working with arrays like this (pseudocode):

1×10³²⁴ things to do with a chipKIT™ Lenny and a QuickIO. No. 2: Virtual Mouse.

Number two in my series of what to do with a Lenny and a QuickIO.

How about a mouse? Yeah, a mouse. Honest :)

Well, maybe not an actual mouse, but maybe make it control the mouse pointer in an "almost" usable way...?

The two potentiometers on the QuickIO could control the mouse position, and the buttons can be the mouse buttons for clicking, etc. That should work.

1x10³²⁴ things to do with a chipKIT™ Lenny and a QuickIO. No. 1: Autoclicker.

This is the first part of a new series entitled "1x10³²⁴ things to do with a chipKIT™ Lenny and a QuickIO". In it, I'm going to be exploring some of the cool things you could do in just a matter of seconds using the two boards combined.

This first one is an Autoclicker.

Splitting Up Text in C

A common question I often find is:

How can I split this incoming data into parts?

It's especially asked in conjunction with reading data through serial. So I thought I'd introduce you to two completely different approaches, each with benefits and drawbacks depending on the kind of data you are splitting.

So you have some data coming in through serial, or some similar stream, and you need to cut it up into different parts. The two methods basically consist of either:

Making accurate ADC readings on the Arduino

There are many sensors out there which output a voltage as a function of the supply voltage as their sensed value. Temperature sensors, light sensors, all sorts.

Measuring that voltage, and converting it in to real figures for whatever is being sensed is not actually as simple as you might at first think.

There are many examples on the internet for converting an ADC value into a voltage, but basically it boils down to:

Pages