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

Is there an option to use channel 1 instead of zero? #25

Closed
yohayg opened this issue Oct 29, 2017 · 6 comments
Closed

Is there an option to use channel 1 instead of zero? #25

yohayg opened this issue Oct 29, 2017 · 6 comments

Comments

@yohayg
Copy link

yohayg commented Oct 29, 2017

I'm using GPIO pin 13 which will work when the channel is 1 and not zero.

There is no option to pass the channel number in the native.

@mattjlewis
Copy link
Owner

Hi, what aspect of diozero are you referring to here?

@yohayg
Copy link
Author

yohayg commented Oct 29, 2017

diozero-ws281x-java. I'm trying to use WS281xTest.java to set the channel same as in https://github.com/jgarff/rpi_ws281x/blob/master/python/examples/strandtest.py

@mattjlewis
Copy link
Owner

mattjlewis commented Oct 29, 2017

I've just committed code that hopefully fixes this. Could you test and close the issue if it works please (I need to dig out my neopixels...). I'm in the processing of pushing the new snapshot build to maven central too.
Thanks, Matt

@yohayg
Copy link
Author

yohayg commented Oct 29, 2017

Great, thanks I'll check. (I have just finished building my own jni for setting the channel). I'll test it first thing tomorrow!

@yohayg
Copy link
Author

yohayg commented Oct 30, 2017

OK it works. The only thing I had to fix is in com_diozero_ws281xj_WS281x.c from

jobject direct_buffer = (*env)->NewDirectByteBuffer(env, led_string.channel[0].leds, numLeds*sizeof(ws2811_led_t));

to
jobject direct_buffer = (*env)->NewDirectByteBuffer(env, led_string.channel[channel].leds, numLeds*sizeof(ws2811_led_t));

@mattjlewis
Copy link
Owner

Great, thanks for testing. I've committed that change, I'll push a new snapshot build tonight and close this issue when done.

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

No branches or pull requests

2 participants