-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Driver for WS2812B LEDs #76
base: master
Are you sure you want to change the base?
Conversation
Close SPI device Close SPI device twice Write red to SPI device
Added a faster strategy calculate the bit patterns
Added unit tests for this mapping strategy
Minor renaming refactoring
by a SparseArray
Replaced timing SVG
Fixed wrong SVG filename
…oolsVersion to 26
Improve README and SVG images.
Minor refactoring
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
I'm okay with my commits being contributed to this project. |
ws2812b/src/main/AndroidManifest.xml
Outdated
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.google.android.things.contrib.driver.ws2812b"> | ||
<application> | ||
<uses-library android:name="com.google.android.things"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drivers in this repo now have required=false
<uses-library android:required="false" android:name="com.google.android.things"/>
to allow for any application using them to not be filtered from the playstore (if for example they wrote an app that targets phones and an IoT device)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: bb7b936
|
||
class ColorChannelSequence { | ||
@SuppressWarnings("WeakerAccess") | ||
public static final int RGB = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of supressing the warning, you can change these to package access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants are used as second parameter in the public accessible constructor of the Ws2812b class:
public Ws2812b(String spiBusPort, @ColorChannelSequence.Sequence int colorChannelSequence) throws IOException {
this (spiBusPort, new ColorToBitPatternConverter(colorChannelSequence));
}
The failure was that the whole ColorChannelSequence class must be public accessible. Fixed: 37d29b8
|
||
@RunWith(PowerMockRunner.class) | ||
@PrepareForTest(android.graphics.Color.class) | ||
public class ColorChannelSequenceTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice tests 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greater thanks for the color mocking should go to the author of the apa102 driver: https://github.com/androidthings/contrib-drivers/blob/master/apa102/src/test/java/com/google/android/things/contrib/driver/apa102/ColorMock.java ;)
…ifest.xml to false: <uses-library android:required="false" android:name="com.google.android.things"/>
…correct usage of the second constructor of the Ws2812b class
Good morning, |
Adds a driver to control WS2812B LEDs by SPI using bit patterns