I’m using the Adafruit_SSD1306 display, and I would like to use a smaller font to view more.
In another project (non Particle) the Adafruit_GFX_Library contains the TomThumb.h file: #include <Fonts/TomThumb.h>
However, this library seems to be missing from Particle libraries ? Are there plans to port it ?
Alternatively, I think I should just be able to include the .h file, but that does seem possible using the webIDE, but seems like thats possible using the Particle workbench at least.
Added mfGFX, and added the .h file, but now get this:
src/TomThumb.h:262:7: error: ‘GFXglyph’ does not name a type
const GFXglyph TomThumbGlyphs[] PROGMEM = {
^
src/TomThumb.h:471:7: error: ‘GFXfont’ does not name a type
const GFXfont TomThumb PROGMEM = {
^
Thanks!
So tried to add the library in the webIDE, but on the name it shows zero (when the regular _GFX library shws 27.3k). Do you need to do something different for custom libraries ?
Heh, threatening to take screenshot seems like it was key! (it just worked now).
I have noticed the spinning before though, so its definitely happening from time to time.
I’ll post a screenshot if it does it again. I’m using Safari.
Chrome (with AdBlockPlus) does not work well with webIDE.
I’m using a fast provider (100/100mbps) and I use google 8.8.8.8 DNS.
Anyway, when using both GFX_RK and SSD_1306 I get errors: #include <Adafruit_GFX_RK.h> #include <Adafruit_SSD1306.h>
lib/Adafruit_SSD1306/Adafruit_GFX.cpp:420:0: multiple definition of “Adafruit_GFX::drawLine(short, short, short, short, unsigned short)”
I can’t uncomment the SSD1306 since that is the display I want to use:
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
The problem is that the older “Adafruit_SSD1306” library embeds a copy of Adafruit GFX within itself, which causes conflicts if you want to use a separate newer copy of Adafruit_GFX.
Thanks!
Compiles now. But now the display is not showing anything…
I’ll do some snooping tomorrow: but this is exactly what happened when I tried using the same display on a MKR1300 board and the latest github (didn’t work).
With your branch, it appears to be doing the same.
I did notice there seemed to be a fair amount of changes from the github version and the (working) version, but at the time I just thought lets just stick to what works but now I would really want to use TomThumb as well
No, thanks for helping.
Just to clarify, before changing to the _RK version this worked:
display.clearDisplay();
display.setCursor(x, 7);
display.print(msgStr); << msgStr is non blank
display.display();
But after the update, nothing is shown.
Like stated I noticed the same behavior on another arduino (using a newer Adafruit_SSD1306) last week but did not look into it more in depth then.
If anyone is using the _RK version, using the SSD1306 device please let me know
So this is how I currently set up the display:
// use hardware SPI #define OLED_DC D3 #define OLED_CS D4 #define OLED_RESET D5
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
The library is for an I2C bus based display. You may be able to adapt it to use SPI by replacing the read and write functions and including an spi.begin();
Looking at the code for the new driver it appears to be able to handle SPI as well,
but the display never light up.
The hardware I have is hard to change to I2C, so not going to do that (you need to resolder some resistors,
take a look at the attached pic)
I think for now I’ll just revert to the old code.
Update: When digging in the .h files the I found the display can do HW scrolling. And it does have a couple of different font sizes. This was good find to show what the display can do: https://lastminuteengineers.com/oled-display-arduino-tutorial/
So in short, I don’t think I need to specify my own font after all. Thanks for all the help!