Re: OLED display issues, gLCD_SH1106_I2C1, Arduino Nano
Posted: Wed Nov 15, 2023 5:59 pm
Okay - converted to a component.
To install:
Copy the .fcpx file to a directory (eg c:\Flowcode) - where you wish to store 'custom' components.
In the build tab - customize - locations add this folder to 'Look for components in'
Refresh components (or restart FC)
The component is called glcd_sh1106_i2c_fast (snappy eh) - add this to your project.
Initialise as usual - then 'draw' stuff to the display using Print, DrawRectangle etc as usual - it's only copied to the display when you call Display() (I renamed from CopyData in the above code)
ClearDisplay (if needed) and repeat
I also attach a simple demo program that uses a different font (they work!)
I've made a few compromises - I ignore FG and BG colours - Plot is white, BPlot black. It doesn't handle the display orientation either (though this could be handled entirely in plot / bplot I think)
Nothing gets display in simulation - I hoped base_glcd would handle this - maybe I did something wrong?
The display is hard coded as 128 x 64 (other (smaller) displays maybe available?)
Martin
To install:
Copy the .fcpx file to a directory (eg c:\Flowcode) - where you wish to store 'custom' components.
In the build tab - customize - locations add this folder to 'Look for components in'
Refresh components (or restart FC)
The component is called glcd_sh1106_i2c_fast (snappy eh) - add this to your project.
Initialise as usual - then 'draw' stuff to the display using Print, DrawRectangle etc as usual - it's only copied to the display when you call Display() (I renamed from CopyData in the above code)
ClearDisplay (if needed) and repeat
I also attach a simple demo program that uses a different font (they work!)
I've made a few compromises - I ignore FG and BG colours - Plot is white, BPlot black. It doesn't handle the display orientation either (though this could be handled entirely in plot / bplot I think)
Nothing gets display in simulation - I hoped base_glcd would handle this - maybe I did something wrong?
The display is hard coded as 128 x 64 (other (smaller) displays maybe available?)
Martin