{"action":"opened","issue":{"url":"https://api.github.com/repos/skywodd/pcf8574_arduino_library/issues/3","labels_url":"https://api.github.com/repos/skywodd/pcf8574_arduino_library/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/skywodd/pcf8574_arduino_library/issues/3/comments","events_url":"https://api.github.com/repos/skywodd/pcf8574_arduino_library/issues/3/events","html_url":"https://github.com/skywodd/pcf8574_arduino_library/issues/3","id":110703933,"number":3,"title":"Problem with digitalRead() function","user":{"login":"FernandoGarcia","id":2778501,"avatar_url":"https://avatars.githubusercontent.com/u/2778501?v=3","gravatar_id":"","url":"https://api.github.com/users/FernandoGarcia","html_url":"https://github.com/FernandoGarcia","followers_url":"https://api.github.com/users/FernandoGarcia/followers","following_url":"https://api.github.com/users/FernandoGarcia/following{/other_user}","gists_url":"https://api.github.com/users/FernandoGarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/FernandoGarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FernandoGarcia/subscriptions","organizations_url":"https://api.github.com/users/FernandoGarcia/orgs","repos_url":"https://api.github.com/users/FernandoGarcia/repos","events_url":"https://api.github.com/users/FernandoGarcia/events{/privacy}","received_events_url":"https://api.github.com/users/FernandoGarcia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-09T17:33:36Z","updated_at":"2015-10-09T17:33:36Z","closed_at":null,"body":"Hi!\r\nI have problem to use the function digitalRead() it returns always LOW.\r\nI'm using 2 two ways to check the status without success.\r\nSee the code:\r\n\r\n#include <Wire.h>    // Required for I2C communication\r\n#include <PCF8575.h> // Required for PCF8575\r\n\r\n/** PCF8575 instance */\r\nPCF8575 expander;\r\n\r\nvoid setup() {\r\n\r\n  Serial.begin(115200);\r\n\r\n  /* Start I2C bus and PCF8575 instance */\r\n  expander.begin(0x20);\r\n  for (byte i = 0; i < 16; i++)\r\n  {\r\n    expander.pinMode(i, OUTPUT);\r\n  }\r\n}\r\n\r\nvoid loop() {\r\n\r\n  for (byte i = 0; i < 16; i++)\r\n  {\r\n    expander.digitalWrite(i, 1);\r\n  }\r\n\r\n  for (byte i = 0; i < 16; i++)\r\n  {\r\n    Serial.println(expander.digitalRead(i) ? \"HIGH\" : \"LOW\");\r\n  }\r\n  delay(5000);\r\n  for (byte i = 0; i < 16; i++)\r\n  {\r\n    expander.digitalWrite(i, 0);\r\n  }\r\n  for (byte i = 0; i < 16; i++)\r\n  {\r\n    Serial.println(expander.digitalRead(i));\r\n  }\r\n  delay(5000);\r\n}\r\n\r\nCan you check if this function works for you and if my code is wrong?\r\nBest regards.\r\n"}}