{"action":"created","issue":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/907","labels_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/907/labels{/name}","comments_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/907/comments","events_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/907/events","html_url":"https://github.com/rwaldron/johnny-five/pull/907","id":107633347,"number":907,"title":"Support Led.Digits with HT16K33 controller","user":{"login":"donmccurdy","id":1848368,"avatar_url":"https://avatars.githubusercontent.com/u/1848368?v=3","gravatar_id":"","url":"https://api.github.com/users/donmccurdy","html_url":"https://github.com/donmccurdy","followers_url":"https://api.github.com/users/donmccurdy/followers","following_url":"https://api.github.com/users/donmccurdy/following{/other_user}","gists_url":"https://api.github.com/users/donmccurdy/gists{/gist_id}","starred_url":"https://api.github.com/users/donmccurdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmccurdy/subscriptions","organizations_url":"https://api.github.com/users/donmccurdy/orgs","repos_url":"https://api.github.com/users/donmccurdy/repos","events_url":"https://api.github.com/users/donmccurdy/events{/privacy}","received_events_url":"https://api.github.com/users/donmccurdy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-22T02:18:05Z","updated_at":"2015-09-30T20:29:29Z","closed_at":"2015-09-30T20:29:21Z","pull_request":{"url":"https://api.github.com/repos/rwaldron/johnny-five/pulls/907","html_url":"https://github.com/rwaldron/johnny-five/pull/907","diff_url":"https://github.com/rwaldron/johnny-five/pull/907.diff","patch_url":"https://github.com/rwaldron/johnny-five/pull/907.patch"},"body":"Fixes #905.\r\n\r\nMoves print() and digits() to parent controller, calling into delegated sendDigit() functions for controller-specific logic.\r\n\r\nThere were a few differences with the HT16K33 controller:\r\n\r\n1. Column indexing is left-to-right, so I've added a `digitsOrder` property to the controller. I'm not sure which direction is actually more common.\r\n2. The order of individual segments is reversed, so the constants in [DIGIT_CHARS](https://github.com/rwaldron/johnny-five/blob/master/lib/led/led-chars.js#L296) don't work. Rather than adding another set of constants for the HT16K33 ([example](https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/blob/master/Adafruit_LEDBackpack/Adafruit_7Segment.py#L18)) I've done some bit-flipping to reuse the original constants. Tested that on all values 0-9A-F. The lowercase letters look odd: not sure what expected behavior is.\r\n\r\nOther changes:\r\n- Adds tests for HT16K33 with segmented displays.\r\n- Use `controller.digits` option when available, rather than assuming there are 8.\r\n- Adds \":\" support for ##:## displays. To use this, I might do something like:\r\n\r\n```javascript\r\nvar digits = new five.Led.Digits({controller: 'HT16K33', digits: 5});\r\ndigits.print(\"12:00\");\r\n```\r\n\r\nTested against [Adafruit 4-digit 7-segment display with HT16K33 I2C backpack](http://www.adafruit.com/products/879).\r\n\r\nI've not added other documentation or examples so far, but would be happy to add those if the changes themselves seem reasonable."},"comment":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/comments/144533101","html_url":"https://github.com/rwaldron/johnny-five/pull/907#issuecomment-144533101","issue_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/907","id":144533101,"user":{"login":"rwaldron","id":27985,"avatar_url":"https://avatars.githubusercontent.com/u/27985?v=3","gravatar_id":"","url":"https://api.github.com/users/rwaldron","html_url":"https://github.com/rwaldron","followers_url":"https://api.github.com/users/rwaldron/followers","following_url":"https://api.github.com/users/rwaldron/following{/other_user}","gists_url":"https://api.github.com/users/rwaldron/gists{/gist_id}","starred_url":"https://api.github.com/users/rwaldron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwaldron/subscriptions","organizations_url":"https://api.github.com/users/rwaldron/orgs","repos_url":"https://api.github.com/users/rwaldron/repos","events_url":"https://api.github.com/users/rwaldron/events{/privacy}","received_events_url":"https://api.github.com/users/rwaldron/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T20:29:29Z","updated_at":"2015-09-30T20:29:29Z","body":":clap: "}}