{"action":"created","issue":{"url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/3","labels_url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/3/comments","events_url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/3/events","html_url":"https://github.com/greiman/SSD1306Ascii/issues/3","id":128389105,"number":3,"title":"Request : Add scroll feature to PRINTLN","user":{"login":"gerardwr","id":10114857,"avatar_url":"https://avatars.githubusercontent.com/u/10114857?v=3","gravatar_id":"","url":"https://api.github.com/users/gerardwr","html_url":"https://github.com/gerardwr","followers_url":"https://api.github.com/users/gerardwr/followers","following_url":"https://api.github.com/users/gerardwr/following{/other_user}","gists_url":"https://api.github.com/users/gerardwr/gists{/gist_id}","starred_url":"https://api.github.com/users/gerardwr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerardwr/subscriptions","organizations_url":"https://api.github.com/users/gerardwr/orgs","repos_url":"https://api.github.com/users/gerardwr/repos","events_url":"https://api.github.com/users/gerardwr/events{/privacy}","received_events_url":"https://api.github.com/users/gerardwr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-24T11:11:20Z","updated_at":"2016-01-27T21:51:32Z","closed_at":null,"body":"Hi,\r\n\r\nI use your library mainly as a replacement for the Arduino Serial Monitor, using the print and println statements. Works brilliantly.\r\n\r\nIn the current version println fills the screen up to the last line on the display, and subsequent println statements also outputs on the last line of the display.\r\n\r\nFor me the wanted behavior would be the display to scroll up the content of the display when using println on the bottom line of the display.\r\n\r\nI added some \"proof of concept\" code to the function \"write\" in the file Ssd1306Ascii.cpp (see below). This works fine, but has the flaw that the screen starts scrolling immediately after EVERY println statement, instead of scrolling ONLY  at a println on the last line.\r\n\r\nPerhaps you would consider to add a properly integrated scroll feature, so I can throw my own non-perfect code away :-)\r\n\r\nThanks.\r\n===============================\r\nProof of concept code for println scroll feature \r\n\r\nI replaced\r\n```\r\n    if (ch == '\\n') {\r\n      setCursor(0, m_row + m_magFactor*nr);\r\n      return 1;\r\n    }\r\n```\r\nwith\r\n```\r\n    if (ch == '\\n') {\r\n\t  m_row = m_row + m_magFactor*nr;\r\n      // when m_row > 7 reset to 0\r\n      if (m_row > 7) m_row=0;\r\n      setCursor(0, m_row);\r\n\t  // clear the line from old content\r\n\t  clearToEOL();\r\n\t  // scroll the entire screen 8 pixels up\r\n\t  ssd1306WriteCmd(SSD1306_SETDISPLAYOFFSET);\r\n\t  ssd1306WriteCmd( (m_row +1) * 8);\r\n\t  return 1;\r\n    }\r\n```\r\n\r\n  "},"comment":{"url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/comments/175875454","html_url":"https://github.com/greiman/SSD1306Ascii/issues/3#issuecomment-175875454","issue_url":"https://api.github.com/repos/greiman/SSD1306Ascii/issues/3","id":175875454,"user":{"login":"gerardwr","id":10114857,"avatar_url":"https://avatars.githubusercontent.com/u/10114857?v=3","gravatar_id":"","url":"https://api.github.com/users/gerardwr","html_url":"https://github.com/gerardwr","followers_url":"https://api.github.com/users/gerardwr/followers","following_url":"https://api.github.com/users/gerardwr/following{/other_user}","gists_url":"https://api.github.com/users/gerardwr/gists{/gist_id}","starred_url":"https://api.github.com/users/gerardwr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerardwr/subscriptions","organizations_url":"https://api.github.com/users/gerardwr/orgs","repos_url":"https://api.github.com/users/gerardwr/repos","events_url":"https://api.github.com/users/gerardwr/events{/privacy}","received_events_url":"https://api.github.com/users/gerardwr/received_events","type":"User","site_admin":false},"created_at":"2016-01-27T21:51:32Z","updated_at":"2016-01-27T21:51:32Z","body":"Hell Bill,\r\n\r\nTried the updated library and the scrolling works brilliantly.\r\n\r\nIt's possibly my \"always scroll\" mindset, but I had to read an re-read the (elaborate) comment on the proper use of the #define INCLUDE_SCROLLING, and was a little confused at first.\r\n\r\nI see now that you have defaulted to \"#define INCLUDE_SCROLLING 1\", the behavior of the former version without scroll.\r\n\r\nAs suggested by you I changed to \"#define INCLUDE_SCROLLING 2\" and the displays then scrolls without a required setScroll call. Like it better this way.\r\n\r\nI'm really happy now with your library, it's compact and easy to add to a sketch.\r\n\r\nCan't think of another change request right now. When I do, I'll raise an issue again :-)\r\n\r\nThanks.\r\n \r\n"}}