1.8" TFT shield with joystick and SD card on chipKIT

hdphilip
Posts: 39
Joined: Sat Apr 14, 2012 7:54 am

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by hdphilip » Wed Jan 29, 2014 3:05 am

majenko,

here's the program i'm trying to run.

Code: Select all

#include <DSPI.h>
#include <TFT.h>

//  UNO hardware SPI pins
#define ADA_SCLK 13
#define ADA_MOSI 11
#define ADA_CS  10
#define ADA_DC 	9

DSPI0 spi;
TFTDSPI mySpi(&spi, ADA_CS, ADA_DC);
ST7735 tft = ST7735(&mySpi, ST7735::BlackTab);

//enum COLORS { 	BLACK = 0x0000, BLUE = 0x001F, RED = 0xF800, ORANGE = 0xFA60, GREEN = 0x07E0,
//        CYAN = 0x07FF, MAGENTA = 0xF81F, YELLOW = 0xFFE0, GRAY = 0xCCCC, WHITE = 0xFFFF };

void setup()
  {
      // tft.initializeDevice();  
   }

void loop()
{
	
}

the complier has an error in
libraries\TFT\math.h:12: error 'uint32_7' does not name a type

it's a fresh mpide 20130715

Philip

User avatar
unexpectedly
Posts: 105
Joined: Fri Aug 23, 2013 2:31 am
Location: San Diego
Contact:

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by unexpectedly » Wed Jan 29, 2014 8:33 am

Shouldn't that be uint32_t and not a 7?

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by majenko » Wed Jan 29, 2014 10:40 am

It all works fine for me, in both UECIDE and MPIDE.

Make sure you have the absolute latest version of the library from github - you may have just coincided with a bad push, although there has never been a uint32_7 in Math.h
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

hdphilip
Posts: 39
Joined: Sat Apr 14, 2012 7:54 am

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by hdphilip » Wed Jan 29, 2014 2:41 pm

opps, it was a uint32_t and not a 7?


I'll down load the latest and give it a go, which mpide version are you usuing?

Philip

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by majenko » Wed Jan 29, 2014 5:16 pm

The github version.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

hdphilip
Posts: 39
Joined: Sat Apr 14, 2012 7:54 am

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by hdphilip » Thu Jan 30, 2014 2:13 am

i loaded the newest mpide 20140121 and the github

https://github.com/majenkotech/TFT

at work today, with the samples, still no luck with the examples. here's
the errors when compiling "sprites"
Capture.JPG
Capture.JPG (83.77 KiB) Viewed 1024 times
here's the error output from the code i posted a few posts back, I tried to keep it simple.
Capture2.JPG
Capture2.JPG (25.62 KiB) Viewed 1024 times
Right now, I'm using the chipKIT_ST7735_master and all the same examples work fine. I've also have had good luck with the UTFT libraries too.

i was hoping to use the TFT library, from just looking at the code, it seems like the way to go

philip

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by majenko » Thu Jan 30, 2014 2:51 am

Ah, that Sprites error is me not updating the examples when I have changed the API. Framebuffer data is now stored in a separate object (SRAM is the simplest one), which allows you to use other things besides the internal RAM of the chip for framebuffer storage )like SPI ram chips, for example - the SPIRAM class).

Code: Select all

uint8_t buffer[ST7735::Height * ST7735::Width];
SRAM sram(buffer, ST7735::Height * ST7735::Width);
Framebuffer fb(ST7735::Height, ST7735::Width, &sram);
You create a buffer, link it to the SRAM class, then pass that as a parameter to the framebuffer. It adds an extra layer of complexity, but also a whole load more flexibility.

As for the other errors - I changed the update() function from taking a reference to taking a pointer, so they should be tft.update(&fb) now.

I have just pushed an updated version of Sprites to github.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

hdphilip
Posts: 39
Joined: Sat Apr 14, 2012 7:54 am

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by hdphilip » Fri Jan 31, 2014 1:46 am

hi Matt,

i downloaded the latest on github, still a math.h error
Capture3.JPG
Capture3.JPG (23.98 KiB) Viewed 1015 times
maybe someones else on the forum can run the software.
that way i won't feel like i'm losing my marbles.

Thanks for the help

Philip

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by majenko » Fri Jan 31, 2014 12:21 pm

I'm guessing something on your version (which is getting a little long in the tooth - consider upgrading) isn't including stdint.h.

I've added it to TFT.h on github

Code: Select all

... cut ...
#define RGB(r,g,b) ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)

#include <algorithm>

#include <stdint.h>

// Base classes
#include <TFTCommunicator.h>
#include <DataStore.h>
#include <Color.h>
... cut ...
Try adding it to your copy (or downloading again) and see if it works.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

hdphilip
Posts: 39
Joined: Sat Apr 14, 2012 7:54 am

Re: 1.8" TFT shield with joystick and SD card on chipKIT

Post by hdphilip » Sun Feb 02, 2014 6:07 pm

i just downloaded the latest git hub version, i seen where you added stdint.h in the TFT.h file, with a clean install of mpide. still getting the math.h error.

is the math.h missing anything? is it the same one that's working for you, the same on github?

philip

Post Reply