Hello there im pretty new to arduinos and programing but have been learning a lot lately i have got two bits of code together 1. gets the GPS data from the module that i can see on the serial monitor 2. Puts text on the LCD (Sainsmart 3.2 TFT LCD and shield)
I have a Mega 2560
Heres the link to the screen and shield: http://www.amazon.com/SainSmart-Display-Adjustable-Shield-Arduino/dp/B00J077V06/ref=sr_1_2?s=electronics&ie=UTF8&qid=1396288495&sr=1-2&keywords=sainsmart+3.2+inch+tft+lcd+shield
Heres the GPS code i have so far
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);
}
}
And heres the screen:
// UTFT_ViewFont (C)2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of the included fonts.
//
// This demo was made for modules with a screen resolution
// of 320x240 pixels.
//
// This program requires the UTFT library.
//
#include <UTFT.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
// Uncomment the next line for Arduino Mega
UTFT myGLCD(ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
}
void loop()
{
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print("Lon:", RIGHT, 16);
myGLCD.print("Lat:", LEFT, 16);
myGLCD.print("Time:", RIGHT, 220);
myGLCD.print("Date:", LEFT, 220);
myGLCD.setFont(SmallFont);
myGLCD.setFont(SevenSegNumFont);
myGLCD.print("0", CENTER, 80);
while(1) {};
}
Now i have started trying to put these together.....its not going great lol
first question would be how do i put them both together with one void setup? i manage to combine the setups but then it fails where i have deleted the second void setup
Thats my first question the next will be how to get the values from the GPS and print to the screen
Thanks in advance
