Sunday, June 15th 2025
Having trouble getting stable analog readings from a noisy component? There's several ways to resolve this. Either through additional hardware (capacitor) or through software. Recently, I had such case. Thought I would share a quick-tip on how to solved this through software. The solution is pretty easy. Just take multiple readings and average them before returning the result. Take a look at the sample code below. I hope this helps resolve your noise!
// average 4 readings for stable reading
value = (analogRead(curPin) + analogRead(curPin) + analogRead(curPin) + analogRead(curPin)) / 4;
Categories: Arduino, Quick Tips
Tags: electronics, programming
Monday, March 1st 2021
Making more progress on my on-going marco keyboard project. I'm building a programmable macro pad. My overall goal is to be able to load configs from an SD card. Then give the user a way of selecting a config file from a menu on a OLED display. Well we're almost there. This weekend I wrote some code to allow the user to browse the root of an SD card. When the device is booted up, it will scan the directory of the root and load the filenames into an array. The user can cycle through the list to find the file they want to use. When they reach the bottom the list repeats. For a bonus I loaded the keyboard library and when you press a button the contents of the selected file is written out to the keyboard buffer. Even large files seem to work. This is due to the buffering nature of the file IO class. Feel free to download my code from GitHub!
Categories: Arduino
Tags: development, electronics
Monday, March 30th 2015

This is my first attempt at creating a standalone Arduino. This is using just the bare Atmega238PU without the Arduino development board. I was able to pull the flashed chip from the board and use it. Looking forward to branching out further without needing a full standalone projects. Here's a
link to the pin-out I used.
Categories: Arduino
Tags: chips, electronics
Monday, March 9th 2015

I got my Arduino UNO working with a 1602 LCD display (16x2). Just a simple "Hello World" message and a counter for now. This build uses the
LiquidCrystal library from Arduino's website. The library allows you to use any LCD display that is supported by the Hitachi HD44780 driver. The example sketch contained in the library is what I'm using to display "Hello World" with. Thanks Limor Fried at
Pro Trinket. All for now.
Categories: Arduino
Tags: electronics