Program Resource

Resource libraries for programmers and developers

Simple RPM counter using M5StickC

Simple RPM counter using M5StickC

Simple sketch using M5 StickC for counting stepper motor RPM. Sensor using laser and laser detector. Connect laser detector signal to pin 33. Modified from other sketch, there are some unused display related codes.

Power tool for Arduino

Power tool for Arduino

Making some change to specification before release… Disclaimer Products are developed from extension of my hobby, and little amount is hand-made and sold for other hobbyists. Since they are hand-made by me, there may be initial failure, poor quality in soldering, lack of quality in design, etc. Recommended to use for hobby purpose Please read and understand specification of this product, and test before using. I will hold no responsibility for any damage or harm caused by the use of this product. Description Useful tool based on ESP32 for developing ATMega328 microcomputer such as Arduino UNO, Nano. Have following features. Write / fix Bootloader Fuse Check setting Set fuse (bootloader …

Network support for Arduino firmware tool avrdude.exe (Windows version)

Network support for Arduino firmware tool avrdude.exe (Windows version)

When writing sketch to Arduino, avrdude is used. Normally, Aruduino IDE is used for writing and avrdude itself is not directly used, but avrdude.exe is used from command line in case of writing hex file to flash or checking fuse setting. USB / Serial connections are usually used, but avrdude does have support for connection over network. Connect ESP8266 or ESP32 with Arduino via ISCP, and write sketch to ESP which relays command from network. Then connect ESP to network, and tell avrdude to connect over network. Command line sample is as follows. IP address and port number are passed with net parameter. However, at this point (Sept, 2021), avrdude.exe …

Using Infrared-Temperature sensor GY-906 MLX90614

Using Infrared-Temperature sensor GY-906 MLX90614

Recently, I bought cheap infrared temperature sensor, GY-906 from aliexpress, only about $5 including shipping fee. Adafruit MLX90614 library can be used for this module. https://github.com/adafruit/Adafruit-MLX90614-Library Communication via I2C and address is 0x5A. I thought using device is simple as other sensor device; but didn’t work as expected, returning fixed value, 1037.55. After searching through forum, found out that changing I2C frequency to 50000 makes this thing work. I can set frequency at Wire.begin if this is only device I’m using, but once I try to use OLED to show readout, OLED works but sensor stops working again. Finally, I was able to make both OLED and sensor to work …

Font Editor for Paroala Dot Matrix display library

Font Editor for Paroala Dot Matrix display library

Parola is nice library with various animation function to show texts to dot matrix display with MAX7219 controller. There are excel macro and exe based tool to create your own customized fonts included in library. I’ve also created simple font editor which reads font header file and writes out to header file format. For Windows, use at your own risk. Create new from scratch, or start with font file such as included in sample sketch of Parola library. One font data per font file is supported. Name is font name. Comment is saved as comment in header file. Fixed width will create fixed pitch font. Set Auto for width to …

Show QR code on OLED display with Arduino

Show QR code on OLED display with Arduino

There’s QR code library for Arduino released 3 years ago. https://github.com/ricmoo/qrcode/ Well made library, works with less memory of Arduino while supporting QR code versions and error correction levels. You can easily create QR code data with above library and show code to OLED display with u8glib library. Below is sample sketch for showing QR code with “https://programresource.net” text data to OLED display, with inverted B/W on left / right half of screen. Very short and simple sketch which does amazing work.

Show only board / settings you want in Arduino IDE menu

Show only board / settings you want in Arduino IDE menu

Arduino IDE supports huge amount of devices for developing. However, when you install ESP32 and ESP8266 board package, menu list will be horrible. It is annoying when you reselect ESP8266 board and see all Upload Speed, memory size, etc falls back to default. Board information are stored in boards.txt file. You can edit this file to hide items you don’t want to see. Default boards.txt for Arduino is stored under ESP type files are or something similar. File is in text format, and you see line like below. To hide specific board, comment out all line with #, or add line with board id + “.hide = true” option. For …

Use tiny 64×32 dot OELD display with Arduino / ESP

Use tiny 64×32 dot OELD display with Arduino / ESP

There are many 128×64 or 128×32 monochrome OLED display out, and recently, I’ve seen tiny 64×32 dot OLED display sold. However, library such as Adafruit SSD1306 does not support this resolution at this time. Either find library which support tiny display, or make modification to library. I’ve modifed Adafruit SSD1306 library (version 2.2.0) to use with 64×32 OLED display. Modifications are 2 part in Adafruit_SSD1306.cpp file. Around line 549 and 888, add / modify for 64×32 resolution. Since I simply replaced code near line 888, this library won’t be compatible with other resolution. Simple Hello World sample sketch. Below includes sample sketch with modified library. Also, I’ve modified ESP_Adafruit_SSD1306 library …

Show bitmap image on OLED display with Arduino/ESP board (Tool provided)

Show bitmap image on OLED display with Arduino/ESP board (Tool provided)

I2C connection Monochrome OLED display is very handy to use. Easy wiring and various libraries provided, such as Adafruit GFX, u8glib, u8g2lib. Monochrome bitmap can also be displayed. You need to prepare bitmap image and convert to hex data. There are tools you can download, but I couldn’t find one that is easy to use. So, I’ve created easy-to-use tool to convert bmp file to hex data (for Windows). Built with Visual Studio / C++. Use freely, no support, use at your own risk. Simply create bitmap file with MS paintbrush for example, save as 24bit bmp file. Launch tool, drag and drop bmp file to tool. You get hex …

Stand alone ATMEGA328P-AU blotloader writer

Stand alone ATMEGA328P-AU blotloader writer

ATMEGA328P-AU is small chip used in Arduino Nano, and chip can be purchased and used for own projects. When designing circuit board, I don’t want to waste space for pattern just to burn bootloader, which is usually only used once for most of the time. I use kit sold from aitendo store in Japan to burn bootloader (sorry, not shipped overseas). http://www.aitendo.com/product/15799 This kit comes with socket for ATMEGA328P-AU and circuit board and some parts. After building kit, connect with Arduino with bootloader burn sketch, then place chip on socket and burn bootloader to ATMEGA328P-AU chip. Since original sketch output result to serial port, I added OLED display so it …