I hooked up Arduino Pro Mini, an LIS302DL 3 axis accelerometer and Nokia 5110 (PCD8544 based) LCD.
And What did I do with all of this?
A vial level emulation!
Right you are, not a very useful application of such a pile of technology. But so much fun! Besides, It was easier to do it this way rather then trying to melt some sand into a glass vial...
void measure()
{
const float filtercoef = 0.25;
ax = filtercoef*(G/64.0)*float(ACM::X())+(1-filtercoef)*ax;
ay = filtercoef*(G/64.0)*float(ACM::Y())+(1-filtercoef)*ay;
az = filtercoef*(G/64.0)*float(ACM::Z())+(1-filtercoef)*az;
}
This is simple averaging filtering with gain in which previous value and current measurements are combined with some coefitient (here 0.25). So I take 0.25 of current measurement and 0.75 of previously returned value. This is smoothing somewhat the measurements and since I do not need fast reaction time it works a-OK.
On the LCD display - it comes on a small PCB with solder-on connectors with 1mil spacing. Cheap at $10 and only 5 pins to connect (reset,sclk,mosi,sce,d/c). Smallish in display area but I like it much more then the other 2x24 or so char displays.