Reply to topic  [ 14 posts ]  Go to page Previous  1, 2
Digitally controlled 8x RGB LED Light Strip (HCMODU0075) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 707
Post Re: Digitally controlled 8x RGB LED Light Strip (HCMODU0075)
I'm not sure why it would be doing that but I can see that your code is indexing outside of the array which can cause all sorts of weird things to happen. Try this:


Code:
 /* Step forward through each LED */
  for(index = 0; index < NUMBEROFLEDS; index++)
  { 
    HCWS2812.ClearBuffer();
    RGBBuffer[RED][index] = 85;
    if(index)
      RGBBuffer[RED][index-1] = 15;
    HCWS2812.Refresh();
    delay(100);
  }
 
  /* Step backward through each LED */
  for(index = NUMBEROFLEDS; index; index--)
  { 
    HCWS2812.ClearBuffer();
    RGBBuffer[RED][index - 1] = 85;
    if(index < NUMBEROFLEDS)
      RGBBuffer[RED][index] = 15;
    HCWS2812.Refresh();
    delay(100);
  }

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Apr 13, 2015 9:32 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 707
Post Re: Digitally controlled 8x RGB LED Light Strip (HCMODU0075)
I've now updated the header file to provide correct timings for newer versions of Arduino IDE. Once everything is confirmed to work I'll move these posts to the software section as they are kind of off topic here.

One other thing to note is that at some point I plan to make a further update to the library to free up some memory.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Apr 13, 2015 11:48 am
Profile

Joined: Sun Mar 12, 2017 3:57 pm
Posts: 1
Post Re: Digitally controlled 8x RGB LED Light Strip (HCMODU0075)
How can I use the HCWS2812.h through two pins? So using pin 8 and 2? I need to control two strips independently and through two different pins.


Sun Mar 12, 2017 4:01 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 707
Post Re: Digitally controlled 8x RGB LED Light Strip (HCMODU0075)
Quote:
How can I use the HCWS2812.h through two pins? So using pin 8 and 2? I need to control two strips independently and through two different pins.


It can only drive one pin I'm afraid. Is there any reason why you can't just attach the data input of the second strip to the data output of the first? The library allows you to control every LED individually so there's no reason why you can't treat them as two separate groups of LED's even though they are connected together.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Mar 13, 2017 10:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD