Need coding help for REZZ glasses

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Korberos
 
Posts: 4
Joined: Sun Mar 30, 2014 4:13 am

Re: Need coding help for REZZ glasses

Post by Korberos »

@EAGON - I only want the STL if it's built the way OP's is... in a way that fits the rings. I'm guessing yours is a very different shape. If you posted a screenshot of the render, I could look it over and see if I'm assuming incorrectly. I'd definitely be able to help with code if it's the right shape and you'd trade the STL.

User avatar
bpmoore178
 
Posts: 3
Joined: Sun Oct 22, 2017 2:39 pm

Re: Need coding help for REZZ glasses

Post by bpmoore178 »

@kcl1s - I'm also in the process of making some Rezz HypnoShades and was able to run your your code on my kludged together setup. I did however encounter an issue: the middle (16x RGBW led rings) spin in a different direction than the outermost (24x RGBW led rings).
My question: How can I make all rings spin in the same direction? Eg: all three rings spinning counterclockwise or clockwise?

Here's a quick outline of my setup:
Controller: Gemma M0
Wiring:
  • Left 24x RGBW ring ---> D0(soldiered)
  • Right 24x RGBW ring ---> D0(soldiered)
  • Left 16x RGBW ring ---> Left 24x data out pin
  • Right 16x RGBW ring ---> Right 24x data out pin
  • Left 7x RGBW Jewel ---> Left 16x data out pin
  • Right 7x RGBW Jewel ---> Right 16x data out pin
Number of Pixels: 94
Here's my setup running your code: https://youtu.be/xzgqnP-NDEk

Thanks for the help! -Brian

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: Need coding help for REZZ glasses

Post by kcl1s »

My code was written for RGB Neopixels. You say you have RGBW. Did you change the code to reflect that difference? You have to change the code where you define your Neopixel strip and also the wheel() function.

Keith

User avatar
bpmoore178
 
Posts: 3
Joined: Sun Oct 22, 2017 2:39 pm

Re: Need coding help for REZZ glasses

Post by bpmoore178 »

@Kcl1s- Thanks for getting back to me so quickly. I made the following modifications to your code:

Changed the NeoPixel type to RGBW:

Code: Select all

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);
Added Adafruit's NeoPixel Gamma correction code:

Code: Select all

byte neopix_gamma[] = {
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
    1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,
    2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  5,  5,  5,
    5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,  9,  9, 10,
   10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16,
   17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
   25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
   37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50,
   51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68,
   69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89,
   90, 92, 93, 95, 96, 98, 99,101,102,104,105,107,109,110,112,114,
  115,117,119,120,122,124,126,127,129,131,133,135,137,138,140,142,
  144,146,148,150,152,154,156,158,160,162,164,167,169,171,173,175,
  177,180,182,184,186,189,191,193,196,198,200,203,205,208,210,213,
  215,218,220,223,225,228,231,233,236,239,241,244,247,249,252,255 };
Finally: If you wouldn't mind, can you elaborate on what you mean by wheel() function? I'm assuming you mean this bit of code below but i'm not entirely sure I understand what it's purpose is:

Code: Select all

uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: Need coding help for REZZ glasses

Post by kcl1s »

The wheel function I have in my code and you posted above is for RGB pixels. They return 3 color values. The RGBW pixels use 4 values so the wheel function is returning bad data.
Use this code which is the wheel function for RGBW pixels. It still does not use the white component but includes a '0' value for white so the data is correct.

Code: Select all

//Wheel code for RGBW pixels
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3,0);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3,0);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0,0);
}

uint8_t red(uint32_t c) {
  return (c >> 8);
}
uint8_t green(uint32_t c) {
  return (c >> 16);
}
uint8_t blue(uint32_t c) {
  return (c);
}
Keith

User avatar
bpmoore178
 
Posts: 3
Joined: Sun Oct 22, 2017 2:39 pm

Re: Need coding help for REZZ glasses

Post by bpmoore178 »

@Kcl1s- Thanks for the modification! I was originally encountering compile errors and needed to change your scope of "pixles" to "strip" to get everything working again. That being said, the outer and middle rings are still rotating in opposite directions. Ultimately, I'm still curious as to how to reverse this so all rings rotate in the same direction. Any help appreciated.

