PicoDev Display - Coding the display

Hello everyone,
I am in the process of programming a picodev display
I am wondering how I can programme it to display a ‘tick’ and a ‘cross’?
I ask because it is different to the dot matrix display I was using

Thanks :slight_smile:

2 Likes

HI @R_DJ
What language are you using?

Thanks for the response @Pixmusix

I am using the ardunio IDE to programme

So you are likely using the Adafruit GFX graphics library.

You can edit your font file to replace any unused characters with the tick and the cross. See:
tchapi.github.io/Adafruit-GFX-Font-Customiser/

Using C++?
No worries.

This is the library you need.

Have a look at the testDrawLine() function in this example.

Does that help put you on the right track?
Pix :heavy_heart_exclamation:

Hey @R_DJ,

I would say your best bet is to use a couple PBM (Portable Bitmap) images. You can actually upload these types of images to your Micropython controller, and use the load_pbm() logic to show the image.

I started by downloading a simple PNG of a checkmark, then resized it to 128x64 (the resolution of the OLED display), and used an online PNG-to-PBM conversion tool. Simply upload the PBM to whatever Micropython device you are using, and see the code below. This is probably the easiest way to show custom symbols on the screen without having to meticulously draw out the lines and fill custom pixels.

Here is an example of the code I used:

from PiicoDev_SSD1306 import *
display = create_PiicoDev_SSD1306()

display.load_pbm('tick.pbm', 1) # or display.load_pbm('x.pbm', 1)
display.show()

Also make sure to upload the PiicoDev_SSD1306.py module, and have this module, the bitmap image, and the main script above on the same file level.

I would also recommend the Thonny editor for coding Piicodev modules because of the suitable UI for visualising and uploading files on your local computer and microcontroller at the same time, but that is just a matter of personal preference.

Hope this helps!
Ezra

2 Likes

Thanks @Pixmusix,

I am using C++ with that lib

I am just confused on how I can create the different shapes/diagrams.

Cause its seems different to the way the I learnt with the dot matrix lib

Thanks again :slight_smile:

Hi @Ezra224017,

I use the ardunio IDE cause I find it easier to use but I do look at micro python as a guide for the pico

I use the ardunio IDE cause my computer and micro python don’t work together and so arudnio die is a solution to this problem but thank you for your input

R_DJ :slight_smile:

Hi @Jeff105671,

thanks for the response

I am using the Ardunio Lib SSD1306

Do you mean this one (there are several)?

The font editor recommended for that library is at

However I suspect that all the font formats are the same.

Hang on, isn’t crosses and ticks just lines?
Surely this is the way. Someone’s done it for you.

It depends. If the tick or cross needs to be sized differently to standard text, or if it needs to be colored, then a graphic can be useful. But if it occurs often, or is the same size, color and alignment as existing text, then modifying the font is by far the simpler approach. An example is the degree symbol - it’s just a circle. But the way it’s used means that it should be a glyph.

1 Like

Good thoughts @Jeff105671

Hi all,
I have been playing around with the lib (ssd1306) and I think I might have got it to work.
I’ll let you all know if it doesn’t but atm it seems happy

– R_DJ :slight_smile:

3 Likes

*Update so I am using a PiicoDev Cable 200mm which has a SH connector. I am unsure how to define the digital ports since it does not have a definitive port

I am happy to supply the excerpt of code if needed :slight_smile:

2 Likes

Hey @R_DJ,

The standard for PiicoDev connectors are:
Black- Ground (Gnd)
Red- Power (+3.3v)
Blue - SDA
Yellow - SCL
It looks like this is true for the display as well.

Black to ground and Red to power should be straightforward. The SDA and SCL wires are specific to the protocol this device uses which is I2C. These wires need to connect to dedicated pins on your microcontroller. This will be controller specific but should be pretty easy to find by looking up “microcontroller_name pinout”.

For example for an Arduino Uno I looked up “Arduino Uno Pinout” and got this


which shows that Analog pins A4 and A5 can be used for this purpose (Marked in grey, bottom left).

Hopefully this helps.
Sam

Hi @Samuel,

So the picodev display which uses the cord I mentioned earlier, does use any pins like an ardunio. My issue is I don’t know how to tell the code that because it states:

#define OLED_MOSI 9
#define OLED_CLK 10
#define OLED_DC 11
#define OLED_CS 12
#define OLED_RESET 13

But since there is no port because the cable goes into a port how do I define?

Happy to send image if it helps

1 Like

Hey @R_DJ,

Photos would be great, specifically the labelling on the places your cables are connected into.

Really the more information you can provide about your hardware setup the better.

My suspicion from that code is you are using a code example that is attempting to use SPI communication which would try to communicate over wires named as:
CLK (Clock), DC (Data/Command), CS (Chip Select) and RESET
Instead of I2C which would look more like:
3.3v (Power), GND (Ground), SDA (data line) and SCL (clock line)

May be worth looking around for a code example that uses I2C specifically.

@Samuel so this the cable (sorry if photography is not the best), I don’t know how I can define the ports like MISO

update so I have found an example using I2C would that what I would want due to this cable connection to the pi?