SPI/I2C OLED display


#15

Thanks @mongrol
I did not find a working axo object in the repository, just some C++ code based on the Adafruit library and empty script2 based objects :thinking: maybe, i wasn't looking at the right places.


Anyway, I have achieved to talk to the SSD1306 and fill its memory 'pages' with bytes.
As I plan to have limited use (text or bargraph or curve), i try to avoid using complete buffering.
I'd like to have a minimal memory and CPU footprint.


I implemented an old Sinclair ZX inspired font I made long ago, with optimised x2 scaling -> ~500 bytes
For my eyes, smaller characters are not practical (0"96 OLED)

I can display 4 lines of 11 characters.


#16

Hmm, I'm sure I found a proper object in there before but now I can't find it. :frowning:


#17

No problem, the SSD1306 is easier to use than i expected (well, that's partly because my characters are aligned on the "pages").
I'll share my little object when it will be decent.

For my personal use, I just need to display chord and note names (parameters for a chord oriented keyboard). With this direct control I won't have to add an Arduino...

At the moment, the object simply have 4 string inlets, one for each line.


#18

Got a 1"3 I2C 128x64 OLED display from Taiwan today.

At first, only the first 8 lines seemed to sort of work (blinked) while the rest of the display was random dots. I browsed the web and it seems that many 128x64 1"3 displays use an almost compatible circuit (SH1106 vs genuine SD1306).
I finally achieved to make it work with slight edits in my code... internet and tech forums are great resources when it comes to this kind of frustrating issues.

Even if it can seem a slight improvement on paper, going from 0.96" to 1.3" greatly improves the readability :smiley:


#19

I've found the 1.3" displays a lot harder to source than the 0.96" ones.
Maybe that's changed, since I last looked.

a|x


#20

I bought it on Amazon. I found some cheaper ones on AliExpress, but i did not dared to order those...


The 0.96" (16 yellow lines 48 blue lines) and the 1.3" (white) OLED displays with x2 font


It's quite difficult to avoid buffering when plotting functions or scope displays, but I got an idea, I'll give it a try...
[EDIT 12/12/17]

Seems to work (the scope curve is steppy because its input is a steppy "SixStepsBLISync oscillator).


I added a second 1"3 OLED display and changed its I2C address so that it can be used with the other one.

I made a "double" object that manages both devices in the same thread (using two separate object did not work).

I uploaded the objects in the tiar/HW library folder along with help patches even if they are in experimental stage.


Axoloti Control still in dev?
#21

Good work!-------

a|x


#22

Don't be afraid of Aliexpress: they are all the same quality. I bought some from Ali and they are all good.


#23

Smashed Transistors,
this looks great. If I want to use your objects, exactly what kinds of displays can i buy, i.e. what features/numbers/names am i looking for (never worked with displays before, there weren't any when i got my soldering license...)?

And: Which pins do you connect them to?

Thanks in advance for your help!


#24

Hi @Captain_Burek,

see https://sebiik.github.io/community.axoloti.com.backup/t/official-pin-out-ports-documentation/202/5

 Axo            Display
 PB8 connects to SCL
 PB9 connects to SDA
 VDD connects to VCC 
 GND connects to GND

I added two 10k pull up resistors from PB8 and PB9 to VDD

I used these displays:

and

https://www.amazon.com/gp/product/B01N2K3BC9

but it should work with other 128x64 OLED displays based on controllers SH1106 or SSD1306


Tiar / SmashedTransistors Contributions
#25

Thanks for the quick response, SmashedTransistors!
Got one OLED working just as planned, 2nd one's in the mail. Much obliged!


#26

Just added my first screen on one of my axo-boxes, and thanks to @SmashedTransistors it all worked first time and is still amazing me :slight_smile: This opens up a whole new world, and one of them is to be able to forget things and have interactive reminders, so cool :slight_smile:

https://www.instagram.com/p/BeSoYP2Bjoh/?taken-by=mtyas


#27

Awesome! What's the performance impact on these, by the way?


#28

I think the performance of the objects, CPU and memory wise is very small, but if you want to use it to show a lot of information, some quite complicated patching needs to be involved, so that may take up a bit.
I will be testing it a bit more this week, but I really don't think it will get in my way CPU wise


#29

Hi @mtyas,

I really like your idea of a "reminder" object !

I'm experimenting with this idea.
I added an object (tiar/string/remind4 see help patch as usual... ).
It is still in development and all inputs are welcome.

It has 4 inputs and one string output that takes 5 character prefix + input value.
The output value and prefix correspond to the latest inlet that changed by more than 1 unit.

This way, the first line of the OLED can be used as a reminder while the rest is in scope mode.


#30

Thanks so much for this, so much better and easier than my solution :

I can even have 16 different labels in the first mode (4 per line).
I quickly looked into your code, will it be simple for me to convert your object to a 8 or 16 input version ? I really like the idea of always having the scope on screen.

Anyway, bravo again for all this, it sure changes the way I look at my axoloti boxes now.

Oh, btw, what kind of characters can this display show ? Is there a caracter map sheet or something ? I'm thinking about doing some old school ascii art using the 4 lines, that I can flash to say thanks when people give me the thumbs up when I'm playing in the street, or other silly things like that. :slight_smile:


#31

Maybe, chainable objects would be more versatile than big objects.
Something like:


The "chainTrig" boolean signals tells the next remind4 in the chain "hey, buddy, i've got something, please take my input and transmit it to your output".

I think it is quite easy to use and versatile.


The character font is in
\objects\tiar\HW\tiar_font5x8.h

I designed it loosely based on the ZX Spectrum font and reduced it to 5x8 so that its RAM footprint is as small as possible.
When it is displayed on the OLED it is scaled by 2 (thus 10x16) and a 1 pixel space is added to separate characters (thus 11x16). I avoided to use double buffering to keep the RAM footprint as small as possible, that's why the code of my OLED objects can be a little tricky and limited.


I think that if you want better graphics the best idea is to use an arduino uno or due with a nice TFT touch screen from Adafruit or Sparkfun (so that you benefit a functional driver code) and communicate with the Axoloti thru midi or serial.


#32

Is it possible to get x + y to visualize lissajous?


#33

Hi, @Cannonball,
Sorry, concerning my OLED object, the answer is no.
The code I made for my I2C OLED objects is quite specific and RAM optimised (no buffering).
Of course, it would be possible to make some more evolved objects but, as i stated above, I think that using an arduino with its existing graphic adafruit libraries is a more interesting solution for more advanced graphics.


#34

Thanks for the info. I also have another question I have an sh1106 with 7 inputs (Gnd-vdd-sdk-sda-res-dc—cs), i tired hooking it up and using it with your object with pb8 to sdk but got nothing. I’m guessing I need the exact pin count as showin in the post?