Skip to content
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

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

Driver for WS2812B LEDs #76

wants to merge 44 commits into from

Conversation

Ic-ks
Copy link

@Ic-ks Ic-ks commented Oct 15, 2017

Adds a driver to control WS2812B LEDs by SPI using bit patterns

Ic-ks added 30 commits June 28, 2017 22:47
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
Replaced timing SVG
Fixed wrong SVG filename
@googlebot
Copy link

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 cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@bert2
Copy link

bert2 commented Oct 15, 2017

I'm okay with my commits being contributed to this project.

<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"/>
Copy link
Contributor

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)

Copy link
Author

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;
Copy link
Contributor

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

Copy link
Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice tests 👍

Copy link
Author

@Ic-ks Ic-ks Nov 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…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
@Ic-ks Ic-ks mentioned this pull request Mar 6, 2018
@Fleker
Copy link
Contributor

Fleker commented Jul 23, 2018

Good morning,
We've recently added a program to let developers submit drivers from their own repository to androidthings.withgoogle.com. Can you put this change in your own repository and then submit through that site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants