Sonntag, 16. April 2017

ADC - Einen analogen Eingang nutzen

ADC Messung in C programmieren

Einzelmessung und Mehrfachmessung mit Mittelwert




// ADC initialisieren
void ADC_Init(void)
{
    unsigned int result;
   
*********************************************************************************
*********************************************************************************  

    ADMUX = (0<<REFS1) | (1<<REFS0);            // AVcc als Referenz benutzen
    // Teiler 128 da wir genau messen möchten
    ADCSRA = (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0);  // Frequenzvorteiler 128
    ADCSRA |= (1<<ADEN);         // ADC aktivieren
    ADCSRA |= (1<<ADSC);                      // Single ADC-Wandlung start
    while (ADCSRA & (1<<ADSC));               // auf Abschluss der Konvertierung warten
   
    // ADCW muss einmal gelesen werden, sonst wird Ergebnis der nächsten Wandlung nicht übernommen.
    result = ADCW;
}

// ADC Einzelmessung
unsigned int ADC_Read(unsigned char channel)
{
    // Kanal waehlen, ohne andere Bits zu beeinflußen
    ADMUX = (ADMUX & ~(0x1F)) | (channel & 0x1F);
    ADCSRA |= (1<<ADSC);            // eine Wandlung "single conversion"
    while (ADCSRA & (1<<ADSC))      // auf Abschluss der Konvertierung warten
    //return ADCW;                  // ADC auslesen und zurückgeben
    return ADCL + (ADCH<<8);
}

// ADC Mehrfachmessung mit Mittelwertbbildung 50ms!
unsigned int ADC_Read_Avg(unsigned char channel, unsigned char average)
{
    unsigned long result = 0;
   
    for (unsigned char i = 0; i < average; ++i)
    {
        result += ADC_Read(channel);
        _delay_ms(50);
    }
   
    return (unsigned int)(result / average);
}


*********************************************************************************
*********************************************************************************

Serielle Ausgabe UART (Ausgabe am PC)

Serielle Ausgabe (UART) in C geschrieben


*********************************************************************************
*********************************************************************************

// Geschwindigkeit der CPU (16MHz)
#define F_CPU 16000000UL

// Baudrate (19200 Baud)
#define BAUD 19200UL

// Baudratenberechnung
#define UBRR_VAL ((F_CPU+BAUD*8) / (BAUD*16)-1)



#include <avr/io.h>
#include <util/delay.h>



// UART-Init ATmega328P
void uart_init(void)
{
    // Baudrate einstellen
    UBRR0H = (unsigned char)(UBRR_VAL>>8);
    UBRR0L = (unsigned char)UBRR_VAL;
   
    // Receiver und Transmitter einschalten
    UCSR0B = (1<<RXEN0)|(1<<TXEN0);
   
    // Frame Format: Asynchron 8N1
    UCSR0C = (1<<UCSZ01)|(1<<UCSZ00);
}

// Charakter schreiben
void uart_putChar(unsigned char c)
{
    // Warten bis Sendepuffer leer ist
    while (!(UCSR0A & (1<<UDRE0)));
   
    // Daten in den Puffer schreiben und senden
    UDR0 = c;
}

// String senden
void uart_putStr(unsigned char *s)
{
    while (*s)
    { 
        // so lange *s != '\0' also ungleich dem "String-Endezeichen(Terminator)"
        uart_putChar(*s);
        s++;
    }
}

*********************************************************************************
*********************************************************************************

HMC5883L Compass mit I2C

Hier ein Beispielcode:


[code]
#include <Wire.h> //I2C Arduino Library

#define addr 0x1E //I2C Address for The HMC5883

void setup(){
 
  Serial.begin(9600);
  Wire.begin();
 
 
  Wire.beginTransmission(addr); //start talking
  Wire.write(0x02); // Set the Register / Das Register auswählen
  Wire.write(0x00); // Tell the HMC5883 to Continuously Measure
  Wire.endTransmission();
 
}


