HCuOLED library for SSD1307 & SH1106 based OLED displays

Useful guides, libraries, and example sketches to support our Arduino based products.
ChrisSharp
Posts: 30
Joined: Thu Dec 31, 2020 1:22 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by ChrisSharp » Mon Mar 01, 2021 8:23 am

Happy to make the contribution, your after sales support is excellent, giving a "tiny" thing back is a way of saying thanks.

I like how you have added the character spacing to the font file. A very sensible approach that makes its easy to tweak.

Now, with all the software issues resolved, I need crack on and build a housing for them so they can be installed on my model railway.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by andrew » Tue Mar 02, 2021 10:59 am

Cheers for that. Please feel free to post a picture when it's finished I'd love to see it.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

UtterTrash
Posts: 3
Joined: Fri Mar 19, 2021 6:13 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by UtterTrash » Fri Mar 19, 2021 6:21 pm

Code: Select all

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "WeMos D1 R1, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"





















In file included from C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:46:0:

C:\Users\\Documents\Arduino\libraries\HCuOLED\fonts.h:3117:1: error: cannot convert 'const uint16_t* {aka const short unsigned int*}' to 'const unsigned int*' in initialization

 };

 ^

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp: In static member function 'static void HCuOLED::SetFont(const byte*)':

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:841:19: error: cannot convert 'const unsigned int* const' to 'const uint16_t* {aka const short unsigned int*}' in assignment

   _FontDescriptor = Terminal_8ptFontInfo.Descriptors;

                   ^

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:847:19: error: cannot convert 'const unsigned int* const' to 'const uint16_t* {aka const short unsigned int*}' in assignment

   _FontDescriptor = MedProp_11ptFontInfo.Descriptors;

                   ^

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:853:19: error: cannot convert 'const unsigned int* const' to 'const uint16_t* {aka const short unsigned int*}' in assignment

   _FontDescriptor = LCDLarge_24ptFontInfo.Descriptors;

                   ^

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:859:19: error: cannot convert 'const unsigned int* const' to 'const uint16_t* {aka const short unsigned int*}' in assignment

   _FontDescriptor = sharpsharp_6ptFontInfo.Descriptors;

                   ^

C:\Users\\Documents\Arduino\libraries\HCuOLED\HCuOLED.cpp:865:19: error: cannot convert 'const unsigned int* const' to 'const uint16_t* {aka const short unsigned int*}' in assignment

   _FontDescriptor = sharpsharp_5ptFontInfo.Descriptors;

                   ^

exit status 1

Error compiling for board WeMos D1 R1.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
any idea on what this error is caused by? bit disapointing... ive heard something about the fonts that's causing this?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by andrew » Sat Mar 20, 2021 8:38 am

I've attached an updated version (V0.8) of the library to this post. Unfortunately as it's the weekend I can't test it but hopefully this should fix the problem. Can you give it a try and let me know if it's fixed and I'll add it to the first post.

HCuOLED.zip
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

UtterTrash
Posts: 3
Joined: Fri Mar 19, 2021 6:13 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by UtterTrash » Sun Mar 21, 2021 5:47 pm

hey! great library btw, is there any way of retrieving the state of a pixel? by that i mean if pixel at y:13 x:10 is on/off. thanks! I assume it can be retrieved from the buffer but I don't know how.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by andrew » Mon Mar 22, 2021 9:25 am

Thanks. As it was an simple addition to the library I've attached an updated version (still V0.8) which includes a GetPixel() function.....

Code: Select all

HCuOLED.GetPixel(X, Y);
Get the current state of a pixel where:
X is the x axis coordinate of the pixel
Y is the Y axis coordinate of the pixel

Returns: A boolean value representing the state of the pixel at coordinate X,Y

Again, if you could let me know if it works and I'll get this updated version added to the first post.

HCuOLED.zip
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

UtterTrash
Posts: 3
Joined: Fri Mar 19, 2021 6:13 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by UtterTrash » Mon Mar 22, 2021 3:45 pm

thanks for all the great help! the v8 library works now, i can display on my 0.66" OLED fine and the get pixel function works as well, keep up the good work. :D

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by andrew » Mon Mar 22, 2021 4:11 pm

Thanks again for confirming. I've now added this version to the first post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

ChrisSharp
Posts: 30
Joined: Thu Dec 31, 2020 1:22 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by ChrisSharp » Mon Jan 10, 2022 12:05 pm

Hi,

I'm picking up this project again.

I was hoping to invert a character but I can't get the DrawMode function to invert. It's not a mission critical requirement, just a nice to have, so if the functionality is broken, don't spend time fixing it on my behalf.
tried

Code: Select all

HCuOLED.DrawMode(INVERT);
HCuOLED.Print(4);
HCuOLED.DrawMode(NORMAL);
also tried it around the whole buffer creation to see if it would invert everything, it didn't.

ChrisSharp
Posts: 30
Joined: Thu Dec 31, 2020 1:22 pm

Re: HCuOLED library for SSD1307 & SH1106 based OLED displays

Post by ChrisSharp » Mon Jan 10, 2022 12:08 pm

Also...

How difficult would it be to scroll a line of text? Looking at the library it looks tricky, but do able.

Again, not asking you to provide the code, I'll have a go, but if you think its in the too difficult category then I'll know not to waste effort on it.

cheers

Post Reply

Return to “Arduino”