"Failed to write to i2c port for write" with cpp demos
The Expander Pi is an Analogue, Digital and RTC development Interface for the Raspberry Pi
30/10/2022
Posted by:
jimbobauer
30/10/2022
Posted by:
jimbobauer
31/10/2022
Posted by:
andrew
The Expander Pi library tries to write to the RTC when it initialises the object. As the RTC was locked by the hwclock module this was blocking access to the I2C address and causing the code to fail.
I have updated the Expander Pi library with a new "usertc" parameter in the ExpanderPi function so setting the parameter to false it bypasses the RTC initialisation and allows the code to work correctly. You can download the updated library from our GitHub repository at Expander Pi GitHub Repository
When you create an ExpanderPi object you will need to pass in values for the initialise and usertc parameters. For example,
ExpanderPi expi(true, false);
Hopefully, this will fix the problem you are having and allow you to use the ADC when the hwclock is operational.
31/10/2022
Posted by:
jimbobauer
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.