void loop(){
 
  int x,y,z; // Daten der 3 Achsen
  int s; // Status
  char id, id1, id2; // Identification Register A, B, C
 
  //Tell the HMC what regist to begin writing data into
  Wire.beginTransmission(addr);
  Wire.write(0x03); //start with register 3.
  Wire.endTransmission();
 

 // Lesen der 3 Achsen, je 2x 8bit (3x 2 Register)
  Wire.requestFrom(addr, 6); // Anfrage an Gerät (addr) für 6 bytes
  if(6<=Wire.available()){
    x = Wire.read()<<8; //MSB  x
    x |= Wire.read(); //LSB  x
    z = Wire.read()<<8; //MSB  z
    z |= Wire.read(); //LSB z
    y = Wire.read()<<8; //MSB y
    y |= Wire.read(); //LSB y
  }

  // Lesen von Status und IDs
  Wire.beginTransmission(addr);
  Wire.write(0x09); // Starten mit Register 9
  Wire.endTransmission();
  Wire.requestFrom(addr, 4);
  if(4<=Wire.available()){

    s = Wire.read();
    id = Wire.read();
    id1 = Wire.read();
    id2 = Wire.read();

  }
    float heading = atan2(-y, x);
    float declinationAngle = 39.85/1000;
   
    heading += declinationAngle;

    float headingDegrees = heading * RAD_TO_DEG;
    if (headingDegrees < 0) headingDegrees += 360;
  
   delay(100);

 
  // Daten ausgeben
  Serial.println("*****************************");
  Serial.print("Kompass Grad: ");
  Serial.println(headingDegrees);
  Serial.print("X Value: ");
  Serial.println(x);
  Serial.print("Y Value: ");
  Serial.println(y);
  Serial.print("Z Value: ");
  Serial.println(z);
  Serial.println();
  Serial.print("Status: ");
  Serial.println(s, DEC);
  Serial.println();
  Serial.print("ID-A: ");
  Serial.println(id);
  Serial.print("ID-B: ");
  Serial.println(id1);
  Serial.print("ID-C: ");
  Serial.println(id2);
  Serial.println("*****************************");
 
  delay(500);
}
[/code]

RoboCar-UT001 - Auf dem Weg zum Staubsaug-/Rasenmäh-Roboter

Die Komponenten für den Prototypen:
  • China RoboCar Chassis inkl. DC Getriebemotoren 5V mit Encoderrad und 4x AA Batteriefach
  • UltraschallSensor HC-SR04
  • L298N Dual Motor Controller Module 2A
  • Arduino UNO
  • ProtoShield for Arduino UNO
  • 2x Gabellichtschranken
Chassis mit Aufbau
Motoren mit Encoderrad und Batteriehalter 4x AA (6V)


Schaltung für die Gabellichtschranken (blau - GND / orange - +5V / schwarz - GRD / Signal I/O - Dig.PIN 2 und 3)


Was später geändert wird:
  • Der Arduino wird gegen einen ArduinoMicro getauscht
  • Das Batteriefach gegen einen größeren Akku bzw. eine PowerBank
  • Es kommen weitere Kontakt-/Abstandssensoren

Wenn sichergestellt ist, das die Basis so funktioniert wie sie soll, wir das Projekt auf eine entsprechende Mechanik übertragen.

Der Code für den Arduino bis jetzt:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 




// PINs for UltraSonic
#define pingPin 10
#define inPin 8


// PINs for Motor 1 DIR
#define wheel_R_f 6
#define wheel_R_b 7

// PINs for Motor 2 DIR
#define wheel_L_f 12
#define wheel_L_b 13


// PINs for Motor 1 Enable/Speed (PWM)
#define wheel_R_En 5
// PINs for Motor 2 Enable/Speed (PWM)
#define wheel_L_En 11

// Motorspeed
int mspeed = 150;

// Turning circle
int turnAround = 100;

// Current direction
int currentDir = 0;

// Encoder
#define Encoder_R 2
int EncoderCount_R = 0;
#define Encoder_L 3
int EncoderCount_L = 0;



