Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* 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: GPS Display
- - Source Code NOT compiled for: ESP32 DevKit V1
- - Source Code created on: 2024-05-12 07:55:23
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* I want the North South and East West GPS */
- /* coordinates to appear on the display in addition */
- /* to the time, the module is a lilygo TTGO. */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Wire.h>
- #include <Adafruit_SSD1306.h> //https://github.com/stblassitude/Adafruit_SSD1306_Wemos_OLED.git
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /***** DEFINITION OF I2C PINS *****/
- const uint8_t GPS_SSD1306OledDisplay_I2C_PIN_SDA_D21 = 21;
- const uint8_t GPS_SSD1306OledDisplay_I2C_PIN_SCL_D22 = 22;
- const uint8_t GPS_SSD1306OledDisplay_I2C_SLAVE_ADDRESS = 60;
- /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
- Adafruit_SSD1306 display(/*DC*/ 4, /*RST*/ -1, /*CS*/ -1); // Assuming reset pin is not connected
- void setup(void)
- {
- // put your setup code here, to run once:
- display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Initialize with I2C address 0x3C
- display.display();
- delay(2000);
- display.clearDisplay();
- display.drawPixel(10, 10, WHITE);
- display.display();
- delay(2000);
- // Add your additional setup code here
- // Display GPS coordinates and time on the OLED
- display.clearDisplay();
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0, 0);
- display.println("GPS Coordinates:");
- display.setTextSize(2);
- display.setCursor(0, 10);
- display.println("N: 00.0000");
- display.setCursor(0, 30);
- display.println("E: 00.0000");
- display.setTextSize(1);
- display.setCursor(0, 50);
- display.println("Time: 12:00 PM");
- display.display();
- delay(5000);
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement