androidthings / drivers-samples

Peripheral driver samples
Apache License 2.0
153 stars 57 forks source link

apa102 example - missing loop for LED lighting? #1

Closed blundell closed 7 years ago

blundell commented 7 years ago

In the apa102 example there is no loop of the animation thread, but in pwmspeaker the example is looped.

apa102: https://github.com/androidthings/drivers-samples/blob/cfa3c7fbf376600b990e0bf06999ffbded59144c/apa102/src/main/java/com/example/androidthings/driversamples/MainActivity.java#L63

pwmspeaker: https://github.com/androidthings/drivers-samples/blob/cfa3c7fbf376600b990e0bf06999ffbded59144c/pwmspeaker/src/main/java/com/example/androidthings/driversamples/SpeakerActivity.java#L98

I was wondering if this is a mistake for the apa102 example. Should it be looped? (because otherwise it'll just light up the LED's once then stop right?

jdkoren commented 7 years ago

Yes, we should either loop the Runnable or include instructions to restart the app like we do for the pwmspeaker sample.

blundell commented 7 years ago

👍 , thought I was going crazy for a second :-)

blundell commented 7 years ago

fixed in https://github.com/androidthings/drivers-samples/commit/438b8736481d44b3c6c3196dd5f8cb3e8737165c