// Setup Serial, Encoder- and MototrPINs
void setup() {

pinMode(wheel_R_f, OUTPUT);
pinMode(wheel_R_b, OUTPUT);
pinMode(wheel_L_f, OUTPUT);
pinMode(wheel_L_b, OUTPUT);
pinMode(wheel_R_En, OUTPUT);
pinMode(wheel_L_En, OUTPUT);


// Setup Encoder
pinMode(Encoder_R,INPUT);
pinMode(Encoder_L,INPUT);
attachInterrupt(0, isr_Encoder_R, CHANGE);
attachInterrupt(1, isr_Encoder_L, CHANGE);
//All Motors STOPmstop();

// Robo goes forward
goforward();
}

void loop()
{

// establish variables for duration of the ping,
// and the distance result in centimeters:
long duration, cm;





// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);


// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(inPin, INPUT);
duration = pulseIn(inPin, HIGH);

// convert the time into cm
cm = microsecondsToCentimeters(duration);

// *******************************************************************************
// If the Ultrasonic Sensor detect an object whith a disstance smaler then 15cm,
// stop than go backward for 150ms, turn around 180°, stop, than go forward again
if (cm < 15)
  {
    mstop();
    gobackward();
    delay(1000);
    gobackwardCL();
  //  delay(2500);
    mstop();
    CountReset();
    goforward();
  }


// Automatically synchronize the speed of the wheels
if (EncoderCount_L < EncoderCount_R)
{
  analogWrite(wheel_R_En, mspeed-20);
  analogWrite(wheel_L_En, mspeed+20);
}

if (EncoderCount_R < EncoderCount_L)
{
  analogWrite(wheel_R_En, mspeed+20);
  analogWrite(wheel_L_En, mspeed-20);
}

delay(100);
}

