 #define TS_MINY 120
 #define TS_MAXY 940
 
-int color = WHITE;  //Paint brush color
+int c = WHITE;  //Paint brush color
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); //init TouchScreen port pins
+TouchScreen ts = TouchScreen(A3,A2,A1,A0, 300); //init TouchScreen port pins
 
 void setup()
 {
 
     Tft.init();  //init TFT library
-    pinMode(0,OUTPUT);
     //Draw the pallet
-    Tft.fillRectangle(0,0,30,10,BLACK);
-    Tft.fillRectangle(30,0,30,10,RED);
-    Tft.fillRectangle(60,0,30,10,GREEN);
-    Tft.fillRectangle(90,0,30,10,BLUE);
-    Tft.fillRectangle(120,0,30,10,CYAN);
-    Tft.fillRectangle(150,0,30,10,YELLOW);
-    Tft.fillRectangle(180,0,30,10,WHITE);
-    Tft.fillRectangle(210,0,30,10,GRAY1);
+    setScreen();
 
 }
 

        {
            if(p.x >= 0 && p.x < 30)
            {
                color = BLACK;
            }
            if(p.x >= 30 && p.x < 60)
            {
                color = RED;
                digitalWrite(0,HIGH);
            }
            if(p.x >= 60 && p.x < 90)
            {
                color = GREEN;
            }
            if(p.x >= 90 && p.x < 110)
            {
                color = BLUE;
                digitalWrite(0,LOW);
            }
            if(p.x >= 120 && p.x < 150)
            {
                color = CYAN;
            }
            if(p.x >= 150 && p.x < 180)
            {
                color = YELLOW;
            }
            if(p.x >= 180 && p.x < 210)
            {
                color = WHITE;
            }
            if(p.x >= 210 && p.x < 240)
            {
                color = GRAY1;
            }
        }
        else
        {
            Tft.fillCircle(p.x,p.y,2,color);
        }

    }

}

//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#include <stdint.h>
#include <TouchScreen.h>
#include <TFT_T.h>


#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // mega
