{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/741","repository_url":"https://api.github.com/repos/espressif/arduino-esp32","labels_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/741/comments","events_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/741/events","html_url":"https://github.com/espressif/arduino-esp32/issues/741","id":266298816,"number":741,"title":"I2C not working on ESP32","user":{"login":"muktillc","id":32201968,"avatar_url":"https://avatars1.githubusercontent.com/u/32201968?v=4","gravatar_id":"","url":"https://api.github.com/users/muktillc","html_url":"https://github.com/muktillc","followers_url":"https://api.github.com/users/muktillc/followers","following_url":"https://api.github.com/users/muktillc/following{/other_user}","gists_url":"https://api.github.com/users/muktillc/gists{/gist_id}","starred_url":"https://api.github.com/users/muktillc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muktillc/subscriptions","organizations_url":"https://api.github.com/users/muktillc/orgs","repos_url":"https://api.github.com/users/muktillc/repos","events_url":"https://api.github.com/users/muktillc/events{/privacy}","received_events_url":"https://api.github.com/users/muktillc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-10-17T22:21:55Z","updated_at":"2018-03-19T19:40:29Z","closed_at":null,"author_association":"NONE","body":"### Hardware:\r\nBoard:\t\t\t\t\t\t\tESP32 Dev Module\r\nCore Installation/update date:\t\t\t11/jul/2017\r\nIDE name:\t\t\t\t\t\t\tArduino IDE\r\nFlash Frequency:\t\t\t\t\t40Mhz\r\nUpload Speed:\t\t\t\t\t\t115200\r\n\r\n\r\n### Description:\r\nI am not able to generate the I2C clock. I have an ST microelectronics accelerator that I am using which has an I2C interface. So just wanted to see if I2C is working. \r\n\r\nI have seen many people running into the same problem but could not find a solution for this issue. No errors generated when compiling the code.  \r\n\r\nPlease find my code below.\r\n\r\n### Sketch:\r\n\r\n\r\n//Change the code below by your sketch\r\n\r\n#include \"Wire.h\"\r\n\r\nvoid setup() {\r\n  Wire.begin(21,22);\r\n  Serial.begin(115200);\r\n  Wire.setClock(400000); // choose 400 kHz I2C rate\r\n  Serial.println(\"Start i2c-test\"); \r\n}\r\n\r\nvoid loop() {\r\n  byte error;\r\n\r\n  // 0x20 is the address of a pcf8574 GPIO expander\r\n  Serial.println(\"Try to contact 0x20\"); \r\n  uint8_t data = 0;\r\n//  Wire.beginTransmission(0x3A);\r\n//  error = Wire.endTransmission();\r\n    Wire.beginTransmission(0x3B);  // Initialize the Tx buffer\r\n    Wire.write(0x0F);              // Put WHO_AM_I address in Tx buffer\r\n    Wire.endTransmission(false);             // Send the Tx buffer, but send a restart to keep connection alive\r\n    Wire.requestFrom(0x3B, 1);     // Read two bytes from slave PROM address \r\n    while (Wire.available()) {\r\n    data = Wire.read(); }               // Put read results in the Rx buffer\r\n  Serial.print(\"Error code is:\");\r\n  Serial.println(data);\r\n\r\n  delay(1000);\r\n}"},"comment":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/comments/374343401","html_url":"https://github.com/espressif/arduino-esp32/issues/741#issuecomment-374343401","issue_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/741","id":374343401,"user":{"login":"njbuch","id":6631425,"avatar_url":"https://avatars0.githubusercontent.com/u/6631425?v=4","gravatar_id":"","url":"https://api.github.com/users/njbuch","html_url":"https://github.com/njbuch","followers_url":"https://api.github.com/users/njbuch/followers","following_url":"https://api.github.com/users/njbuch/following{/other_user}","gists_url":"https://api.github.com/users/njbuch/gists{/gist_id}","starred_url":"https://api.github.com/users/njbuch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njbuch/subscriptions","organizations_url":"https://api.github.com/users/njbuch/orgs","repos_url":"https://api.github.com/users/njbuch/repos","events_url":"https://api.github.com/users/njbuch/events{/privacy}","received_events_url":"https://api.github.com/users/njbuch/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T19:40:29Z","updated_at":"2018-03-19T19:40:29Z","author_association":"NONE","body":"Superb, I just did what this suggest, with your file:[https://github.com/stickbreaker/arduino-esp32/issues/16]( issue16). And it compiles. The output has changed from \"Busy timeout errors\" to simply no readings.\r\n\r\nI am on the LOLIN32-Lite board, and I have connected SCL->22 and SDA->23 with a revised Wire.begin(23,22) (with no frequency ;) )\r\n"}}
{"actor":{"display_login":"njbuch"}}