// *******************************************************************************
long microsecondsToCentimeters(long microseconds)
{

// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}




// Function: All Motors STOP
void mstop ()
{
  digitalWrite(wheel_R_b, LOW);
  digitalWrite(wheel_L_b, LOW);
  digitalWrite(wheel_R_f, LOW);
  digitalWrite(wheel_L_f, LOW);
  analogWrite(wheel_R_En, 0);
  analogWrite(wheel_L_En, 0);

currentDir = 0;

  delay(500);

}




// Function: All Motors go forward
void goforward ()
{
  digitalWrite(wheel_R_f, HIGH);
  digitalWrite(wheel_L_f, HIGH);
  digitalWrite(wheel_R_b, LOW);
  digitalWrite(wheel_L_b, LOW);

currentDir = 1;

  for (int ispeed = 100; ispeed <= mspeed; ispeed=ispeed+2)
  {
    analogWrite(wheel_R_En, ispeed);
    analogWrite(wheel_L_En, ispeed);
    delay(20);
  }
 
}



// Function: All Motors go backward
void gobackward ()
{
  digitalWrite(wheel_R_f, LOW);
  digitalWrite(wheel_L_f, LOW);
  digitalWrite(wheel_R_b, HIGH);
  digitalWrite(wheel_L_b, HIGH);

currentDir = 2;
 
  for (int ispeed = 100; ispeed <= mspeed; ispeed=ispeed+2)
  {
    analogWrite(wheel_R_En, ispeed);
    analogWrite(wheel_L_En, ispeed);
    delay(20);
  }

}




// Function: Go in a backward-circle to the left
void gobackwardCL ()
{
  digitalWrite(wheel_R_f, HIGH);
  digitalWrite(wheel_L_f, LOW);
  digitalWrite(wheel_R_b, LOW);
  digitalWrite(wheel_L_b, HIGH);

currentDir = 3;

CountReset();
 
  for (int ispeed = 100; ispeed <= mspeed; ispeed=ispeed+2)
  {
    analogWrite(wheel_R_En, ispeed);
    analogWrite(wheel_L_En, ispeed);
    delay(20);
  }

do
{
  if (EncoderCount_R >= turnAround)
    analogWrite(wheel_R_En, 0);

  if (EncoderCount_L >= turnAround)
    analogWrite(wheel_L_En, 0);

} while (EncoderCount_R < turnAround && EncoderCount_L < turnAround);

 
}




// Function: Go in a backward-circle to the right
void gobackwardCR ()
{
  digitalWrite(wheel_R_f, LOW);
  digitalWrite(wheel_L_f, HIGH);
  digitalWrite(wheel_R_b, HIGH);
  digitalWrite(wheel_L_b, LOW);

currentDir = 4;

CountReset();
 
  for (int ispeed = 100; ispeed <= mspeed; ispeed=ispeed+2)
  {
    analogWrite(wheel_R_En, ispeed);
    analogWrite(wheel_L_En, ispeed);
    delay(20);
  }

do
{
  if (EncoderCount_R >= turnAround)
    analogWrite(wheel_R_En, 0);

  if (EncoderCount_L >= turnAround)
    analogWrite(wheel_L_En, 0);
 
} while (EncoderCount_R < turnAround && EncoderCount_L < turnAround);
 
}



// Reset the EncoderCounts (left and right)
void CountReset()
{
  EncoderCount_L = 0;
  EncoderCount_R = 0;
}




// ISR - Encoder right
void isr_Encoder_R ()
{
   EncoderCount_R++;
}



// ISR - Encoder left
void isr_Encoder_L ()
{
   EncoderCount_L++;
}





++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Vielen Dank für den Code der den Ultraschallsensor belebt geht an: http://www.robodino.de/2011/12/ultraschall-distanz-sensor-hc-sr04.html

Arduino MEGA - TFT TouchScreen TP28017 - TreiberChip ILI9341

 Tutorial/Beispiel für die Verwendung eines TouchScreen mit einem ARDUINO Mega


Als externes SubMenue für eine CNC Fräse o.ä.


Bezugsquelle z.B.: https://eckstein-shop.de/32-inch-240x320-TFT-LCD-Display-mit-resistiveTouch-panel-fuer-Arduino

Arduino Library / Bibliothek hier gefunden:  MCUFried TFT Display UNO y MEGA libraries.zip
ggf. auch hier - http://www.smokeandwires.co.nz/blog/a-2-4-tft-touchscreen-shield-for-arduino/


Ein Beispiel:
(Eine Push-Button-Oberfläche zum abfragen der digitalen Eingänge (InPort) mit einem PULLUP über Masse geschaltet und schalten der digitalen Ausgänge (OutPort).

[code]
// TFT size is 240x320
// Found * ILI9341 * LCD driver
// ----------------------------------------------
// Befehle Beispiele:

// tft.reset();

// uint16_t identifier = tft.readID();
// tft.begin(identifier);
// tft.setRotation(rotation);     - die Ausrichtung (0-3)
// tft.fillScreen(BLACK);     - farbig füllen (in HEX)
// tft.setCursor(0, 0);       - Curser Position setzen
// tft.setTextColor(WHITE);   - Textfarbe (in HEX)
// tft.setTextSize(1);        - Textgröße
// tft.println("Hello World!");     - Text
// tft.drawLine(x1, y1, x2, y2, color);     - Linie von x,y nach x,y in Farbe (in HEX)
// tft.drawFastHLine(0, y, w, color1);      - horizontale Linie von x,y mit Länge in Farbe (in HEX)
// tft.drawFastVLine(x, 0, h, color2);      - vertikale Linie von x,y mit Länge in Farbe (in HEX)
// cx = tft.width();      - TFT Breite
// cy = tft.height();     - TFT Höhe
// tft.drawRect(cx-i2, cy-i2, i, i, color);     - Rechteck von Ecke x,y zur Ecke x,y in Farbe (in HEX)
// tft.fillRect(cx-i2, cy-i2, i, i, color1);      - gefülltes Rechteck von Ecke x,y zur Ecke x,y in Farbe (in HEX)
// tft.fillCircle(x, y, radius, color);     - gefüllter Kreis Mittelpunkt x,y mit Radius in Farbe (in HEX)
// tft.drawCircle(x, y, radius, color);     - Kreis Mittelpunkt x,y mit Radius in Farbe (in HEX)
// tft.drawTriangle(                        - Dreieck
//      cx    , cy - i, // peak
//      cx - i, cy + i, // bottom left
//      cx + i, cy + i, // bottom right
//      tft.color565(0, 0, i));

// tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,     - gefülltes Dreieck

//      tft.color565(0, i, i));

// tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));     - Rechteck mit runden Ecken

// tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));     - gefülltes Rechteck mit runden Ecken





#include <Adafruit_GFX.h>    // Core graphics library

#include <Adafruit_TFTLCD.h> // Hardware-specific library
#include <TouchScreen.h>

#define LCD_CS A3 // Chip Select goes to Analog 3

#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin


#define YP A3  // must be an analog pin, use "An" notation!

#define XM A2  // must be an analog pin, use "An" notation!
#define YM 9   // can be a digital pin
#define XP 8   // can be a digital pin

#define TS_MINX 180 //150

#define TS_MINY 200  //120
#define TS_MAXX 920 //920
#define TS_MAXY 940 //940

// For better pressure precision, we need to know the resistance

// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 150);

#define  BLACK   0x0000

#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);


#define BOXSIZE 80

#define PENRADIUS 3

#define MINPRESSURE 10

#define MAXPRESSURE 1000

#define BOX_COLORE_ON GREEN

#define BOX_COLORE_OFF RED

#define FRAME_COLORE_ON BLUE

#define FRAME_COLORE_OFF BLACK

#define TEXT_COLORE_ON BLACK

#define TEXT_COLORE_OFF WHITE


// --------------------------------------------

// define Title
// --------------------------------------------
String Title[4][3] = {
  {"AIR","WATER","BRUSH"},
  {"VAC","LIGHT","T3"},
  {"a1","a2","a3"},
  {"b1","b2","b3"}
};


// --------------------------------------------

// define GCode
// --------------------------------------------
String GCode[4][3] = {
  {"M8","M7","M9"},
  {"T1","T2","T3"},
  {"a1","a2","a3"},
  {"b1","b2","b3"}
};


// --------------------------------------------

// define uTitle
// --------------------------------------------
String uTitle[4][3] = {
  {"ON/OFF","ON/OFF","ON/OFF"},
  {"ON/OFF","ON/OFF","ON/OFF"},
  {"ON/OFF","ON/OFF","ON/OFF"},
  {"ON/OFF","ON/OFF","ON/OFF"}
};


// --------------------------------------------

// define default Status 
// --------------------------------------------
boolean Status[4][3] = {
  {0,0,0},
  {0,0,0},
  {0,0,0},
  {0,0,0}
};


// --------------------------------------------

// define default InPutStatus 
// --------------------------------------------
boolean inputStatus[4][3] = {
  {1,1,1},
  {1,1,1},
  {1,1,1},
  {1,1,1}
};




// --------------------------------------------

// define In Port 
// --------------------------------------------
int inPort[4][3] = {
  {52,50,48},
  {46,44,42},
  {40,38,36},
  {34,32,30}
};


// --------------------------------------------

// define Out Port 
// --------------------------------------------
int outPort[4][3] = {
  {53,51,49},
  {47,45,43},
  {41,39,37},
  {35,33,31}
};




void setup() {


  //Temp 5V Ausgang:

//  pinMode(22, OUTPUT);
//  digitalWrite(22, 1);

uint16_t identifier = tft.readID();


Serial.begin(9600);


  tft.reset();


  tft.begin(identifier);


  tft.setRotation(3);

InitScreen();


// Init PINs

pinMode(13, OUTPUT);


}






//--------------------------------------------

// MAIN
//--------------------------------------------
void loop() {

  digitalWrite(13, HIGH);

  TSPoint p = ts.getPoint();
  digitalWrite(13, LOW);

  // if sharing pins, you'll need to fix the directions of the touchscreen pins

  //pinMode(XP, OUTPUT);
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);
  //pinMode(YM, OUTPUT);

  inWatcher();

    
    if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {

      int Box_y;

      int Box_x;

        // scale from 0->1023 to tft.width

        p.x = tft.height()-(map(p.x, TS_MINX, TS_MAXX, tft.height(), 0));
        p.y = tft.width()-(map(p.y, TS_MINY, TS_MAXY, tft.width(), 0));

        Box_x = xBox(p.x);

        Box_y = yBox(p.y);
      
      pushButton(Box_x,Box_y);
    }

}




int xBox(int p_x){


  int box;


        if (p_x < BOXSIZE*1) {

        box = 0;
      }


     else if (p_x < BOXSIZE*2) {

        box = 1;
      }


     else if (p_x < BOXSIZE*3) {

        box = 2;
      }

  return box;

  
}



int yBox(int p_y) {

  
  int box;

  if (p_y < BOXSIZE*1) {

    box = 3; }
  else if (p_y < BOXSIZE*2) {
    box = 2; }
  else if (p_y < BOXSIZE*3) {
    box = 1; }
  else if (p_y < BOXSIZE*4) {
    box = 0; }

// DEBUG

//  Serial.print("P_Y = "); Serial.println(p_y);
//  Serial.print("box = "); Serial.println(box);
//  Serial.print("BOXSIZE = "); Serial.println(BOXSIZE);

  return box;

}



void pushButton(int x, int y) {


switchOutput(y, x, !Status[y][x]);


    delay(500);

  
}



void InitScreen() {

  // --------------------------------------------
// InitScreen
// --------------------------------------------


tft.fillScreen(BLACK);

  
  for (int y=0; y<4; y++)
  {
    for (int x=0; x<3; x++)
    {

    pinMode(inPort[y][x], INPUT_PULLUP);

    pinMode(outPort[y][x], OUTPUT);

    inputStatus[y][x] = digitalRead(inPort[y][x]);

    switchOutput(y, x, !inputStatus[y][x]);

    }

  }
}




void inWatcher(){


  for (int y=0; y<4; y++)

  {
    for (int x=0; x<3; x++)
    {
      boolean watchStatus;
      watchStatus = digitalRead(inPort[y][x]);
      
      if (!(watchStatus == inputStatus[y][x])) {
        
        inputStatus[y][x] = !inputStatus[y][x];

        switchOutput(y, x, !inputStatus[y][x]);


      }

    }
  }

}




void switchOutput(int y, int x, boolean on) {


  digitalWrite(outPort[y][x], on);

  Status[y][x] = on;

          if (on == 0)

            tft.fillRect(BOXSIZE*y, BOXSIZE*x, BOXSIZE, BOXSIZE, BOX_COLORE_OFF), tft.setTextColor(TEXT_COLORE_OFF);
          else if (on == 1)
            tft.fillRect(BOXSIZE*y, BOXSIZE*x, BOXSIZE, BOXSIZE, BOX_COLORE_ON), tft.setTextColor(TEXT_COLORE_ON);

          if (inputStatus[y][x] == 0)

            tft.drawRect(BOXSIZE*y, BOXSIZE*x, BOXSIZE, BOXSIZE, FRAME_COLORE_ON);
          else if (inputStatus[y][x] == 1)
            tft.drawRect(BOXSIZE*y, BOXSIZE*x, BOXSIZE, BOXSIZE, FRAME_COLORE_OFF);

          tft.setCursor(BOXSIZE*y+5, BOXSIZE*x+10);

          tft.setTextSize(2);
          tft.println(Title[y][x]);
          tft.setCursor(BOXSIZE*y+5, BOXSIZE*x+35);
          tft.println(GCode[y][x]);
          tft.setCursor(BOXSIZE*y+5, BOXSIZE*x+60);
          tft.setTextSize(1);
          tft.println(uTitle[y][x]);
}



[/code]