Ported Adafruit_ST7735 library

sorry OP = original post

1 Like

@avidan, got it! I’ll take a look at the library and from what I understand from @mhwlng, it will be straight forward to integrate with my mfGFX library. Stay tuned :wink:

well then tuned i am.

1 Like

@avidan, I posted the Adafruit_ST7735 that @mhwlng had ported and adapted it for the multifont mfGFX library here on my github. I was able to compile it with Spark CLI but could not test it. Note that this is a hardware SPI implementation ONLY (unless someone requests a software SPI version). Let me know how it goes :smile:

you are a rockstar. im downloading it on a plane, will try to compile locally. if only gogo wireless worked with the spark core…

2 Likes

@peekay123

As far as I can see, you added your multi-font functionality to my port and changed the SPARK define into SPARK_CORE ?
I don’t see any other changes ?

I used SPARK and not SPARK_CORE because of this :

and I temporarily added a :

#define SPARK 1

to be removed when the web ide is updated with the latest firmware.

I can’t find any definition of SPARK_CORE in the current firmware on github ?

@peekay123

One thought on the multi-font support. It might be nice to have things like #if CENTURY_8 round each font definition so that it is easy to include / exclude fonts from a build if one is trying to preserve space. One can then just flip the signs of the fonts to exclude in the header. The font number is unsigned so maybe make the test !=255 for unwanted fonts.

I think also the TEST font definition currently should be for a 20-7F character set rather than 00-FF as shown.

@mhwlng, the SPARK_CORE definition is in application.h. However, I now realize that my changes were due to force of habit more than anything! I’ll revert back to your version which is in line with the upcoming changes :smile:

@bobtidey, good suggestions. I have not released the mfGFX library “officially” and this exactly the kind of feedback I appreciate. Thanks!

UPDATE: I’ve made the changes as requested and updated the repo. Please let me know the results of any tests you do. :smile:

@peekay123

I switched to your code.

the lower case characters on CENTURY_8 are one byte off.

tft.setFont(CENTURY_8);
tft.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");     

instead of ‘Lorem’ I see ‘Lpsfn’

The rest of the fonts look fine, Thanks…

I was puzzled by that font as well. And then I found it was the only one where the characters were commented. But the \ at the end of the line splices the next line and so effectively comments it out. I removed the \ and all was fine.

@bobtidey Yes, that fixes the problem. Thanks…

@bobtidey and @mhwlng, in my haste I neglected to remove the comment lines on the Century font, which as you surmised, cause a compilation SNAFU! Thanks for catching that Bob!

I updated the repo with the fix. :smile:

@avidan, did the library work for you?

Didn’t get a chance to try (been traveling)
Is there a good method you’d recommend for testing? Via the Web ide or a local compile and update via curl?

1 Like

@avidan, I use the Spark CLI for almost everything since I can just put everything in a single folder and compile the folder. :smile:

can you give me a 3 step compile example?

1 Like

@avidan, assuming you have Spark CLI installed? If so, copy the files from the repo to a directory called Adafruit_ST7735. Then, from outside the folder (one folder level up in other words) compile using:

spark cloud compile Adafruit_ST7735

Assuming no errors, the cloud will return a firmware_xxxx.bin file (xxx is some number). You can then flash that to your core using:

spark cloud flash *core_name* firmware_xxxx.bin

or if your connected by USB, put the Core in DFU mode (hold MODE button and flick RESET until LED blink yellow and release MODE). Then you can flash using:

spark flash --usb firmware_xxxx.bin

Is that what you were looking for?

2 Likes

yes, thats the perfect three step tutorial!

when i try to compile, i get this:

attempting to compile firmware
pushing file: ST7735/.git
.....a bunch of other file pushes......
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: EISDIR, read

i removed the .git from the folder, and it worked like a dream!

saved firmware to /Users/avidan/Development/firmware_1403412669095.bin
Compiled firmware downloaded.

so now I just need to send it to my core (which is at home and not powered :frowning: )

thanks for the help! did i ever mention that you rock?

3 Likes

works like a charm! i am now looking at a screen that says

@peekay123 rocks

3 Likes

Is this using the following wiring?

GND —> GND
VCC —> +5V
NC
NC
NC
RESET —> RST
TFT A0 —> D0
TFT SDA —> A5
TFT SCK —> A3
TFT CS —> A2
SD SCK --> A3
SD MISO --> A4
SD MOSI --> A5
SD CS --> D1
LED+ —> 3.3V
LED- —> GND

thanks @avidan