I have previously used the SainSmart 3.2in TFT LCD screen with an Arduino Mega through a shield but I’m having trouble porting the UTFT and ITDB02_Touch libraries for use with the Photon. Any suggestions?
Can you describe the problems you are having in more detail?
There were minor issues, which i solved, such as replacing
application.h and unneeded #include statements like
avr/pgmspace, but there were other issues like the ‘byte’ and ‘word’ types, and functions only available on Arduino such as
Try compiling with 0.6.1-rc.1 which introduces much more Arduino support by default.
How would I do that? (I’m using Particle Dev)
There is no version targeting in the Local IDE yet, it just targets the latest default firmware as of right now.
You can do this with the CLI though. Just cd into the directory where your firmware is and run this command substituting your device name for my_photon_name.
particle compile photon . --target 0.6.1-rc.1 --saveTo firmware.bin && particle flash my_photon_name firmware.bin
I tried using the CLI to compile targeting 0.6.1-rc.1, but gave the same errors as before.
@fizzysoda, there is hardware dependent arduino code that can’t be uses as-is. Can you post a link to the exact libraries you are trying to port and I’ll take a look. Can you also post a link to the SainSmart display you are using?
@fizzysoda, that display uses a 16-bit data path along with some control lines. Unfortunately, you will not be able to drive this display with a Photon since it doesn’t have enough GPIO pins (nor does the Uno).
Would it be possible if I use a MCP23017 16-bit I2C chip or such?
@fizzysoda, yes, it would be possible though it would slow your display speed down considerably. If speed is not an issue, this is a viable option.
@peekay123, do you know of a way to do this?
@fizzysoda, what are you trying to achieve with the display?
I’m trying to make a touch-enabled interface for a Photon-powered thermostat.
@fizzysoda, you may want to consider an HMI display like the Nextion. HMI displays are intelligent and do most of the display work. If you want a regular “dumb” display, you need to consider an SPI unit.
I second @peekay123’s idea of either using an HMI display or a SPI/I2C display.