Twice RTC drive #1074
Replies: 1 comment 5 replies
-
The example at drivers/peripherals/rtc/showTime shows instantiation of the DS1307 driver as follows: const rtc = new RTC({
clock: {
...device.I2C.default,
io: device.io.SMBus
}
}); The const rtc = new RTC({
clock: {
...device.I2C.default,
io: device.io.SMBus,
address: 0x6F
}
});
FWIW – I cannot say if this is safe. There are differences. But, perhaps if you are only using a subset of features (e.g. get and set time) it will work. Please test carefully to confirm that it is a safe assumption for production. |
Beta Was this translation helpful? Give feedback.
-
Good morning,
in my project I'm using RTC DS1307 and the driver works correctly. Sometimes I wish to replace the DS1307 with MCP79400I. It has the same PINOUT, and the location of the data memory is almost the same.
The only big difference is the address
const DS1307_ADDR = 0x68;
How can I change it dynamically on the DS1307.js file?
I thought something like
in the main.js, but maybe is the wrong way and I can't how to import from DS1307.js
If possible I don't want to duplicate the drive...
How can I do ?
Regards
Beta Was this translation helpful? Give feedback.
All reactions