带有TFT显示屏的Arduino - 不能使用PImage作为参数

时间:2016-03-29 12:19:21

标签: arduino

我正在开展一个涉及Arduino和TFT显示器的项目。我在cpp中创建了一个类 tft 来初始化tft显示。编译说" tft.h:18时出错:错误:' PImage'尚未宣布"。 它所抱怨的是(在h文件中)

     uint8_t initScreen(TFT TFTscreen, PImage backgroundImage, uint8_t CS_SD, uint8_t CS_LD, uint8_t DC_LD, uint8_t RESET); 

在主程序中,PImage被声明为:

    TFT TFTscreen = TFT(CS_LD, DC_LD, RESET); 
    PImage backgroundImage;      

在tft类中,我有以下声明:

    #include "Arduino.h"
    #include "tft.h"
    #include <TFT.h>
    #include <SPI.h>
    #include <SD.h>

    tftclass::tftclass(){}

    uint8_t tftclass::initScreen(TFT TFTscreen, PImage backgroundImage, uint8_t CS_SD, uint8_t CS_LD, uint8_t DC_LD, uint8_t RESET)

    void tftclass::resetBackground(TFT TFTscreen, PImage backgroundImage)

头文件中的声明如下:

    #ifndef tft_h
    #define tft_h

    #include <TFT.h>
    #include <SPI.h>
    #include <SD.h>

    class tftclass{

    public:
        tftclass();
        uint8_t initScreen(TFT TFTscreen, PImage backgroundImage, uint8_t CS_SD, uint8_t CS_LD, uint8_t DC_LD, uint8_t RESET);
        void resetBackground(TFT TFTscreen, PImage backgroundImage);
    };

    extern tftclass tft;

    #endif  

任何有任何想法的人?

提前致谢。

0 个答案:

没有答案
相关问题