Trouble changing clock format from 24 hour to 12 hour

This page summarizes the projects mentioned and recommended in the original post on /r/arduino

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • WiFiManager

    ESP8266 WiFi Connection manager with web captive portal

  • #include "WiFiManager.h" //https://github.com/tzapu/WiFiManager WiFi Configuration Magic #include "ezTime.h" // Time Library - get your POSIX Timezone 'string' to replace TZ/GMT if needed, below, here: https://support.cyberdata.net/index.php?/Knowledgebase/Article/View/438/10/posix-timezone-strings #include "SevenSegmentExtended.h" #include "SevenSegmentTM1637.h" #include "SevenSegmentFun.h" // For Text readouts #include "SoftwareSerial.h" #include "DFMiniMp3.h" //========================USEFUL VARIABLES============================= const char* ssid = "R2D2"; // R2D2 Access point network name (to connect to R2D2, to change/add your WiFi details) const char* password = "Droidyouarelookingfor"; // R2D2 Access point password uint16_t notification_volume = 25; // Speaker volume int Display_backlight = 45; // 4 Digit Display brightness when operating normally (outside of initialisation) int BlueLED_brightness = 50; // Two blue LED's (when connected to ESP32 pin 14, instead of VCC) const char* ntpServer = "pool.ntp.org"; // Your chosen TimeServer const String timezone_posix_string = "EST5EDT,M3.2.0/2:00:00,M11.1.0/2:00:00"; // Insert your own POSIX Timezone string here. See link above for info. //===================================================================== // Avoid changing below here... // Call WiFi Manager WiFiManager wifiManager; // Call a Timezone Timezone TZ; #define CLK 25 #define DT 26 #define SW 27 #define RED_LED 17 #define WHITE_LED 16 const int BLUE_LED = 14; // 14 corresponds to GPIO14 float counter = 0; int currentStateCLK; int lastStateCLK; String currentDir = ""; unsigned long lastButtonPress = 0; int btnState = 0; // timer int timer_secs = 0; int timer_mins = 0; float inc_red_led = 0; // the number of the Blue LED's pin const int BlueChannel = 1; // setting PWM properties const int freq = 5000; const int resolution = 8; class Mp3Notify { public: static void PrintlnSourceAction(DfMp3_PlaySources source, const char* action) { if (source & DfMp3_PlaySources_Sd) { Serial.print("SD Card, "); } if (source & DfMp3_PlaySources_Usb) { Serial.print("USB Disk, "); } if (source & DfMp3_PlaySources_Flash) { Serial.print("Flash, "); } Serial.println(action); } static void OnError(uint16_t errorCode) { // see DfMp3_Error for code meaning Serial.println(); Serial.print("Com Error "); Serial.println(errorCode); } static void OnPlayFinished(DfMp3_PlaySources source, uint16_t track) { Serial.print("Play finished for #"); Serial.println(track); } static void OnPlaySourceOnline(DfMp3_PlaySources source) { PrintlnSourceAction(source, "online"); } static void OnPlaySourceInserted(DfMp3_PlaySources source) { PrintlnSourceAction(source, "inserted"); } static void OnPlaySourceRemoved(DfMp3_PlaySources source) { PrintlnSourceAction(source, "removed"); } }; SevenSegmentExtended blue1(21, 22); // CLK, DIO SevenSegmentFun words(21, 22); // CLK, DIO SoftwareSerial secondarySerial(18, 19); // TX, RX DFMiniMp3 mp3(secondarySerial); void configModeCallback (WiFiManager *myWiFiManager) { Serial.println("Entered WiFi Manager config mode.."); Serial.println(WiFi.softAPIP()); Serial.println(myWiFiManager->getConfigPortalSSID()); } //flag for saving data bool shouldSaveConfig = false; //callback notifying us of the need to save config void saveConfigCallback () { Serial.println("Should save config"); shouldSaveConfig = true; } void setup() { words.setBacklight(80); words.begin(); words.scrollingText("R2D2 START", 2);

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts