-dev:
// Inserting File Library
#include <SPI.h>
#include <DMD2.h>
#include <NMEAGPS.h>
#include <fonts/Arial_Black_16.h>
// PICK ONE OF THESE PORT ALTERNATIVES
//
// BEST: connect GPS to pins 0 & 1, since you're not using Serial.
// Requires disconnecting pin 0 to upload new sketch over USB.
#define gpsPort Serial // just an alias for Serial
// 2nd BEST: connect GPS to pins 8 & 9 (on an UNO)
//#include <AltSoftSerial.h>
//AltSoftSerial gpsPort
// 3rd BEST:
//#include <NeoSWSerial.h>
//NeoSWSerial gpsPort(3, 4); // RX, TX
// WORST: SoftwareSerial NOT RECOMMENDED
// Defining Constants
#define Length 2
#define Width 1
// Declaration Variable
SoftDMD dmd(Length, Width); // Length x Width
NMEAGPS gps; // parser
void setup()
{
dmd.setBrightness(255);
dmd.selectFont(Arial_Black_16);
dmd.begin();
dmd.clearScreen();
gpsPort.begin(9600);
}
void loop()
{
if (gps.available( gpsPort )) {
gps_fix fix = gps.read();
if (fix.valid.time) {
// UTC_ind_zone_time
char dmdBuff[10];
sprintf_P( dmdBuff, PSTR("%02d:%02d:%02d"),
fix.dateTime.hours, fix.dateTime.minutes, fix.dateTime.seconds );
dmd.drawString(0,1,dmdBuff);
}
}
}
Your original program uses 12406 bytes of program space and 321 bytes of RAM. The NeoGPS version uses 11584 bytes of program space and 270 bytes of RAM (Optimized. Standard config uses 14106/337). The NeoGPS library also has methods for shifting the GPS date/time into your local timezone. See NMEAtimezone.ino. If you want to try it, NeoGPS is available from the Arduino IDE Library Manager, under the menu **Sketch -> Include Library -> Manage Libraries**. Even if you don't use it, there is lots of information on the Installation and Troubleshooting pages. Be sure to read the section on [choosing a serial port](https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Installing.md#2-choose-a-serial-port). Cheers, /dev
Thank you So Much for your Information. NeoGPS Library and your codes works like a Charm. ![]()
Ouput shows when GPS detect. ![]()
It shows UTC Time Zone. I need to show my time zone UTC+06:00.
Another Thing is About Clock font, I used Arial_Black_16 for Clock but it's not adjusting in Length 02 x Width 01 P10 Dipslay. I need a numeric font or a another font which Height 16 x Width 8. But i couldn't find it for DMD Library. ![]()