-Brian

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: Need coding help for REZZ glasses

Post by kcl1s »

It looks like the ring pcb is made so the pixels increase in number in a counter clockwise direction. I have never seen that before.

I have not tested this but you could try changing the 4 - 16 ring code lines like this...

Code: Select all

// for ccw rings add '16 -' to the 4 - 16 pixel lines
//from this
pixels.setPixelColor(LstepCt * 16 / 256 + Lmid, Wheel(wC));

//to this

pixels.setPixelColor(16 - LstepCt * 16 / 256 + Lmid, Wheel(wC));


Keith

User avatar
EAGON
 
Posts: 2
Joined: Wed Aug 30, 2017 4:27 pm

Re: Need coding help for REZZ glasses

Post by EAGON »

Yeah, mine is different. It is more like the ones that she has. I am still making adjustments to it so it is not perfect yet but you can see my 3D model here and all the parts are there too, you can explode or turn parts off. Im using individually addressable RGB leds from sparkfun and a trinket, with the powerboost 500c with a 3.7v lipo from an old project.

http://a360.co/2yCgi7R

User avatar
NMAN124
 
Posts: 1
Joined: Wed Jan 03, 2018 8:08 pm

Re: Need coding help for REZZ glasses

Post by NMAN124 »

I attempted a very similar project and have not been able to get my 3D model to print correctly. May I use yours? It's a personal project and I would appreciate it very much!

User avatar
hakstyle
 
Posts: 1
Joined: Mon Apr 16, 2018 12:52 pm

Re: Need coding help for REZZ glasses

Post by hakstyle »

I know this is an older post but I'm also trying to make the same glasses and am having trouble creating a 3D model.
Would anyone know where I can get an .stl file or any format so I can 3D print the frame? Or can anyone kindly send me theirs? Thank you in advance!

User avatar
zambam
 
Posts: 6
Joined: Sun Apr 15, 2018 4:51 pm

Re: Need coding help for REZZ glasses

Post by zambam »

I'm working on this project too, I have the .stl files pretty much done for 2 x 24 NP ring, 2 x 16 NP Ring, and 8 individual NP leds. I'm completely stuck on the coding, I'm using a nr52 feather board and planning to tuck it all inside a box.

Do you have any help to offer on the wiring, coding side?
hakstyle wrote:I know this is an older post but I'm also trying to make the same glasses and am having trouble creating a 3D model.
Would anyone know where I can get an .stl file or any format so I can 3D print the frame? Or can anyone kindly send me theirs? Thank you in advance!

User avatar
ivanmakca
 
Posts: 3
Joined: Thu Jul 26, 2018 3:07 pm

Re: Need coding help for REZZ glasses

Post by ivanmakca »

zambam wrote:I'm working on this project too, I have the .stl files pretty much done for 2 x 24 NP ring, 2 x 16 NP Ring, and 8 individual NP leds. I'm completely stuck on the coding, I'm using a nr52 feather board and planning to tuck it all inside a box.

Do you have any help to offer on the wiring, coding side?
hakstyle wrote:I know this is an older post but I'm also trying to make the same glasses and am having trouble creating a 3D model.
Would anyone know where I can get an .stl file or any format so I can 3D print the frame? Or can anyone kindly send me theirs? Thank you in advance!
DO you think I could get the STL files for the glasses?

User avatar
ivanmakca
 
Posts: 3
Joined: Thu Jul 26, 2018 3:07 pm

Re: Need coding help for REZZ glasses

Post by ivanmakca »

bpmoore178 wrote:@Kcl1s- Thanks for the modification! I was originally encountering compile errors and needed to change your scope of "pixles" to "strip" to get everything working again. That being said, the outer and middle rings are still rotating in opposite directions. Ultimately, I'm still curious as to how to reverse this so all rings rotate in the same direction. Any help appreciated.

-Brian
Is it possible for you to share your STL file for the frame for the glasses? I desperately need it, im trying to create the glasses for my girlfriend that loves Rezz. Thanks

User avatar
VKingMoneyMaker
 
Posts: 9
Joined: Mon Nov 12, 2018 5:10 pm

Re: Need coding help for REZZ glasses

Post by VKingMoneyMaker »

anybody have the STL file?

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”