You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Thanks!

    It's if you want someone using the module to be able to use that constant. For example:

    rtc = require(...)
    rtc.foo(rtc.C.WHATEVER);
    

    If you don't need them to be able to use it then you can make it private, and when the code is minified the minifier can then take that constant, remove it, and put the numeric value right into the I2C.writeTo statement (which will be faster and will use a bit less memory).

About

Avatar for Gordon @Gordon started