It’s not a big thing – but I like my debugging statements to be robust! On the Arduino, if you want to communicate back to the host computer (is ‘host’ the right term here?), then you need to use a … Continue reading
Category Archives: Programming
How To Handle Microsecond Rollover With Arduino’s micros() Function
When timing on the Arduino, it’s common to use the millis() function, which counts the milliseconds the current program has been running. But sometimes you need to do things smaller – enter the microsecond timing function, micros(). However, there’s a … Continue reading
Combining UNION and STRUCT for Easy Nybbling of Arduino Data in C/C++
This was a question I encountered recently – how to take a stream of bytes and break them into parts – not just individual bytes, but bits of bytes. In this case, the code was 2 nybbles in a byte … Continue reading
Ardunio Looping Without Delay()
In the Arduino forum I’ve noticed a lot of people wanting to run their programs faster, but using delay() in their code. Briefly, delay() waits a specific time before continuing. It makes for simple code, for example: However, coming from … Continue reading
Further on Arduino Random Numbers…
After my previous article on Random numbers I posted on the Arduino forum looking for similar experiences. One big result of the responses: a second, simpler way to generate the numbers. It’s based on not the change in values, but … Continue reading
Fixing The Randomness ‘Bug’ In randomSeed() For The Arduino
As I played with my Arduino in anticipation of programming Something Really Big Now, I got a surprise – the randomSeed() function didn’t work very well. Of course, notice the quotes around ‘bug’ in the title – the fact is, … Continue reading