I am making a GPS Clock with Dot Matrix Display. I am Using Ublox Neo-6m GPS Module. If i use Ublox Neo-6m GPS Module i don't need a RTC DS1307 as far i know. Experts Please help me to making this Code.
I made a Code which is attached below. I am getting a error that 'class TinyGPSPlus' has no member named 'year'.
Experts please see the code and help me to complete the code and also tell me about RTC if i needed that for a GPS clock.
If any expert can make me the full code for DMD with GPS Module and paste it here.
// Menyisipkan File Library
#include <Wire.h>
#include <DMD2.h>
#include <fonts/Arial_Black_16.h>
#include <RTClib.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 4800;
// Mendifinisakan Fungsi
#define bOK A0
#define bUP A1
#define bDOWN A2
#define Panjang 2
#define Lebar 1
// Deklarasi Fungsi
SoftDMD dmd(Panjang, Lebar); // Panjang x Lebar
RTC_DS1307 rtc; // Chip RTC yang digunakan
TinyGPSPlus GPS;
SoftwareSerial ss(RXPin, TXPin);
// Deklarasi Variable
int Tahun ;
int Bulan ;
int Tanggal ;
int Jam ;
int Menit ;
int Detik ;
char dmdBuff[10];
void setup() {
// Setup DMD
dmd.setBrightness(150);
dmd.selectFont(Arial_Black_16);
dmd.begin();
dmd.clearScreen();
rtc.begin();
rtc.adjust(DateTime(GPS.year, GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.second));
// pin Mode yang dugunakan pada Inputan
pinMode(bOK,INPUT_PULLUP);
pinMode(bUP,INPUT_PULLUP);
pinMode(bDOWN,INPUT_PULLUP);
}
void showTime() {
// Program menampilkan Jam
DateTime now = rtc.now();
Jam = now.hour();
Menit = now.minute();
Detik = now.second();
sprintf(dmdBuff,"%2d:%2d:%2d",Jam,Menit,Detik);
dmd.drawString( 1, 1, dmdBuff );
}
void loop() {
showTime();
}
Serial.println(gps.time.value()); // Raw time in HHMMSSCC format (u32)
Serial.println(gps.time.hour()); // Hour (0-23) (u8)
Serial.println(gps.time.minute()); // Minute (0-59) (u8)
Serial.println(gps.time.second()); // Second (0-59) (u8)
Serial.println(gps.time.centisecond()); // 100ths of a second (0-99) (u8)