Hey guys, I’m having trouble with the particle dev and my code. It keeps on telling me that I have 5 errors in my code. Can someone help me solve the issues? I’m new at code and don’t understand much so I need as much help as possible! Thank you!
Errors: ‘YELLOW’ was not declared in this scope
’Tft’ was not declared in this scope
’CYAN’ was not declared in this scope
’RED’ was not declared in this scope
’BLUE’ was not declared in this scope
Code:
// Draw Circles - Demonstrate drawCircle and fillCircle APIs
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <stdint.h>
#ifdef __AVR__
#include <TouchScreen.h>
#else
/* this block is not required anymore
* #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
* #define pgm_read_byte_near(addr) (*(const unsigned char *)(addr))
* #define pgm_read_word(addr) (*(const unsigned short *)(addr))
* #define pgm_read_word_near(addr) (*(const unsigned short *)(addr))
*/
#endif
#ifdef __AVR__
#include <TFTShield.h>
#else
/* this block is not required anymore
* #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
* #define pgm_read_byte_near(addr) (*(const unsigned char *)(addr))
* #define pgm_read_word(addr) (*(const unsigned short *)(addr))
* #define pgm_read_word_near(addr) (*(const unsigned short *)(addr))
*/
#endif
#ifdef SEEEDUINO
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A1 // must be an analog pin, use "An" notation!
#define YM 14 // can be a digital pin, this is A0
#define XP 17 // can be a digital pin, this is A3
#endif
#ifdef MEGA
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A1 // must be an analog pin, use "An" notation!
#define YM 54 // can be a digital pin, this is A0
#define XP 57 // can be a digital pin, this is A3
#endif
void setup()
{
Tft.init(); //init TFT library
/* Demo of
void drawCircle(int poX, int poY, int r,unsigned int color) and
void fillCircle(int poX, int poY, int r,unsigned int color);
*/
Tft.drawCircle(100, 100, 30,YELLOW);
Tft.drawCircle(100, 200, 40,CYAN);
Tft.fillCircle(200, 100, 30,RED);
Tft.fillCircle(200, 200, 30,BLUE);
}
void loop()
{
}