Tuesday 7 August 2018

OLED + 4WD Hercules board


Tried hooking up an AdaFruit (clone) OLED  to a 4WD Hercules (incl motor controller) board. Too much used up after compilation. Error message:

Sketch uses 10366 bytes (33%) of program storage space. Maximum is 30720 bytes.
Global variables use 2140 bytes (104%) of dynamic memory, leaving -92 bytes for local variables. Maximum is 2048 bytes.
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
Error compiling for board Arduino Pro or Pro Mini.

Apparently, the OLED display uses lots of memory, 1 KB or RAM according to this website:

https://learn.adafruit.com/memories-of-an-arduino/large-memory-consumers#step-5

(Screencap included)

Now, I need to have some input/output, either:

  1.  Two buttons + small display
  2.  Wireless "terminal"
Hmmm.... so, either:
  1.  Add another Arduino (mini?) with OLED --  data via UART between the two Arduinos; Plus two buttons
  2. Add HC05 BT module -- use mobile phone as terminal.
Pros/cons with option 1:  +++ Small enough to fit into a small breadboard --- Can't locate my Arduino mini at the moment. At home maybe? --- Need to put them all on a protoboard later or they will go "missing".

Pros/cons with option 2: +++ I think I have an HC05 module already +++ quick setup --- Have to have HP later during "running"

UPDATE:

It turned up that there are libraries for the OLED display that uses TEXT ONLY, thus not requiring large RAM -- the screen is not buffered/duplicated for graphics... yeay!!!

Discussion about it here: https://forum.arduino.cc/index.php?topic=335594.0

The library: https://github.com/greiman/SSD1306Ascii. Downloaded this one as a ZIP, extracted into the my Arduino Library folder, removed some of the files (docs), move the filed from the SRC folder out to the main folder.... It worked!!! (see pic).


Another library but works for SPI only:

https://github.com/stanleyseow/ArduinoTracker-MicroAPRS/tree/master/libraries/SSD1306_text. (This one is discussed elsewhere on the net)

Tried this one first, did not notice "SPI" (he he he.... duh!). Of course did not work. But keeping it here for reference. (Hmmm this part is giving weird formatting problem in blogger.com. Oh I know.. the "less than" symbol is mesing things up.. OK fixed.)

Monday 9 July 2018

Revisiting a small OLED that I have lying around for quite some time.

This morning I hooked up a small OLED display module that I found again -- was looking for it a couple of weeks back -- just to refresh my memory how it works.

Well, it did not work ... hahaha.

I don't know what is wrong with it. Thinking of getting a new one. I like that display because it uses I2C inteface. So, saves on many many pins on the Arduino.

Some URLs that will be useful (for me, at least) when setting up this OLED...