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

How can I be compatible with SSD1301 products? #27

Open
junhyoung91 opened this issue Nov 4, 2023 · 1 comment
Open

How can I be compatible with SSD1301 products? #27

junhyoung91 opened this issue Nov 4, 2023 · 1 comment

Comments

@junhyoung91
Copy link

How can I be compatible with SSD1301 products?
As far as I know, SSD1351 and SSD1301 have only pixel and color differences.
But if you look at the code now, SSD1301 doesn't show anything.
Is there any way?

@alexanderlavrushko
Copy link
Owner

SSD1301 is not supported "out of the box", so the way is to add it yourself, but it's not easy. The biggest problem is that image data is prepared for display of size 128x128 and each pixel is 16-bit, so if your display is smaller and has different data representation, you will have to convert that somehow.

  1. Find a library which you will use for sending images to your SSD1301 display
  2. Take a look at files TFT_TTGO.h and TFT_TTGO.cpp - they contain a class TFT_TTGO, which manages display using special library for TTGO module
  3. You will have to implement your own class for managing display (let's call it MySSD1301, but the name is up to you). Similarly to TFT_TTGO class, your new class MySSD1301 will be derived from IDisplay interface, and implement corresponding virtual methods: Init, GetWidth, GetHeight, SendImage, EnterSleepMode
  4. See how TFT_TTGO instance is created in BLEHUDNaviESP32.ino:30 - similarly, you will have to create an instance of your own class MySSD1301, and comment out declarations of OLED_SSD1351_nolib and TFT_TTGO, like this:
//#include "OLED_SSD1351_nolib.h"
//OLED_SSD1351_nolib selectedDisplay;
//constexpr bool ENABLE_VOLTAGE_MEASUREMENT = false;

//#include "TFT_TTGO.h"
//TFT_TTGO selectedDisplay;
//constexpr bool ENABLE_VOLTAGE_MEASUREMENT = true;

#include "MySSD1301.h"
MySSD1301 selectedDisplay;
constexpr bool ENABLE_VOLTAGE_MEASUREMENT = false;

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

No branches or pull requests

2 participants