Closed piczyro closed 2 years ago
So i try to run this code at esp8266 with ds3231 and i get the random dots at oled screen
`/ https://somtips.com https://youtube.com/somtips /
DS3231 Clock; bool Century=false,h12,pm; char week[7][20] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; char mon[12][4] = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"}; Adafruit_SSD1306 display(-1);
void setup() { Serial.begin(9600); Wire.begin(); delay(3000); display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); display.clearDisplay(); display.display();
}
void loop() { display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(30,0); display.println("Som Tips"); display.print(week[Clock.getDoW()-1]); display.print(" "); display.print(mon[Clock.getMonth(Century)-1]); display.print(" "); display.print(Clock.getDate()); display.print(" 20"); display.println(Clock.getYear()); display.print(" "); display.print(Clock.getHour(h12, pm)); display.print(" : "); display.print(Clock.getMinute()); display.print(" : "); display.print(Clock.getSecond()); display.println(" HRS"); display.print(" Temp: "); display.print(Clock.getTemperature(), 1); display.println(" C"); display.display(); delay(1000);
`
It's about Lua and nodemcu firmware here. So you will have to seek help some other place.
So i try to run this code at esp8266 with ds3231 and i get the random dots at oled screen
`/ https://somtips.com https://youtube.com/somtips /
include
include
include
include
define OLED_ADDR 0x3C
DS3231 Clock; bool Century=false,h12,pm; char week[7][20] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; char mon[12][4] = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"}; Adafruit_SSD1306 display(-1);
void setup() { Serial.begin(9600); Wire.begin(); delay(3000); display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); display.clearDisplay(); display.display();
}
void loop() { display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(30,0); display.println("Som Tips"); display.print(week[Clock.getDoW()-1]); display.print(" "); display.print(mon[Clock.getMonth(Century)-1]); display.print(" "); display.print(Clock.getDate()); display.print(" 20"); display.println(Clock.getYear()); display.print(" "); display.print(Clock.getHour(h12, pm)); display.print(" : "); display.print(Clock.getMinute()); display.print(" : "); display.print(Clock.getSecond()); display.println(" HRS"); display.print(" Temp: "); display.print(Clock.getTemperature(), 1); display.println(" C"); display.display(); delay(1000);
}
`