Advertisement
pleasedontcode

GPSTime rev_112

Nov 20th, 2023
64
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:22:57
  15.     - Source Code generated by: Francesco Alessandro
  16.  
  17. ********* Pleasedontcode.com **********/
  18.  
  19. /********* User code review feedback **********
  20. #### Feedback 1 ####
  21. - complete the code
  22. ********* User code review feedback **********/
  23.  
  24. /****** DEFINITION OF LIBRARIES *****/
  25. #include <Arduino.h>
  26. #include <SoftwareSerial.h>
  27. #include <Wire.h>
  28. #include <MicroNMEA.h>
  29. #include <LiquidCrystal_I2C.h>
  30.  
  31. /****** SYSTEM REQUIREMENT 1 *****/
  32. /* Reads hour, minutes and seconds from GPS */
  33. /* module using MicroNMEA library. Display hours, */
  34. /* minutes and seconds on 6x 7seg LED display. When */
  35. /* mins and secs are 00 00, contact closure for about */
  36. /* 1 sec. */
  37.  
  38. /****** FUNCTION PROTOTYPES *****/
  39. void setup(void);
  40. void loop(void);
  41.  
  42. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  43. const uint8_t contactClosure_PIN_D7 = 7;
  44.  
  45. /***** DEFINITION OF Software Serial *****/
  46. const uint8_t NEO_6M_GPS_module_PIN_SERIAL_TX_A0 = A0;
  47. const uint8_t NEO_6M_GPS_module_PIN_SERIAL_RX_A1 = A1;
  48. SoftwareSerial NEO_6M_GPS_module(NEO_6M_GPS_module_PIN_SERIAL_RX_A1, NEO_6M_GPS_module_PIN_SERIAL_TX_A0);
  49.  
  50. /***** DEFINITION OF I2C PINS *****/
  51. const uint8_t lcd_LCD1602I2C_I2C_SLAVE_ADDRESS = 0x27;
  52.  
  53. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  54. LiquidCrystal_I2C lcd(lcd_LCD1602I2C_I2C_SLAVE_ADDRESS, 16, 2);
  55.  
  56. void setup(void)
  57. {
  58.   // put your setup code here, to run once:
  59.   pinMode(contactClosure_PIN_D7, OUTPUT);
  60.  
  61.   NEO_6M_GPS_module.begin(9600);
  62.   lcd.begin(16, 2);
  63.  
  64.   lcd.setCursor(0, 0);
  65.   lcd.print("GPS Time:");
  66.  
  67.   lcd.setCursor(0, 1);
  68.   lcd.print("00:00:00");
  69. }
  70.  
  71. void loop(void)
  72. {
  73.   // put your main code here, to run repeatedly:
  74.   if (NEO_6M_GPS_module.available())
  75.   {
  76.     char c = NEO_6M_GPS_module.read();
  77.     // Process the received character from GPS module here
  78.   }
  79. }
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement