#if defined (SPARK)
#include "application.h" // <-- this used to be what's now better called "Particle.h"
#if defined(ARDUINO) && ARDUINO >= 100
// here could follow some of the includes only needed on Arduino
// see bellow
After adding this the other error: expected '=' ' ' ' ' 'asm' or 'attribute' before 'PROGMEM' should be gone too.
Otherwise just add
Does that code work with particle dev? Because when they say pgmspace.h: No such file or directory. Your solution only works when you are using Arduino right? Because the software for Arduino already has those files preinstalled. However, in the Particle dev I don’t have the files installed and don’t know where is it.
Have you actually looked at and read the link I even quoted above?
I can repost the same thing
This solution works when it is an Arduino with __AVR__ declared by including that header and#else by exactly not including it.
You won’t need that since the non-AVR processors don’t have the distinction between accessing pgmspace or normal RAM, so no need for any special treatment.
Since you are not including pgmspace.h you definetly won’t get the no such file error for that not needed file.
Or as said in the linked GitHub page
That depends on the exact shield you’re using?
Got a link?
and on the board you see a silk note TS CS #8 - that’s the SPI chip select for the touch screen.
So you only need one extra pin to control the CS pin on the display to actually talk to the touch controler.
Here yo can find the wiring info for TFT, resistive TouchScreen & SD
Note that the first three pins are always the same (SPI CLK, MOSI, MISO), only the CS pins need to be seperate (and the TFT also wants a D/C pin).
So, there is only a pin difference between touchscreen and display on the TFT touch shield? What is a silk note? What pin do I have to connect to? I’m really sorry if I’m wasting your time. I just don’t understand much because I am new to everything
Hmm, that’s very basic tho’
IO stands for Input/Output and in connectino with the Photon it refers to the pins marked with D0~D7, A0~A5 & DAC, WKP, RX, TX.
These are pins that can be used in code by use off commands like pinMode(), digitalRead(), digitalWrite(), analogRead(), analogWrite() and via specialized interface libraries like SPI, Serial1, Wire - just to name a few.
Generally yes, but with not any background in programming micro controllers that might be a big chunk to chew without a tutor.
Hey ScruffR, do you mind if you rephrase what you said? I don’t understand what you mean. So your saying I shouldn’t have a error? All I know is that my code was made by Arduino Yun but I decided to use a Photon instead to connect with the TFT touch screen. This is the link I use to follow: http://makezine.com/projects/s-m-a-r-t-alarm-clock/ How would you change the code to make it photon possible?
Is there a example code for a TFT touch shield to a Photon Touch screen example code anywhere? All I found was Arduino examples of touchscreen in the TFT touch shield and I don’t know how to change it. I just want to test the code how to see if my wiring is correct from my Photon to my TFT touch shield.
For this the silk print offers some help.
It states that the touch controler is an STMPE610 and searching this very forum for that term brings up these threads. https://community.particle.io/search?q=stmpe610
I guess one of them should contain some useful information
Just wanted to put a note on here for anyone trying to connect the Adafruit 2.8" TFT Resistive Touch Shield to a Photon, through a Particle Shield Shield. I couldn’t get it to work, then figured this out and thought I’d share the knowledge…
The TFT shield is hardwired to use the default hardware SPI pins for Arduino, but on the Shield Shield, these pins actually map to Particle’s SPI1, not SPI (there are two SPI ports on the Particle…I’ve read there is perhaps a third?).
To make it work, you need to change any instance of “SPI.xxxxx” to “SPI1.xxxxx” in the following library:
These occur in 6 places in the Adafruit_ILI9341.cpp file (Line numbers approximate):
Line 38: SPI1.transfer(c);
Line 107: SPI1.begin();
Line 108: SPI1.setClockDivider(SPI_CLOCK_DIV2); //Full speed @18MHz
Line 109: SPI1.setBitOrder(MSBFIRST);
Line 110: SPI1.setDataMode(SPI_MODE0);
Line 405: r = SPI1.transfer(0x00);
This will have your Particle talking to the correct pins of the TFT shield, through the Shield Shield. And of course, if coming from Arduino, you will need to do the other typical porting changes covered in this and other threads.
I am trying to use a tft screen similar to the one talked in this thread but I am not able to use the library in particle web ide. I got a bunch of errors (I thought about copying them here but it is a huge list).
Is the library updated somewhere? Maybe I am getting the wrong version. The one included in web ide says “not ported”. I tried about SPI to SPI1 as the previous message says but I still get errors.
Checking errors, most of them seem to come from BRR and BSRR members which not exists in GPIO_TypeDef
Maybe its useful, my tft screen has these pins: PIN_NO_TEXT, LCD_RST, LCD_CS, LCD_RS, LCD_WR, LCD_RD where PIN_NO_TEXT is the A5 in an arduino UNO board. Which PIN_NO_TEXT I mean a pin without silk name.
I don’t know that display, but I’d try to use the SD_DI, SD_DO, SD_SCK, LCD_CS, since on the LCD side there is no clock pin so I’d deduct (without looking at the datasheet tho’) that LCD_RD, LCD_WR are note actually meant as SPI pins and since most SPI displays with SD card share the SPI pins (apart from CS) that would fit.
That’s not D1/D0 but DI/DO corresepinding to MOSI/MISO
Also looking at the datasheet on the page you linked above this is not an ILI9341 display, so the lib won’t work IMHO and the pinout you got of your friend doesn’t seem to use SPI for communicating with the display either.
Have a look at the datasheet