DS3231 module

Posted on
  • Hello

    here is my version of DS3231 module, compatible with the javascript date object.

    use it if you will ;)
    feedback welcome as well


  • Thanks! That does make a lot more sense!

    I'll have a look at pulling it in - the trick really will be to make sure that changing it won't break people's code if they are already using this module (although it seems unlikely too many people would be using the original as it is :).

  • Thank you!

    Setters are the same but range of variables vary, readDateTime() is different because it returns date object instead of string, new features obviously don't break backward compatibility.

    By the way, how to make minified version on module? is this okay: espruino -m DS3231.js -o DS3231.min.js

  • Thanks - I'll check on how often the module's used :)

    To minify the way I minify the modules, it's best to use the minify.js in https://github.com/espruino/EspruinoDocs­ - https://github.com/espruino/EspruinoDocs­/blob/master/bin/minify.js

    The espruino CLI will minify as if it's uploading direct to Espruino - whereas I guess you want just the module itself. The script wraps the code in (function(){...})() and then sends it to the google closure compiler - which makes a much better job of it than the CLI's esprima minifier.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

DS3231 module

Posted by Avatar for ancienthero @ancienthero