Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Lightsaber
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Lightsaber

by rusi1311 on Wed May 27, 2020 3:58 pm

Hello,
I am building a lightsaber according to Punished Props Academy. All electronic componets are from Mouser eletronics. But I have different LED strip (sk 6812) and I have some problems with Circuit Python code (https://learn.adafruit.com/lightsaber-f ... g/software).
Problems are:
1. I have 3 different colors on LED strip, not only one. (photo)
2. Swing, hit sounds and colors do not work when I moving with Adafruit Prop-Maker FeatherWing.
I am a beginner with Circuit Pythonl. I try everything, but no results.
Could you help me, please?
Adam
Attachments
101388466_3545189785496396_3854415956235255808_n.jpg
photo
101388466_3545189785496396_3854415956235255808_n.jpg (778.5 KiB) Viewed 75 times

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by dastels on Wed May 27, 2020 8:43 pm

First, is everything up to date? CircuitPython and all the libraries.

1) Are your strips RGBW by any chance?

2) Can you play sounds from the REPL? That would check whether the sounds software and hardware is all working.
Do the non-motion related sounds work? I.e. Power on/off, and idle hum? I.e. is it the sound or the accelerometer processing.

Dave

dastels
 
Posts: 2816
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lightsaber

by rusi1311 on Thu May 28, 2020 5:29 am

Thank you for your answer.

Libraries and CircuitPython are the latest version (5.3.0).

LED strip is RGBW.

Non-motion sounds work good (power-on/off, idle hum). Only hit, swings sounds and colors do not work.

I tried another code for Prop-Maker Keyblade (https://learn.adafruit.com/propmaker-keyblade/software) and all motion sounds worked without any problems.

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by dastels on Thu May 28, 2020 9:46 am

When you initialize the strip object you need to tell it that it's an RGBW strip. It defaults to support the original NeoPixels.
You'll need to add the constructor arguments:
Code: Select all | TOGGLE FULL SIZE
, pixel_order=RGBW

or
Code: Select all | TOGGLE FULL SIZE
, pixel_order=GRBW

Are the sound files for the hit & swing present and playable? You can try in the REPL.
Sounds work, accel works... so I am suspecting the sound files.

Dave

dastels
 
Posts: 2816
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lightsaber

by rusi1311 on Thu May 28, 2020 12:38 pm

Where in the code I must write this arguments(pixel_order=RGBW)?

Sounds hit and swing are working, accelerometer is working too in Keyblade Prop-Maker code. Only in lightsaber code these sounds and accelerometer do not work.

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by dastels on Thu May 28, 2020 12:53 pm

As an argument to the NeoPixel object: line 44 in the code you linked to.

dastels
 
Posts: 2816
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lightsaber

by rusi1311 on Thu May 28, 2020 1:08 pm

Like this? Because it does not work.
Attachments
code.JPG
code.JPG (63.34 KiB) Viewed 59 times

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by dastels on Thu May 28, 2020 1:18 pm

What do you mean doesn't work?

You might need GRBW

Dave

dastels
 
Posts: 2816
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lightsaber

by rusi1311 on Thu May 28, 2020 1:36 pm

If I wrote this argument to code, the code does not run (LED strip does not work and the Adafruit Feather M4 Express diod blinks - white, yellow, blue - via photo).
Attachments
101015498_949393488820291_9214451724788432896_n.jpg
101015498_949393488820291_9214451724788432896_n.jpg (550.45 KiB) Viewed 58 times

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by rusi1311 on Thu May 28, 2020 3:43 pm

I tried some combination and I managed the LED strip to work. Thanks
But sounds and lights - hit, swing does not work. Could you help me please one more time?

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by rusi1311 on Fri May 29, 2020 4:26 pm

Hello,

I checked the accelerometer in REPL and it works. Sounds hit and swing works in REPL too. But if I run the lightsaber program, sounds and colors (hit and swing) do not work.

Could you help me one more time, please?

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by rusi1311 on Sat May 30, 2020 3:02 pm

Dave, could you help me please?

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Re: Lightsaber

by sconnolly on Sat May 30, 2020 6:19 pm

I would try adding a bit more solder to the short side set of pin points down from your speaker connection. if you look from the feather m4 side should be pins bat, 13, 12, 11 scl, sda. i had the same issue on another project. i ended up leaving the iron on the board a bit longer then i should have just trying to clean up connections after i had gotten it to work and fried it so i live by no longer then 3 sec of iron on the board.

good luck hope this helps

sconnolly
 
Posts: 7
Joined: Thu May 14, 2020 5:34 pm

Re: Lightsaber

by rusi1311 on Sun May 31, 2020 6:39 am

Thank you, problem was in the code. I have already fixed it.

rusi1311
 
Posts: 9
Joined: Tue May 26, 2020 11:36 am

Please be positive and constructive with your questions and comments.