Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add I2C display #179

Open
rvdbreemen opened this issue Jan 29, 2023 · 18 comments
Open

Add I2C display #179

rvdbreemen opened this issue Jan 29, 2023 · 18 comments

Comments

@rvdbreemen
Copy link
Owner

Display for basic information on the print using I2C display.
On display : Date/Time, Uptime, IP address, last error? Boiler modulation?

@DaveDavenport
Copy link
Collaborator

image
image

We need to decide what to display.
This can be tested on the branch I made. The code should be isolated enough so others can easily tweak it.

@tjfsteele
Copy link
Collaborator

tjfsteele commented Jan 29, 2023 via email

@DaveDavenport
Copy link
Collaborator

Code is there now for a small 1.3" oled directly to the header.

@tjfsteele
Copy link
Collaborator

tjfsteele commented Jan 29, 2023 via email

@DaveDavenport
Copy link
Collaborator

yes, that is annoying yes.. what is worse.. some have an SSD13xx controller, some an SH1106. They live on the same i2c adress , but behave slightly different.
So you get a distorted display if they don't match.

@tjfsteele
Copy link
Collaborator

tjfsteele commented Jan 29, 2023 via email

@DaveDavenport
Copy link
Collaborator

Not that I know off. In general I found that the 0.96" have the ssd13xx drivers and the 1.3" have the sh1106 ones.
These are compatible: https://www.tinytronics.nl/shop/en/displays/oled/1.3-inch-oled-display-128*64-pixels-white-i2c

@DaveDavenport
Copy link
Collaborator

bar on right is for icons, showing flame/etc. But I need somebody to make the icon.

image

image
image
image

@tjfsteele
Copy link
Collaborator

tjfsteele commented Jan 29, 2023 via email

@DaveDavenport
Copy link
Collaborator

hard to say from the page, it looks like the 0.96" version.

@DaveDavenport
Copy link
Collaborator

#178 if anybody wants to test.

@DaveDavenport
Copy link
Collaborator

image
would probably look like this..

@tjfsteele
Copy link
Collaborator

tjfsteele commented Jan 29, 2023 via email

@rvdbreemen
Copy link
Owner Author

rvdbreemen commented Jan 29, 2023

The icon space is very small, a 'normal' icon is 16x16 or 32x32...

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Jan 29, 2023

10x10 pixels should fit in there. it is 18 pixels wide.
(it can always be enlarged, this was mostly just for testing).

@rvdbreemen
Copy link
Owner Author

rvdbreemen commented Jan 29, 2023

The workflow to create an icon for displays, do the following steps:

  1. Open Gimp (install first: https://www.gimp.org/downloads/)
  2. Find an icon on a site like (flaticon), download it, and open it in Gimp
  3. Selecteer Image-->Mode-->Indexed-->Use black and white (1 bit) palette
  4. Scale to correct size (16x16 of 32x32 etc.)
  5. If the icon needs improvement, after scaling. Then touchup the icon.

Touch up icon:
6. Select the 'perceel brush'
7. Left to the brush (links), select the 1 pixel brush
8. Change the size to the 1 pixel
9. Touch up your icon to your liking

Remove Alpha Transpancy Layer:
10. Remove transparency layer (Layer --> Transpancy --> Remove Alpha Layer)

Exporteer icon to XBM format
11. File --> Export as (CTRL-E)
12. Enter a new name, ending in '.xbm'
13. Open the result in notepad, then you can find:

Code example in xmb format

#define flame_16x16_width 16
#define flame_16x16_height 16
static unsigned char flame_16x16_bits[] = {
   0x80, 0x00, 0x80, 0x00, 0x80, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x03,
   0xe0, 0x0b, 0xf0, 0x0f, 0x70, 0x1f, 0x78, 0x1e, 0x38, 0x1e, 0x38, 0x1c,
   0x18, 0x1c, 0x18, 0x1c, 0x30, 0x0e, 0x20, 0x07 };

Then goto this repo to see how to integrate the icons:
https://github.com/JDJelectronics/u8g2_Android_icons/blob/main/Statusbar_icons_android_U8G2/Statusbar_icons_android_U8G2.ino

Shout out to @JDJelectronics

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Jan 29, 2023

I know how to add icons, I just refuse to pick/draw icons as I always spend tons of time doing this, to then be told its wrong and then suddenly others can pick icons. So apparently I am not good at it and want to avoid the first step.

Find an icon on a site like (flaticon), download it, and open it in Gimp

You need to make sure the license is correct. We also need pixel icons as we have 1 bit colors on small size.

@rvdbreemen
Copy link
Owner Author

I will try to find some this week 😇 Don't worry about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants