Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/********* Pleasedontcode.com ********** Pleasedontcode thanks you for automatic code generation! Enjoy your code! - Terms and Conditions: You have a non-exclusive, revocable, worldwide, royalty-free license for personal and commercial use. Attribution is optional; modifications are allowed, but you're responsible for code maintenance. We're not liable for any loss or damage. For full terms, please visit pleasedontcode.com/termsandconditions. - Project: GPSTime - Source Code compiled for: Arduino Uno - Source Code created on: 2023-11-20 16:23:35 - Source Code generated by: Francesco Alessandro ********* Pleasedontcode.com **********/ /****** DEFINITION OF LIBRARIES *****/ #include
#include
#include
#include
#include
const uint8_t contactClosure_PIN_D7 = 7; const uint8_t NEO_6M_GPS_module_PIN_SERIAL_TX_A0 = A0; const uint8_t NEO_6M_GPS_module_PIN_SERIAL_RX_A1 = A1; SoftwareSerial NEO_6M_GPS_module(NEO_6M_GPS_module_PIN_SERIAL_RX_A1, NEO_6M_GPS_module_PIN_SERIAL_TX_A0); LiquidCrystal_I2C lcd(0x27, 16, 2); MicroNMEA nmea; void setup(void) { pinMode(contactClosure_PIN_D7, OUTPUT); NEO_6M_GPS_module.begin(9600); lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Initializing..."); delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("GPS Module Ready"); } void loop(void) { if (NEO_6M_GPS_module.available()) { readGPSData(); displayTimeOnLCD(); } } void readGPSData(void) { while (NEO_6M_GPS_module.available()) { char c = NEO_6M_GPS_module.read(); nmea.process(c); } } void displayTimeOnLCD(void) { if (nmea.isValid() && nmea.getHour() && nmea.getMinute() && nmea.getSecond()) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Time: "); lcd.print(nmea.getHour()); lcd.print(":"); lcd.print(nmea.getMinute()); lcd.print(":"); lcd.print(nmea.getSecond()); if (nmea.getHour() == 0 && nmea.getMinute() == 0 && nmea.getSecond() == 0) { digitalWrite(contactClosure_PIN_D7, HIGH); delay(1000); digitalWrite(contactClosure_PIN_D7, LOW); } } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)