{"action":"created","issue":{"url":"https://api.github.com/repos/DexterInd/GrovePi/issues/247","repository_url":"https://api.github.com/repos/DexterInd/GrovePi","labels_url":"https://api.github.com/repos/DexterInd/GrovePi/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/DexterInd/GrovePi/issues/247/comments","events_url":"https://api.github.com/repos/DexterInd/GrovePi/issues/247/events","html_url":"https://github.com/DexterInd/GrovePi/pull/247","id":154985953,"number":247,"title":"fix for Chainable RGB LED","user":{"login":"tkumata","id":15005197,"avatar_url":"https://avatars.githubusercontent.com/u/15005197?v=3","gravatar_id":"","url":"https://api.github.com/users/tkumata","html_url":"https://github.com/tkumata","followers_url":"https://api.github.com/users/tkumata/followers","following_url":"https://api.github.com/users/tkumata/following{/other_user}","gists_url":"https://api.github.com/users/tkumata/gists{/gist_id}","starred_url":"https://api.github.com/users/tkumata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkumata/subscriptions","organizations_url":"https://api.github.com/users/tkumata/orgs","repos_url":"https://api.github.com/users/tkumata/repos","events_url":"https://api.github.com/users/tkumata/events{/privacy}","received_events_url":"https://api.github.com/users/tkumata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-16T08:45:37Z","updated_at":"2016-05-17T12:49:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DexterInd/GrovePi/pulls/247","html_url":"https://github.com/DexterInd/GrovePi/pull/247","diff_url":"https://github.com/DexterInd/GrovePi/pull/247.diff","patch_url":"https://github.com/DexterInd/GrovePi/pull/247.patch"},"body":"Hi,\r\nI use RPi3 and GrovePi+. OS is Raspbian for Robots(wheezy). I connected one Encoder to D2 port and one Chainable RGB LED to D7 port on GrovePi+.\r\nThen I test Chainable RGB LED. So I connect Encoder but do not use Encoder in this test.\r\n\r\nI run following simple python script some times as a test.\r\n```\r\n#!/usr/bin/env python\r\n#-*- coding:utf-8 -*-\r\nimport time\r\nimport grovepi\r\n\r\npin = 7\r\nnumleds = 1\r\n\r\ngrovepi.pinMode(pin,\"OUTPUT\")\r\ntime.sleep(1)\r\n\r\ntestColorBlack = 0   # 0b000 #000000\r\ntestColorBlue = 1    # 0b001 #0000FF\r\ntestColorGreen = 2   # 0b010 #00FF00\r\ntestColorCyan = 3    # 0b011 #00FFFF\r\ntestColorRed = 4     # 0b100 #FF0000\r\ntestColorMagenta = 5 # 0b101 #FF00FF\r\ntestColorYellow = 6  # 0b110 #FFFF00\r\ntestColorWhite = 7   # 0b111 #FFFFFF\r\n\r\nthisLedOnly = 0\r\nallLedsExceptThis = 1\r\nthisLedAndInwards = 2\r\nthisLedAndOutwards = 3\r\n\r\ntry:\r\n    print \"Test 1) Initialise\"\r\n    grovepi.chainableRgbLed_init(pin, numleds)\r\n    time.sleep(.5)\r\n\r\n    print \"Test 2a) Test Patterns - black\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorBlack)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2b) Test Patterns - blue\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorBlue)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2c) Test Patterns - green\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorGreen)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2d) Test Patterns - cyan\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorCyan)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2e) Test Patterns - red\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorRed)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2f) Test Patterns - magenta\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorMagenta)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2g) Test Patterns - yellow\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorYellow)\r\n    time.sleep(1)\r\n\r\n    print \"Test 2h) Test Patterns - white\"\r\n    grovepi.chainableRgbLed_test(pin, numleds, testColorWhite)\r\n    time.sleep(1)\r\n\r\n    quit()\r\n```\r\n\r\n\r\nResult is following,\r\n\r\n### Case 1: firmware v1.2.6 (original)\r\n\r\nTest 1) Initialise\r\nTest 2a) Test Patterns - black ... OK\r\nTest 2b) Test Patterns - blue ... OK\r\nTest 2c) Test Patterns - green ... NG, blink black color\r\nTest 2d) Test Patterns - cyan ... NG, blink BLUE color\r\nTest 2e) Test Patterns - red ... NG, blink black color\r\nTest 2f) Test Patterns - magenta ... NG, blink BLUE color\r\nTest 2g) Test Patterns - yellow ... NG, blink black color\r\nTest 2h) Test Patterns - white ... NG, blink BLUE color\r\n\r\nChainable RGB LED can blink only black and blue as stated above.\r\nThis test has the similar result on v1.2.3 - v1.2.6.\r\n\r\n\r\n### Case 2: firmware v1.2.6 (original)\r\n\r\nTest 1) Initialise\r\nTest 2a) Test Patterns - black ... OK\r\nTest 2b) Test Patterns - blue ... NG, flash blue color a moment then black soon\r\nTest 2c) Test Patterns - green ... NG, flash green color a moment then black soon\r\nTest 2d) Test Patterns - cyan ... NG, flash cyan color a moment then black soon\r\nTest 2e) Test Patterns - red ... NG, flash red color a moment then black soon\r\nTest 2f) Test Patterns - magenta ... NG, flash magenta color a moment then black soon\r\nTest 2g) Test Patterns - yellow ... NG, flash yellow color a moment then black soon\r\nTest 2h) Test Patterns - white ... NG, flash white color a moment then black soon\r\n\r\nI did not find condition for this result yet, but it has result as stated above sometime.\r\n\r\n\r\n### Case 3: firmware v1.2.6 (origin)\r\n\r\nTest 1) Initialise\r\nTest 2a) Test Patterns - black ... OK\r\nTest 2b) Test Patterns - blue ... OK\r\nTest 2c) Test Patterns - green ... OK\r\nTest 2d) Test Patterns - cyan ... OK\r\nTest 2e) Test Patterns - red ... OK\r\nTest 2f) Test Patterns - magenta ... OK\r\nTest 2g) Test Patterns - yellow ... OK\r\nTest 2h) Test Patterns - white ... OK\r\n\r\nWhen I execute cold boot RPi3, it works fine sometimes. But I test continue, it has result of Case 1 or Case 2.\r\n\r\n\r\n### Case 4: firmware v1.2.6 with my patch\r\nNext, I apply this fix and test.\r\n\r\nTest 1) Initialise\r\nTest 2a) Test Patterns - black ... OK\r\nTest 2b) Test Patterns - blue ... OK\r\nTest 2c) Test Patterns - green ... OK\r\nTest 2d) Test Patterns - cyan ... OK\r\nTest 2e) Test Patterns - red ... OK\r\nTest 2f) Test Patterns - magenta ... OK\r\nTest 2g) Test Patterns - yellow ... OK\r\nTest 2h) Test Patterns - white ... OK\r\n\r\nChainable RGB LED works fine even if I test some times.\r\n\r\nBest Regards,\r\n"},"comment":{"url":"https://api.github.com/repos/DexterInd/GrovePi/issues/comments/219707185","html_url":"https://github.com/DexterInd/GrovePi/pull/247#issuecomment-219707185","issue_url":"https://api.github.com/repos/DexterInd/GrovePi/issues/247","id":219707185,"user":{"login":"karan259","id":2410652,"avatar_url":"https://avatars.githubusercontent.com/u/2410652?v=3","gravatar_id":"","url":"https://api.github.com/users/karan259","html_url":"https://github.com/karan259","followers_url":"https://api.github.com/users/karan259/followers","following_url":"https://api.github.com/users/karan259/following{/other_user}","gists_url":"https://api.github.com/users/karan259/gists{/gist_id}","starred_url":"https://api.github.com/users/karan259/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karan259/subscriptions","organizations_url":"https://api.github.com/users/karan259/orgs","repos_url":"https://api.github.com/users/karan259/repos","events_url":"https://api.github.com/users/karan259/events{/privacy}","received_events_url":"https://api.github.com/users/karan259/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T12:49:04Z","updated_at":"2016-05-17T12:49:04Z","body":"Hey @tkumata : @nikkoura  is spot on, having **flag==0** makes sure that the commands only run once . I am not sure what **run_once** does. It is same as flag but only applied to smaller set of commands. Were the RGB LED's not working with flag==0??"}}