Currently it supports setting and getting the time and date. Getting the temperature, and alarm features might be added when I have the time.
ds3231=require("ds3231")
ds3231.init(3, 4)
-- Get date and time
second, minute, hour, day, date, month, year = ds3231.getTime();
-- Print date and time
print(string.format("Time & Date: %s:%s:%s %s/%s/%s",
hour, minute, second, date, month, year))
-- Don't forget to release it after use
ds3231 = nil
package.loaded["ds3231"]=nil
I've also created a pull request for this to be added to the nodemcu repository: https://github.com/nodemcu/nodemcu-firmware/pull/114
For now you can get the module, documentation, and examples here: https://github.com/tobiebooth/nodemcu-f ... les/ds3231
Thanks!