Advertisement
pleasedontcode

GPSTime rev_111

Nov 20th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: GPSTime
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-11-20 15:18:36
  15.     - Source Code generated by: Francesco Alessandro
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <SoftwareSerial.h>
  21. #include <Wire.h>
  22. #include <MicroNMEA.h>
  23. #include <LiquidCrystal_I2C.h>
  24.  
  25. /****** SYSTEM REQUIREMENT 1 *****/
  26. /* Reads hour, minutes and seconds from GPS */
  27. /* module using MicroNMEA library. Display hours, */
  28. /* minutes and seconds on 6x 7seg LED display. When */
  29. /* mins and secs are 00 00, contact closure for about */
  30. /* 1 sec. */
  31.  
  32. /****** FUNCTION PROTOTYPES *****/
  33. void setup(void);
  34. void loop(void);
  35.  
  36. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  37. const uint8_t contactClosure_PIN_D7 = 7;
  38.  
  39. /***** DEFINITION OF Software Serial *****/
  40. const uint8_t NEO_6M_GPS_module_PIN_SERIAL_TX_A0 = A0;
  41. const uint8_t NEO_6M_GPS_module_PIN_SERIAL_RX_A1 = A1;
  42. SoftwareSerial NEO_6M_GPS_module(NEO_6M_GPS_module_PIN_SERIAL_RX_A1, NEO_6M_GPS_module_PIN_SERIAL_TX_A0);
  43.  
  44. /***** DEFINITION OF I2C PINS *****/
  45. const uint8_t lcd_LCD1602I2C_I2C_SLAVE_ADDRESS = 0x27;
  46.  
  47. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  48. LiquidCrystal_I2C lcd(lcd_LCD1602I2C_I2C_SLAVE_ADDRESS, 16, 2);
  49.  
  50. void setup(void)
  51. {
  52.   // put your setup code here, to run once:
  53.   pinMode(contactClosure_PIN_D7, OUTPUT);
  54.  
  55.   NEO_6M_GPS_module.begin(9600);
  56.   lcd.begin(16, 2);
  57.  
  58.   lcd.setCursor(0, 0);
  59.   lcd.print("GPS Time:");
  60.  
  61.   lcd.setCursor(0, 1);
  62.   lcd.print("00:00:00");
  63. }
  64.  
  65. void loop(void)
  66. {
  67.   // put your main code here, to run repeatedly:
  68.   if (NEO_6M_GPS_module.available())
  69.   {
  70.     char c = NEO_6M_GPS_module.read();
  71.     // Process the received character from GPS module here
  72.   }
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement