I don't know about you, but I have a huge pile of different Arduino-like boards here. (I have so many because I need to test UECIDE with them - or that's what I tell the "bank manager"). Many is the time I will have more than one of them plugged in to my computer. Often times I have programmed one of them with some code only to find it's not worked - and why hasn't it worked? Because I have had the wrong serial port selected in the IDE.
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.
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.
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.
... 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.
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.
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:
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"?
I see many many questions on the Arduino forums from people trying to read data from a serial connection and not fully understanding how it works - and hence failing.
So, how should you read from serial?
Well, what a lot of new users don't realise is that serial data arrives one character at a time, and you have little or no control over just when that data arrives.