Programming the Arduino – Memory Management / Part 2

Let’s get started with the second part of the Arduino programming series. This time we’ll be talking about memory management on the Arduino, how to use it and how best to manage it – showing you how to free up memory and guidelines for programming that will help you reduce your memory footprint on the Arduino.

This article requires some basic understanding of memory, datatypes and basic C/C++ programming skills.

Click here to read more..

Programming the Arduino – Basics / Part 1

Since we post up lots of Arduino related content on the website, it only makes sense that we have some sort of tutorial series to follow. This will start from the basics to the more advanced subjects, hopefully expanding your knowledge of the Arduino.

The Requirements

  1. 1x Arduino Compatible Board (Uno, Duemilanove, Leonardo, Mega etc.)
  2. Windows Environment (We’ll be using Win 7 / 8)
  3. Knowledge of basic programming (e.g. knowing what a variable, function etc. is)

All of the program code will be compatible with all versions of the Arduino; all code will run within the Uno specification, as that is what we will be using. The tutorial series will include the use of some switches, LEDs, sensors etc. which will be mentioned in either the title of the tutorial or in the requirements section.

Click here to read more..

Getting your Nokia 5110 LCD up and running on an Arduino

nokiaWe purchased one of these very cheap, very cool 84×84 LCD backlit screens off of eBay a couple of weeks ago.

It’s a very nice product for adding visual elements to your projects at a very low price. We paid £3.89 for the screen and it was delivered a few days later.

Take a look below for connection instructions and example code from Adafruit on how to get this up and running with your Arduino.
Click here to read more..

Getting started with Flowcode 6

flowcode_6_logo_title2We recently attended the BETT 2014 show and bumped into Matrix Multimedia; they introduced us to the latest revision of their product, Flowcode 6.

We’ll be doing this in a two-part post as Matrix Multimedia kindly gave us one of their development boards to try out (ECIO28P PIC), we’ll be posting separately about what we’ve done with this in another review.

As we understand it Flowcode has been around for many years and has been going through it’s revisions with additional features with every version. There is a large community of users and a generous helping of documentation in the form of tutorials, videos and online courses.

Click here to read more..

Microcontroller Shootout – Arduino Uno

Arduino Uno R3The next Microcontroller we’re going to look at is the Arduino Uno R3 – This is a open source and low cost development board that has an ATmega328 and 14 digital input/output pins (6 can be used as PWM outputs) it also has 6 analog inputs. There is also a USB connection for uploading sketches (programs) from your computer and a ICSP header so you can program it directly if you wish.

We’ll mention it again; this isn’t being directly compared to the other development boards we’re reviewing and hopefully you can make your own mind up regarding what to use after this shootout series. We’ll be doing a summary of all microcontrollers when we come to the end of the Shootout.

There are various types of Arduino available; we chose the Arduino Uno due to the fact that we believe it’s the easiest to get started with and is also the lowest cost of the Arduino family – If you’re just getting started with programming microcontrollers then this would be an entry level product for learning and prototyping.

We’ll be running the same example as we did with the Parallax Propeller, by setting up the board and development environment and flashing an LED with code. Pin 13 is by default an LED actually on the board it’s self, so we’ll be flashing an external LED hooked up to a small breadboard.

Click here to read more..

Arduino based task scheduler/threading functions

ardIf you’ve used the Arduino before then you’ll know that any code you write in the loop() function is executed on every cycle. But what happens when you have code that needs to run at certain intervals? A delay() will just cause that iteration of loop() to hang and pause.

Arduino released a tutorial BlinkWithoutDelay which introduced the concept of checking the “uptime since last boot” and comparing that to make a basic function scheduler.

The code below basically does the same job, except it’s cleaner and easier to manage. This is by no means original, there have been hundreds of productions of this code, this is just one way to go about it.

The naming structure is shown below, instances of the Timer are prefixed with t_FunctionName to indicate this is a timer.

Instead of checking a single variable for the current milliseconds since boot, this will create a new instance of a structure that can be used to store timings for functions. This way you can easily change when to run a certain portion of code without digging through the sketch or remembering which variables contain the correct values.

The loop() portion of the sketch should be kept clean and only be checking the cycles of the functions from the structure. There should be no need to place any program code inside of the loop() function except for these checks.

This should provide the following benefits:

  1. Enable you to run code every [x] milliseconds or [x] seconds.
  2. Structure the program so that you know when code is running and being able to easily change this.
  3. Have a faster running program. e.g. if you know a portion of code is slower and delaying the loop() you can have this run on a larger interval so it isn’t executed as often.

This code is compatible with all versions of the Arduino and most likely other boards where the language is also based on C.