Problens with using ezButton with FastLED

Hello, well im tryng to use ezButton library to code 2 buttons to work on i project im woriking on.

Basicly as you can see on the images below im tryng to make a mask wich shows diferent emojis.
My ideia is to make the emojis switch on a loop every like 10 secs and also having 2 buttons 1 to pass to the next emoji and the 2º to pass to the previous emoji.



So when i pluged the buttons i runned a simple test code to see if the buttons are working and the did as you can see in the prints below

And on the code with the emojis it dosent print below

So im tryng to figure it how i can make then work for my project.

Full code below, but it is not a final version of it i made this looking on the internet on multiple tutorials to try to make it work, also i didnt program de butons to change the emojis yes i just tried to see if i could detect then.


#include <avr/pgmspace.h> 
#include "FastLED.h"

#define NUM_LEDS 192
#define DATA_PIN 7

CRGB leds[NUM_LEDS];


//--------------------------------------------------------------------------------------------------------------------------------------------------------------------


const long teste1[] PROGMEM =
{
  0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000,
  0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff,  
  0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 
  0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000,
  0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff,  
  0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00,
  0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000,
  0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff,  
  0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00,
  0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000, 0Xff0000,
  0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff, 0X0000ff,  
  0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00, 0X00ff00,
};


const long teste2[] PROGMEM =
{
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000,
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000,
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000,
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000,
  0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 0X00ff00, 0X0000ff, 0Xff0000, 
  0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000, 0X0000ff, 0X00ff00, 0Xff0000,
};


void setup() 
{
  FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(20);
}

void loop () 
{
//Primeiro teste frame 1
  for(int passtime = 0; passtime < 8; passtime++)
  {
    FastLED.clear();
    for(int i = 0; i < NUM_LEDS; i++)
    {
      leds[i] = pgm_read_dword(&(teste1[i]));
    }
    FastLED.show();
    delay(500);
  
  //primeiro teste frame 2
  
    FastLED.clear();
    for(int i = 0; i < NUM_LEDS; i++)
    {
      leds[i] = pgm_read_dword(&(teste2[i]));
    }
    FastLED.show();
    delay(500);
  }

 
}

If some one can help me i will apreciate, also i can send my discord if it is better to comunicate.

Using libraries is popular. Reading and handling the bounces of a button was exercise number one in the university course in microcomputers. No libraries available so learning and understanding was the only option.

Thanks for pics!

Don't use screen shots. They're often unreadable by different reasons. Use copy and paste, paste into code tags.

Post the code of today and tell what works and what doesn't work. Know that code should be documented, well commented and accompanied by things like flowcharts giving an overview of the code. Presenting code like this, You will never pass a test for any degree.

All communication should take place here. The aim for forum is helping members grow in skill and for other members to read the advice You get. Forum is not a private clinic fixing Your personal issues.

Hum, i see, well i didnt want to paass that impression im kinda new to arduino and i do want to learn more about it. I Thougth of tryng to find some help here that could explain me why the buttons are not working so i could fix it.
Yes i saw some information of about coding a button with out libraries but i tougth it would be ezear with the library, but i wil ltry to look for more information of how to do it with out libraries then.
But if you can give me some good information or help i wil lapreciate im plaing ofr learning more for some other projects i have for the future this one is justa little cosplay i want to try and see how it goes ^^

Hello Themode_PT
Take view here to get some ideas by using the Arduino examples provided by the IDE.

Have a nice day and enjoy programming in C++ and learning.
MIND THE GAP

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.