Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By kolalde
#15402 Yeah, running off 3v3 is the target, as is the soldering iron for that diode.

Interestingly, I had 2.2k pull-ups on my I2C ports, so I thought I'll just remove them, and use the 4.7k off this board. But, before I put the board in, I tried my circuit again, and the I2C .96" SSD1306 OLED worked just fine without the pull ups. Hard to tell, but I think I see them on its board as well. Plug the ZS-042 into the bread board, OLED still works. I'll try to talk to the DS3231 next. Fun.
User avatar
By kolalde
#15408 C.

I started with Lua, been watching the progress, but ran into and got tired of the memory frustrations.

I looked at some code and was about to port, but I'll always take something of a head start, so thanks in advanced. I like the term I've read here, "I'm more of a glue guy". Funny, that said, I've had to dig into a LOT of 'ready' code to make it work for me. It really is part of the fun.

Thanks,
ko
User avatar
By rab
#15411 Agree with the fun being in the playing, it's not like I've actually though of any real uses for this stuff yet! Might work out some fun ways to attach some of this to my real clock project (see the rest of my blog for details).

Anyway, have a look here for the source code:
http://richard.burtons.org/2015/04/23/r ... e-esp8266/

Using it is as simple as:
Code: Select allstatic void ICACHE_FLASH_ATTR GetRTC() {
   struct tm time;
   char buffer[50];
   if (ds3231_getTime(&time)) {
      os_sprintf(buffer, "\r\nTime: %02d:%02d:%02d %s, Date: %s %02d/%02d/%02d.\r\n", time.tm_hour, time.tm_min, time.tm_sec,
         (time.tm_isdst > 0 ? "BST" : "GMT"), DAYS[time.tm_wday], time.tm_mday, time.tm_mon + 1, time.tm_year + 1900);
      uart0_send(buffer);
   }
}


Well, you might want to set the time first, but anyway I'm pretty sure this should be good to go, don't think it relies on any modifications to the SDK or I2C code. It's fairly well documented in the comments so even if you don't want to use it as is you should be able to learn plenty from it.