Stabilizing Analog Readings Through Software


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;
  0

Categories: Arduino, Quick Tips

Tags: electronics, programming

Arduino File Browser


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!

  0

Categories: Arduino

Tags: development, electronics

Standalone Arduino


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.
  0

Categories: Arduino

Tags: chips, electronics

Radio Shack 3D LED Cube


  0

Categories: Arduino

Tags:

Arduino Liquid Crystal Display


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.
  0

Categories: Arduino

Tags: electronics