Hello everyone My problem is I switched from Arduino Uno to MEGA2560 There is a screenshot on Arduino Uno I cannot take a screenshot on Mega2560 I wonder what kind of changes I need to make in my codes I need your help Thank you
#include <EEPROM.h>
#include <Adafruit_GFX.h> // include Adafruit graphics library
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#define TFT_CS 8 // TFT CS pin is connected to arduino pin 8
#define TFT_RST 9 // TFT RST pin is connected to arduino pin 9
#define TFT_DC 10 // TFT DC pin is connected to arduino pin 10
// initialize ILI9341 TFT library
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
int tempPin = A1; // make variables// thermistor is at A0
int led =5; // led is at pin
float temp; // make a variable called temp
int settemp; // make a variable called temp
int swtu = 7; // switch up is at pin 7
int swtd = 6; // switch down is at pin 6
byte jos = 10;
void setup(void){
pinMode (led,5); // make led or pin13 an output
tft.begin();
Serial.begin(9600);
tft.setRotation(3);
tft.fillScreen(ILI9341_WHITE);
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
}
void loop(void) {
tft.setTextSize(3);
tft.setCursor (21,82);
double temp = ((5.0/1024.0) * analogRead(A1)) * 10; //10mV per degree 0.01V/C. Scalling
tft.print (temp); // Print the current temp in f
Serial.println (temp); // print the temp it the serial monitor
settemp = EEPROM.read(1); // read the settemp on the eeprom
delay (250); // wait for the lcd to refresh every 250 milliseconds
if // if we se the switch up pin reading on 1 or 5 volts
(digitalRead(swtu)== 1 )
{
settemp ++ // add one to the settemp, the settemp is the ideal temperature for you
;
}
else{// other wise do nothing
}
if
(digitalRead (swtd) == 1)
{
(settemp --);
}
else {
}
if (temp > settemp)
{
digitalWrite (led, 1);
}
else
{
digitalWrite (led,0);
}
tft.setCursor (50,200);
tft.print ("Set To ");
tft.print (settemp);
tft.print(".C");
tft.print(" ");
Serial.println(settemp);
EEPROM.write (1,settemp);
delay (250);
}



