Thats better!
I2C1.setup({scl:B6,sda:B7}); var rtcTime = ''; function time() { I2C1.writeTo(0x68/* I2C slave address*/, 0/* register addr*/); var data = I2C1.readFrom(0x68, 3/* bytes */); var seconds = ("0"+data[0].toString(16)).substr(-2); var minutes = ("0"+data[1].toString(16)).substr(-2); var hours = ("0"+data[2].toString(16)).substr(-2); rtcTime = (hours+":"+minutes+":"+seconds); print(text,data); print(text,rtcTime); return; } setInterval(time, 10000);
@StuntMonkeh started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thats better!