{"action":"created","issue":{"url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/138","repository_url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306","labels_url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/138/comments","events_url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/138/events","html_url":"https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/138","id":249395725,"number":138,"title":"Two OLED Displays 128x64","user":{"login":"geojohn5","id":30905001,"avatar_url":"https://avatars2.githubusercontent.com/u/30905001?v=4","gravatar_id":"","url":"https://api.github.com/users/geojohn5","html_url":"https://github.com/geojohn5","followers_url":"https://api.github.com/users/geojohn5/followers","following_url":"https://api.github.com/users/geojohn5/following{/other_user}","gists_url":"https://api.github.com/users/geojohn5/gists{/gist_id}","starred_url":"https://api.github.com/users/geojohn5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geojohn5/subscriptions","organizations_url":"https://api.github.com/users/geojohn5/orgs","repos_url":"https://api.github.com/users/geojohn5/repos","events_url":"https://api.github.com/users/geojohn5/events{/privacy}","received_events_url":"https://api.github.com/users/geojohn5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2017-08-10T15:58:01Z","updated_at":"2018-03-16T05:45:01Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nI cant get two displays to work.  Basically write to one, and then the other.  As soon as the 2nd one gets initialized the first one no longer works.\r\n\r\nSSD1306  display1(0x3d, D3, D5);\r\nSSD1306  display2(0x3c, D1, D2);\r\n\r\n  display1.init();\r\n  display1.flipScreenVertically();\r\n  display1.setFont(ArialMT_Plain_10);\r\n  display2.init();\r\n  display2.flipScreenVertically();\r\n  display2.setFont(ArialMT_Plain_10);\r\n      display1.clear();\r\n      display1.setTextAlignment(TEXT_ALIGN_CENTER);\r\n      display1.setFont(ArialMT_Plain_10);\r\n      display1.drawString(64, 5, \"test\");\r\n      display1.display();\r\n      display2.clear();\r\n      display2.setTextAlignment(TEXT_ALIGN_CENTER);\r\n      display2.setFont(ArialMT_Plain_10);\r\n      display2.drawString(64, 5, \"test\");\r\n      display2.display();"},"comment":{"url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/comments/373609835","html_url":"https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/138#issuecomment-373609835","issue_url":"https://api.github.com/repos/ThingPulse/esp8266-oled-ssd1306/issues/138","id":373609835,"user":{"login":"squix78","id":716822,"avatar_url":"https://avatars2.githubusercontent.com/u/716822?v=4","gravatar_id":"","url":"https://api.github.com/users/squix78","html_url":"https://github.com/squix78","followers_url":"https://api.github.com/users/squix78/followers","following_url":"https://api.github.com/users/squix78/following{/other_user}","gists_url":"https://api.github.com/users/squix78/gists{/gist_id}","starred_url":"https://api.github.com/users/squix78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squix78/subscriptions","organizations_url":"https://api.github.com/users/squix78/orgs","repos_url":"https://api.github.com/users/squix78/repos","events_url":"https://api.github.com/users/squix78/events{/privacy}","received_events_url":"https://api.github.com/users/squix78/received_events","type":"User","site_admin":false},"created_at":"2018-03-16T05:45:01Z","updated_at":"2018-03-16T05:45:01Z","author_association":"COLLABORATOR","body":"Hi guys. I don't like static variables either, but the problems come from the fact that Arduino/ESP8266 wire library uses two static variables to store the pins which makes it a lot harder for us to keep two or more separate instances of the Wire/I2C driver. Have a look here: https://github.com/esp8266/Arduino/blob/master/libraries/Wire/Wire.cpp#L55 \r\n\r\nSo the 100 Mio dollar question is how to we get around this nasty fact? The brute force solution is to always call Wire.begin(...) whenever we communicate over I2C. But that probably will be very inefficient \r\n\r\n@igrr: Do you have a suggestion? Do you know why those static variables were introduced in the first place? I think the ESP32 code base doesn't have them anymore...\r\n"}}
{"actor":{"display_login":"squix78"}}