Hi all,
I've wrapped my ESP8266FastSSD1331 C++ library for 0.96 inch 16bit color oled, this worked, I can draw, print text, play short videoclips from flash memory etc... from B4R.
This library is very fast, works 8-10 times faster than any other library I've tried, eg Adafruit, Ucgl etc... this because I wrote directly ESP8266 registers and don't used slow digitalWrite command to write on GPIOs.
As results, it is easy to use and very fast, show videoclips from Flash and SD from 24 to 30 FPS with ESP8266 working from 80Mhz to 160Mhz, so fluid video, on my tests I draw a rotating cube wirefreme at 160 FPS working @80Mhz and 280 FPS working @160Mhz, so there is a sort of retina persistence because a very high framerate and uman eyes only see just a small part of these, so I need to add a delay to slow down the speed.
Datasheet on the hand (this required me a lot of work) I've implemented almost all SSD1331 Hardware implementation, and other functions not supported by other libraries, eg. set the 8bit contrast separately for R, G and B channels, set 4 bit oled brightness, draw rectangles with hardware optimization, copy a portion of screen using hardware optimization, not pixel by pixel, but eg. just one command to draw a rectangle.
This library even contain follow classes:
Color565 - this class expose 30 color costants and RGB method that converts 24 bit color (8:8:8) to 16 bit color (5:6:5)
MeterBar - this is a class for horizontal and vertical progress bars
ImageClip - this is a class to draw custom controls animations based on consecutive bitmap images, (eg you can draw a lamp on or off, a servo motor animation etc...)
Almost all methods of wrapper works, but my Oled is declared in the rESP8266FastSSD1331 library as private using (new) operator, but MeterBars and ImageClip classes expected a pointer to Oled, and if I declare my oled istance as public I've compilation error. Can anyone help me to know how to do it?
this is my original library begin methods to initialize that classes, as you see is expected an istance of oled as first argument:
I opened all B4R libraries to figure out how it works, but I cannot ...
I've attached rESP8266FastSSD1331 Library with one working example.
Please help me to figure how pass an istance of a class to other classes inside a same library, in my case I need to pass oled istance... If I solve this and other related I can release a full library on this forums, anyway here I posted all code, but you can see MeterBar and ImageClip classes and all components, but can't Initialize because I've commented a line that is wrong, all others methods of oled works.
Many thanks
I've wrapped my ESP8266FastSSD1331 C++ library for 0.96 inch 16bit color oled, this worked, I can draw, print text, play short videoclips from flash memory etc... from B4R.
This library is very fast, works 8-10 times faster than any other library I've tried, eg Adafruit, Ucgl etc... this because I wrote directly ESP8266 registers and don't used slow digitalWrite command to write on GPIOs.
As results, it is easy to use and very fast, show videoclips from Flash and SD from 24 to 30 FPS with ESP8266 working from 80Mhz to 160Mhz, so fluid video, on my tests I draw a rotating cube wirefreme at 160 FPS working @80Mhz and 280 FPS working @160Mhz, so there is a sort of retina persistence because a very high framerate and uman eyes only see just a small part of these, so I need to add a delay to slow down the speed.
Datasheet on the hand (this required me a lot of work) I've implemented almost all SSD1331 Hardware implementation, and other functions not supported by other libraries, eg. set the 8bit contrast separately for R, G and B channels, set 4 bit oled brightness, draw rectangles with hardware optimization, copy a portion of screen using hardware optimization, not pixel by pixel, but eg. just one command to draw a rectangle.
This library even contain follow classes:
Color565 - this class expose 30 color costants and RGB method that converts 24 bit color (8:8:8) to 16 bit color (5:6:5)
MeterBar - this is a class for horizontal and vertical progress bars
ImageClip - this is a class to draw custom controls animations based on consecutive bitmap images, (eg you can draw a lamp on or off, a servo motor animation etc...)
Almost all methods of wrapper works, but my Oled is declared in the rESP8266FastSSD1331 library as private using (new) operator, but MeterBars and ImageClip classes expected a pointer to Oled, and if I declare my oled istance as public I've compilation error. Can anyone help me to know how to do it?
this is my original library begin methods to initialize that classes, as you see is expected an istance of oled as first argument:
B4X:
void MeterBar::begin(ESP8266_FastSSD1331* tOled, uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t colorClear, uint16_t colorFill, uint16_t colorBorder, uint8_t strokeWidth)
void ImageClip::begin(ESP8266_FastSSD1331* tOled, const String supportType, const String fileName, uint32_t startFrame, uint32_t endFrame, uint8_t x, uint8_t y, uint8_t w, uint8_t h)
I've attached rESP8266FastSSD1331 Library with one working example.
Please help me to figure how pass an istance of a class to other classes inside a same library, in my case I need to pass oled istance... If I solve this and other related I can release a full library on this forums, anyway here I posted all code, but you can see MeterBar and ImageClip classes and all components, but can't Initialize because I've commented a line that is wrong, all others methods of oled works.
Many thanks
Attachments
Last edited: