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

Custom OLED Display Holder


I've been working on a larger project. Which I hope to post on here in the coming weeks. I find that sometimes it best to break projects into smaller pieces. Little milestones make bigger projects flow a lot better. The enclosure for my new project requires a holder for OLED display. I've never modeled anything like this before. So I decided to do a small project out of modeling a holder for it. Here we are now. I present to you my holder for a 128 x 32 OLED display.

I used TinkerCAD to create this model. It's a fairly simple concept with a hidden feature. More about that in a minute. The model consists of two prints, the holder body and bezel. The OLED display I'm using is a 128 x 32 sized display. It uses a I2C connection which requires four pins. Here's where the hidden feature comes in. I wanted to keep the holder a modular as possible. In the sense that the display could be easily pulled out and reused if needed. In order to that I had to come up with a design that kept the OLED display as stock as possible.

On the back of the display I soldered a standard breadboard friendly header. This allows me to plug this directly into a breadboard if I wanted to experiment with it. This got me thinking. What if I could make some sort of socket that allowed me to plug the display in and remove it as needed? Then it hit me. I could use female headers like on a Arudino board. To keep it simple, I used premade female dupont wires. All you have to do is push the four dupont connectors from the back of the holder. I modeled the rectangular hole with a fairly tight tolerance. This forms a friction fit. Then you can install the display from the front. Slide the bezel into the front of the holder and you're done.

If you would like to download and print this model for yourself then click the link below. I'm looking forward to doing more projects like this. Keep an eye on this space!

Thingiverse
  0

Categories: Maker

Tags: 3d-printing, electronics, soldering, thingiverse, tinkercad

Quick Tips - Soldering Header Pins


Soldering header pins on a development boards can be a pain. But it doesn't have to be. Here's a little trick I wish someone had shown me earlier. Simply place the headers on a empty breadboard. Then put your development board on the pins. Carefully solder the first and last end of the pin of the header. If you're using an older breadboard you're not concerned with messing up, go ahead and solder the rest of the pins. If not, remove the the board and finish soldering the header on away from the breadboard. This is so much easier than other methods I've tried to used in the past. I hope this makes your soldering experience a little better. Enjoy!

  0

Categories: Electronics

Tags: soldering

Quick Tips - Piping to Clipboard (Windows)


I came across this neat tip the other day. I needed to capture some text from the command line in Windows. Usually I would just pipe (cmd > filename.txt) the results of whatever command I'm running into a text file. Then I would open the text file afterwards and copy/paste it wherever I needed it. I figured there had to be a more direct way. It turns out, I was correct. Enter "clip.exe" a built in utility that will allow you to pipe command line output directly to your clipboard. So how do you use it? It's really simple. Say for example you need a list of files in a directory. You could run the following and presto it's in your clipboard. Replace dir with whatever command line application you want to capture input from. Run it and copy/paste to your heart's content.

dir | clip

Apparently this has been around in some form or fashion since WIndows 98. It became a regular built in utility in Windows Vista. Not sure why I'm just now finding this out. There are similar tools (xclip) in linux as well. Happy scripting!

  0

Categories: Quick Tips

Tags: command-line

RegBox - Regular Expression Find & Replace Tool


Introduction

I've been using regular expression a lot lately. I like to use it to generate code. I generally use Notepad++ for this operation. However I've found situations where I repeat the same set of operations. I constantly have to re-enter or dropdown to the previous expression. Often forgetting which order the operations need to be ran in. I figured there has to be a better way. So I wrote a quick web app to help with this. I present to you RegBox. A simple tool for chaining regex find and replace operations. Not only will it chain these operations, but it will allow you to export and import operation chains. This app supports JavaScript regular expression flavor.

How To Use It

Cut and paste the text you want to perform regular expression find and replace on in the "Input/Output" box.
Enter the "Match" and "Replace" criteria.
Set which options you may need (gim - g for global, i for case insensitive, m for multiline by default).
Click "Run" to execute and text will change.

Additional Notes

You can add additional operations by clicking the "Add" button. If you need to disable an operation uncheck the checkbox at the end of the operation line. If multiple operations exist the script will run each operation based on the results of the previous operation (chaining). If you wish to run these operations again in the future, you can export a configuration file containing your operation configuration. Just use the "Export Config" button. You can reimport them later. Need the results of your scripts in a file? Just use the "Export Results" button to save to a text file.

Final Thoughts

This tool is provided as is. No warranty. Use at your own risk. I just built this to solve a problem I have. This may not work for you. But I'm happy to share it with you.

Tool
  0

Categories: Development, Programming, Tools

Tags: development, javascript, regular-expression