Logging data on an Arduino is very much a trivial every-day task. Connect an SD card, open a file, and start printing data to it.
For many people that is good enough. It results in nice easily readable (by us humans) data.
But it’s not fast. It’s not efficient. It’s perfectly fine for things like logging temperature every hour, or barometric pressure every 5 minutes, etc. But when you have large amounts of data to store very rapidly you have to think a little differently. Continue reading
So many people starting out in electronics, especially beginning to dabble in the world of Arduino and similar boards, just don’t have the basic equipment to do the job properly. And not only that, they don’t even know what the basic equipment is.
So here’s a list of things you should have on your desk no matter if you have just got your first Arduino or if, like me, you are a seasoned veteran. Continue reading
My latest acquisition, the Dragino Yun Shield is actually quite a nice bit of kit. It’s the Linux portion of an Arduino Yun placed on a shield, so you can attach it to any board of your choosing.
It provides both a UART and an SPI connection to whatever it is plugged in to. And that includes chipKIT boards.
For those of you not familiar with the Arduino Yun, it’s a combination MIPS SoC (Atheros) like you get in most home WiFi routers coupled with an Atmel microcontroller (32U4). Personally I always felt it was such a shame that a board as cool as the Yun should be crippled with a piece of Atmel like that. But hey ho. And then the Dragino arrived and all was forgiven. Gone is the Atmel, and in its place is the lovely PIC32MX695F512L on a chipKIT WF32. Or any other chipKIT board of your choice that you should happen to be drooling over at the time. Continue reading
… and maybe the real Yun too.
So there’s the Arduino Yun. That’s quite a nice concept – an embedded Linux computer (MIPS based, YAY!) and microcontroller combined on one board. Just such a shame it’s an Atmel microcontroller and not a PIC32.
But then there is the Dragino Yun shield. Just the Linux portion on a shield that you can plug in to your favourite board and make a Frankensteinian monster. Perfect. Coupled with a nice meaty PIC32 it’s the ideal combination. However, programming the PIC32 is then nigh on impossible, since the serial port gets blocked up. So you want to program it from the Yun shield if you can. But that means porting pic32prog to Linino, and that has proved to be a bit of a trial. More on that some other time though.
This is all about what happened whilst I have been attempting to do that porting.
I bricked the Dragino somehow. Continue reading
Everyone, when they’re starting out on the Arduino and similar boards, learns to use the String object for working with text. Or they think they do.
Well, you should forget all you think you have learned about using Strings on the Arduino, because it is all wrong.
Strings are a bit of a tricky area on the Arduino. The String object was created to make working with blocks of text easier for people that don’t really know what they are doing when it comes to low level C++ programming. However, if you don’t know what you’re doing when it comes to low level C++ programming then it is very easy to abuse the String object in such a way that it makes everything about your sketch fragile and unstable.
So I’m here to tell you firstly why you shouldn’t use String objects, and secondly, if you really must use them, how you go about using them properly. Continue reading
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. Continue reading
Many of the programming questions on the Arduino forum can be answered with one simple response:
Implement a “Finite State Machine.”
But what actually is a “Finite State Machine”?
Put simply, a Finite State Machine (I’m bored with typing that now, let’s call it an FSM – not to be confused with the Flying Spaghetti Monster, of course) is a computer program that, at any point in time, can be in one of a pre-determined number of states. A state is a specific action, such as “Waiting for button 3 to be pressed”, or “Moving the servo to 69°”, for example.
An FSM can replace most of your while, for and similar loops, as well as annoying functions such as delay which get in the way if you want to do more than one thing at a time. Continue reading