From 98cb9f6ea425853e922e0051ccc26244d7c84912 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Mon, 8 Jan 2024 14:21:09 +0100 Subject: [PATCH] fix --- CHANGELOG.md | 2 +- README.md | 10 ++++++---- examples/PCF8574_performance/PCF8574_performance.ino | 7 +++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e875bc9..8b8f8e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.4.1] - 2023-09-23 -- Update readme with advanced interrupts insigts +- Update readme with advanced interrupts insights - kudos to ddowling for testing. - add example - fix URL examples diff --git a/README.md b/README.md index 827f63c..f6b379b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ # PCF8574 -Arduino library for PCF8574 - 8 channel I2C IO expander +Arduino library for PCF8574 - 8 channel I2C IO expander. ## Description @@ -53,8 +53,8 @@ or in the write mode at the acknowledge bit after the high-to-low transition of So there are three scenarios how the INT is reset. 1. pins revert to original state (lesser known). -2. read from PCF8574 (well known) -3. write to PCF8574 (well known) +2. read from the device (well known) +3. write to the device (well known) This implies that polling the PCF8574 can miss an INT in scenario 1. (see #48) In practice if you have faster polling than your signals changes this would not @@ -229,7 +229,8 @@ It is advised to use pull-up or pull-down resistors so the lines have a defined #### Must -- keep in sync with PCF8575 +- update documentation. +- keep in sync with PCF8575 (as far as meaningful) #### Should @@ -249,3 +250,4 @@ donate through PayPal or GitHub sponsors. Thank you, + diff --git a/examples/PCF8574_performance/PCF8574_performance.ino b/examples/PCF8574_performance/PCF8574_performance.ino index 2ecbab3..fc5011f 100644 --- a/examples/PCF8574_performance/PCF8574_performance.ino +++ b/examples/PCF8574_performance/PCF8574_performance.ino @@ -12,6 +12,8 @@ PCF8574 PCF(0x38); uint32_t start, stop; +volatile uint8_t x; + void setup() { @@ -27,12 +29,12 @@ void setup() delay(100); // time to flush Serial - for (long clk = 100000; clk < 800000; clk += 100000) + for (long clk = 100000; clk < 800000; clk += 50000) { // setup and measure Wire.setClock(clk); start = micros(); - int x = PCF.read8(); + x = PCF.read8(); stop = micros(); // output results @@ -62,3 +64,4 @@ void loop() // -- END OF FILE -- +