Ported Adafruit HX8357 to Spark

I just finished an initial spark port of the Adafruit HX8357 library over to spark to support their awesome 3.5" 320x480 display (https://www.adafruit.com/product/2050).

I need to clean up some code, and make sure the Arduino support didn’t break with the port before issuing pull requests back to them, but you can find the ported libraries here:

https://github.com/machadolab/Adafruit_HX8357_Library
https://github.com/machadolab/Adafruit-GFX-Library

I was even able to get the bitmap example sketch working using the spark sd-card-library (https://github.com/mumblepins/sd-card-library) with virtually no changes to the spitftbitmap.ino code.

https://dl.dropboxusercontent.com/u/8565761/spark_adafruit_lcd.png

10 Likes

Um, awesome! Looks like I know what I’m ordering from adafruit next! :slight_smile:

Thanks,
David

Awesome!
Have you had any luck with the Touchscreen library?
Also, any plans to contribute this to the community available library set?

I do not have touchscreen working on this particular LCD, but I do for another one based on the ADS7843 chipset.

There are a number of libraries out there (such as UTouch) that try and bitbang the SPI bus and they did not work for me at all. I ended up finding a library that talked true SPI to an ADS7846 and porting it to spark.

As for this Adafruit LCD, I would look at the https://www.adafruit.com/products/1571 board that provides an SPI interface to the touchscreen. Their library (https://github.com/adafruit/Adafruit_STMPE610) uses true SPI, so it should port to spark fairly easily.

1 Like

Oh, and yeah, at some point I would like to put it up as a community library. Might be a little bit before I can focus on that, so if any beats me to it, I won’t mind! :smile:

1 Like

I am having some problems getting the examples to run.
Did you modify them in your github library too?

No, sorry, did not modify the examples. Here is a gist to the bitmap example that works on spark (assuming your IDE/build environment has properly included the various libraries):

All that really changed was the SD_CS define, and the include for the sd card library.

Thanks for your help!
Did you have to import a specific SPI.h library for the core (this is my first time with SPI on the core)

It should be included with application.h, but it wont hurt to have the include in your code too.

Got it working now, it was picky with SPI vs spi apparently.
Thanks for your help!

WIth regards to the touchscreen, I took a quick look at the Adafruit touchscreen library and it looks fairly straightforward to port over. I will let you know how it goes.

Hi everyone!
I am new in this so I don’t have a lot of knowledge using spark and the code to open things from the SD so that’s why I am here asking for help.
Actually, I have to do a project about a Treadmill control with a touchscreen (adafruit HX8357 3.5"). I want to create a cool interface and not only some circles or squares with tft.drawRect… So I wanted to import some images to make it the icons of the interface. For this I was wondering to use a micro SD card, but I can’t initialize the SD transmition. I read some forums like this one and I tried to do exactly what it was coded and wired but I didn’t arrive to do what I wanted to do.

I know I have to put de CS signal of the ScreenTouch in a different pin than the CCS signal, and I did that but it doesn’t work. I conclude that I could only use one of those ( the touchscreen or the sd card), but I know some of you already arrive to get some bitmaps, so could someone help me doing this please?

Thank you in advance,

Paula