{"action":"created","issue":{"url":"https://api.github.com/repos/tinue/APA102_Pi/issues/2","labels_url":"https://api.github.com/repos/tinue/APA102_Pi/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/tinue/APA102_Pi/issues/2/comments","events_url":"https://api.github.com/repos/tinue/APA102_Pi/issues/2/events","html_url":"https://github.com/tinue/APA102_Pi/issues/2","id":122466266,"number":2,"title":"Small bugs in the code","user":{"login":"pcjacobse","id":583217,"avatar_url":"https://avatars.githubusercontent.com/u/583217?v=3","gravatar_id":"","url":"https://api.github.com/users/pcjacobse","html_url":"https://github.com/pcjacobse","followers_url":"https://api.github.com/users/pcjacobse/followers","following_url":"https://api.github.com/users/pcjacobse/following{/other_user}","gists_url":"https://api.github.com/users/pcjacobse/gists{/gist_id}","starred_url":"https://api.github.com/users/pcjacobse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcjacobse/subscriptions","organizations_url":"https://api.github.com/users/pcjacobse/orgs","repos_url":"https://api.github.com/users/pcjacobse/repos","events_url":"https://api.github.com/users/pcjacobse/events{/privacy}","received_events_url":"https://api.github.com/users/pcjacobse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-16T09:51:23Z","updated_at":"2015-12-16T20:52:43Z","closed_at":null,"body":"Hi,\r\n\r\nI'm starting a simple Raspberry + APA102 project myself. And found your code, it's a really nice starting point for me, tnx for that.\r\nI played a bit with it last night, and found 2 small bugs in your code:\r\n\r\n1. In the clearstrip method (https://github.com/tinue/APA102_Pi/blob/master/apa102.py#L102) you forgot to send the clock startframe `self.clockStartFrame()`. The leds didn't clear for me without this.\r\n\r\n2. In the paint loop (https://github.com/tinue/APA102_Pi/blob/master/colorcycletemplate.py#L65) you increment the counter before checking, so you should do a check only on greater than. not equal: `if (currentStep > self.numLEDs):` I guess this isn't really noticable on a led strip. However I'm working with single leds (making a ledmatrix myself) and when I tested the code with 1 led the update method didn't work.\r\n\r\n3. The same issue is with the check on the cycles (https://github.com/tinue/APA102_Pi/blob/master/colorcycletemplate.py#L69): `if (currentCycle > self.numCycles): break`, however I didn't check it.\r\n\r\nIf you'd like I can create a pull request tonight."},"comment":{"url":"https://api.github.com/repos/tinue/APA102_Pi/issues/comments/165240971","html_url":"https://github.com/tinue/APA102_Pi/issues/2#issuecomment-165240971","issue_url":"https://api.github.com/repos/tinue/APA102_Pi/issues/2","id":165240971,"user":{"login":"pcjacobse","id":583217,"avatar_url":"https://avatars.githubusercontent.com/u/583217?v=3","gravatar_id":"","url":"https://api.github.com/users/pcjacobse","html_url":"https://github.com/pcjacobse","followers_url":"https://api.github.com/users/pcjacobse/followers","following_url":"https://api.github.com/users/pcjacobse/following{/other_user}","gists_url":"https://api.github.com/users/pcjacobse/gists{/gist_id}","starred_url":"https://api.github.com/users/pcjacobse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcjacobse/subscriptions","organizations_url":"https://api.github.com/users/pcjacobse/orgs","repos_url":"https://api.github.com/users/pcjacobse/repos","events_url":"https://api.github.com/users/pcjacobse/events{/privacy}","received_events_url":"https://api.github.com/users/pcjacobse/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T20:52:43Z","updated_at":"2015-12-16T20:52:43Z","body":"The clearing of the memory help if you only want to set specific leds after clearing the strip. I guess its not really usefullI for exiting the application, but when you built out some of the samples and want to clear the strip midrun, and after that just set a couple of pixels, you dont have to set all other leds to black manually.\r\n\r\nAnd the other commit he did was swap the green and blue byte, since those are in the wrong order in your code. For example your colorwheel starts on blue instead of green."}}