Close

LCD block design challenges: library selection

A project log for Arduino Blocks for MIDI Controllers

A series of typical MIDI-event-oriented *duino shields, accompanied by graphical programming blocks that are MIDI specific.

uri.shaniuri.shani 04/13/2018 at 10:380 Comments

In the last few days I was getting the software components for the first Ardublock I plan on coding. This first block will enable users of the UI shield to plan and execute a simple menu system on the 20x4 LCD, which is part of the RepRapDiscount Smart Controller, and also to navigate said menu with the on-board rotary encoder.

First, let me explain my choice of UI controls. The RepRapDiscount Smart Controller is commonly used in DIY (and commercial) 3D printers, and is quite easy to come by because of this. It also has a nice set of features: it has a 20x4 textual LCD (there's a graphic version as well), has a rotary encoder with button, an SD card, and a buzzer, all of these come on a ready to connect board with two ribbon cables and a breakout to connect the board to an Arduino Mega. This seems to me like a good candidate for the plug-and-play usability I am after in this project. This also served as an inspiration for connecting up sub-boards to make up a MIDI controller.

I am planning on using the "OpenMoCo Libraries for AVR" menu manager lib from DynamicPerception (Github). I've used this in the past, and it seems like it will be modular enough to provide me with the modular block-building ability I need for the Ardublock interface. I forked the OpenMoCo libraries, and will upload a version of the menu manager with a rotary encoder interface shortly (I already have this on my HDD somewhere).

Since I will be using ardublocks, handling of the encoder pin change interrupts will have to be done through SCoop, which I haven't dealt with yet - I checked out several pin change int libraries, and settled on PinChangeInt, but there are already SCoop blocks available, so hopefully block design will be simpler.

When trying out the design and seeing what blocks are already programmed, I accidentally erased the sketch I was working on. I need to find out if there's a way to combine an existing sketch with ardublock code. If there is no way of doing so, and some Arduino fork of Blockly will be a better candidate, I might prefer this route. the whole idea of programming the board in a block-based gui is to make people more familiar with the idea of programming, so giving the users the ability to change manually certain aspects of their program is important to me. If you read this and know if any of the block programming languages offer this ability, please let me know.

I also found two faults in my design of the UI shield. When going through my design before sending it to the fab house I found that I forgot to place the two 4k7 pullup resistors on the I2C lines. I'm using Adafruit's LCD Backpack as one of my reference designs, and also plan on using Adafruit_LiquidCrystal as it's already set up to use Adafruit's own MCP23008 lib. I found out that I changed the LCD pins from 1-7 to 0-6. The resistors were put in place before I sent the designs, but the pins will need to be changed on the next revision.

I also found a port expander library which has both MCP23s08 & MCP23008, but haven't had the time to explore it much yet.

Discussions