Jump to content


Nathan's Blog



Averaging HC-SR04 ultrasonic distance sensor readings in a non-blocking manner

Posted by Nathan House, in Programming 08 July 2013 · 8,727 views

This is a reply to a facebook post. It would have been difficult to read in facebook's narrow layout, so I'm posting it here.

In order to average three readings from a sensor in a non-blocking manner, you could either have three variables like this:int ultrasonicReading0 = 0;int ultrasonicReading1 = 0;int ultrasonicReading2 = 0;
A variable to store the...


Measuring RPMs with Arduino

Posted by Nathan House, in Programming, Electronics 12 June 2013 · 15,750 views

I was asked whether an Arduino would be capable of measuring a device that is rotating at 100,000 RPM. Assuming that there is 1 interrupt per rotation, that gives us the following:

100k\:rpm = \frac{100k}{60} \frac{rotations}{sec}

Therefore, \frac{60}{100k} \frac{sec}{rotation}

So the period is \frac{60}{100k} sec and the frequency = \frac{1}{\frac{...


Writing an ITOA function

Posted by Nathan House, in Programming 26 August 2011 · 4,964 views
programming
A recent project I worked on was interfacing an accelerometer to a PIC18F4550 and displaying the sensor data on an HD44780 display. When writing my HD44780 framework code(check out the...