so i got every other part of the code listed below to be working, but the part that reads myGLCD.fillScr(VGA_RED); returns the error:
'myGLCD' does not name a type
i have no idea what the brand of screen im using is but it has a label saying: 2.6"/2.8" TFT LCD Sheild
i am using Arduino Mega 2560
help?
#include <memorysaver.h>
#include <UTFT.h>
#include <SD.h>
#include <Wire.h>
#include <memorysaver.h>
UTFT myGLCD(0xC505,A2,A1,A3,A4);
//ITDB32S
myGLCD.InitLCD(PORTRAIT);
int ScreenXSize = myGLCD.getDisplayXSize();
int ScreenYSize = myGLCD.getDisplayYSize();
//UTFT setBrightness(8);
myGLCD.fillScr(VGA_RED);
byte HomeButton = 33;
byte HomeButtonPress = 42;
byte Torch = 30;
byte Sound = 24;
byte RedLight = 46;
byte GreenLight = 48;
int Freq = 50;
bool Frequp = true;
void setup() {
// put your setup code here, to run once:
myGLCD.InitLCD(PORTRAIT);
int ScreenXSize = myGLCD.getDisplayXSize();
int ScreenYSize = myGLCD.getDisplayYSize();
myGLCD.setBrightness(8);
myGLCD.fillScr(VGA_RED);
pinMode(HomeButton, OUTPUT);
pinMode(HomeButtonPress, INPUT_PULLUP);
pinMode(Torch, OUTPUT);
pinMode(Sound, OUTPUT);
pinMode(RedLight, OUTPUT);
pinMode(GreenLight, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Frequp){
Freq += 5;
if (Freq > 2699) {
Frequp = false;
}
}
if (Frequp == false) {
Freq -= 5;
if (Freq < 51) {
Frequp = true;
}
}
delay(2.5);
digitalWrite(HomeButton, !(digitalRead(HomeButton)));
if (digitalRead(HomeButtonPress) == 0){
digitalWrite(Torch, HIGH);
tone(Sound, Freq);
} else {
digitalWrite(Torch, LOW);
noTone(Sound);
}
}