Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!




Ws2811 10×10 panel
 
Share:
Notifications
Clear all

Ws2811 10×10 panel

Page 3 / 3

 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2018
 

You will need to post your full sketch ... the code you posted before is incomplete ...

Als when you get an error message: copy and paste the error message here as well, this way I can find the problem much faster with much less effort.

For example in the code you posted earlier, you are missing a "void setup" and a "void loop" ...
I'm not sure where the DrawMarquee functions come from either or where the u8G2 library is being used ... 😔 

Posted by: @darek
 
#include <Arduino.h>
#include <U8g2lib.h>
#define FASTLED_INTERNAL
#include <FastLED.h>


void DrawMarquee()
{
    static byte j = 0;
    j+=4;
    byte k = j;

    // Roughly equivalent to fill_rainbow(g_LEDs, NUM_LEDS, j, 8);

    CRGB c;
    for (int i = 0; i < NUM_LEDS; i ++)
        g_LEDs[i] = c.setHue(k+=8);

    static int scroll = 0;
    scroll++;

    for (int i = scroll % 5; i < NUM_LEDS - 1; i += 5)
    {
        g_LEDs[i] = CRGB::Black;
    }
    delay(50);
}

void DrawMarqueeMirrored()
{
    static byte j = 0;
    j+=4;
    byte k = j;

    // Roughly equivalent to fill_rainbow(g_LEDs, NUM_LEDS, j, 8);

    CRGB c;
    for (int i = 0; i < (NUM_LEDS + 1) / 2; i ++)
    {
        g_LEDs[i] = c.setHue(k);
        g_LEDs[NUM_LEDS - 1 - i] = c.setHue(k);
        k+= 8;
    }


    static int scroll = 0;
    scroll++;

    for (int i = scroll % 5; i < NUM_LEDS / 2; i += 5)
    {
        g_LEDs[i] = CRGB::Black;
        g_LEDs[NUM_LEDS - 1 - i] = CRGB::Black;
    }   

    delay(50);
}

 


ReplyQuote
(@darek)
Active Member
Joined: 6 months ago
Posts: 18
Topic starter  

Yes I'm noticed void setup and loop is missing . I'm just copy that code from github .  I'm learning or try to learn all of this new staff. Maybe I missed some file from there. 

Thanks anyway. 


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2018
 

Well looking into the code of others is never a bad thing - I do this from time to time as well 😊 

Just be careful with copy and paste.

On that note:
It is not always easy to look at the code from others, and sometimes takes quite a bit of effort to understand what the programmer was trying to do.


ReplyQuote
Page 3 / 3

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: