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 most likely no translated for the post!





In need of assistan...
 
Share:
Notifications
Clear all

In need of assistance with a sketch -Addressable LED  

Page 1 / 2
  RSS

abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 10, 2019 11:06 PM  

Hi there,

i have a project that im busy with, im using 60 led's. I have tweaked a few sketches and have the project working satisfactory. I need help with a few items.

okay, so far, the animation does this:

New kitt animation from outside to center > comes in , in white and goes back in white twice, thereafter, the entire strip turns to amber and stays that way for 25 seconds before repeating itself.

The Application: On a subwoofer enclosure on my Mercedes Benz - It will switch ON when the trunk opens.

Due to the fast acting animation, i would like to delay the startup of the animation by 3seconds - im assuming turn all to black

secondly, when the strip turns to amber and stays solid, id like the first4 leds and last 4 leds to be white however it must be smooth blending - they will not move, just stay on for the 25 second time but 2 colors fused Amber to White.

lastly, when the 25 second time is up, i would like the led's to fade off then restart. Currently it just switches off instead of fade 


ReplyQuote
Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1437
July 11, 2019 12:49 AM  

Hi Abi,

This is a nice application indeed! I like it 

1) fast acting animation

You could add a delay(3000) before calling NewKITT(), or ... make the animation slower by modifying the "SpeedDelay" value.
Note that Delay works with milliseconds (1 second = 1000 milliseconds).

void loop() {
  setAll(0,0,0);
  Delay(3000);
  NewKITT(100, 150, 70, 8, 25, 2); //Second last value depicts speed of eye 
  RGBLoop();
}

2) I'd like the first 4 leds and last 4 leds to be white

You could try this code (you'll have to determine the color values to make it as smooth as you would like to see it);

void newRGBLoop() {
  setAll(0xff,20,0); // set all to amber
  // set first 4 and last 4 to a fade white to amber (you may have to tweak the calculation)
  for(int i=0; i<4; i++) {
     setPixel(i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4)); // 235 = 255 - 20, 20 for amber (from your code)
     setPixel(NUM_LEDS-1- i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4)); 
  }
  showStrip();
  delay(25000); // wait for 25 seconds
  setAll(0,0,0); // set all LEDs to black/off
}

As mentioned in the code, you may have to tweak the values for the calculation. Color/light isn't linear  so simply dividing it in equal steps may not give the wanted results. 

You could of course do this without a loop as well;

void newRGBLoop() {
  setAll(0xff,20,0); // set all to amber
  // set first 4 and last 4 to a fade white to amber (you may have to tweak the calculation)
  setPixel(0, 0xff, 0xff, 0xff);
  setPixel(NUM_LEDS-1, 0xff, 0xff, 0xff);
  setPixel(1, 0xff, 0xe7, 0xde);
  setPixel(NUM_LEDS-2, 0xff, 0xe7, 0xde);
  setPixel(2, 0xff, 0xac, 0x9c);
  setPixel(NUM_LEDS-3, 0xff, 0xac, 0x9c);
  setPixel(3, 0xff, 0x55, 0x42);
  setPixel(NUM_LEDS-4, 0xff, 0x55, 0x42f);
  showStrip();
  
  delay(25000); // wait for 25 seconds
  setAll(0,0,0); // set all LEDs to black/off
}

Note: I picked the colors with the color picker (here) based on your initial amber value (0xff,20,0).
It may need some fine tuning.

3. Fade out ...

For fading you can use the loop (you've already looked at it). The key being the starting color.

void FadeOut(byte red, byte green, byte blue){
  float r, g, b;
  for(int k = 255; k >= 0; k=k-2) {
    r = (k/256.0)*red;
    g = (k/256.0)*green;
    b = (k/256.0)*blue;
    setAll(r,g,b);
    showStrip();
  }
}

and call this after the delay(25000) in the previous example. Eg.

  FadeOut(0xff,20,00);

Granted, this kinda ruins the first 4 and the last 4 LEDs.
To accommodate those you'll need to expand the code a little, something like this;

void FadeOut() {
  for(int k=255; k>=0;k=k-2) {
    for(int i=0; i<NUM_LEDS, i++) {
      leds.r = max(0, leds.r - k);   // used "max" to make sure the value doesn't go below zero
      leds.g = max(0, leds.g - k); 
      leds.b = max(0, leds.b - k);  
    } showStrip();
  }
}

and we should be able to call it as such:

    FadeOut();

Note: I haven't tested any of these examples - I do not have my Arduino stuff handy at the moment.

Hope this helps ... 


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 11, 2019 1:58 AM  

Hi Hans,

I'm Truly grateful for your assistance. I will try it this evening and get back to you.

You guys Rock! Keep up the excellent work and thank you for all your help.

Cheers! 


ReplyQuote
Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1437
July 11, 2019 2:29 AM  

You're welcome 

I'm curious though what the end product will look like - I really like the idea. Maybe I'll do something like that for my car 


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 11, 2019 10:04 PM  

hi Hans,

thanks again, i will send a video once done. I haven't had a chance to add your code yest. I'll do  it over the weekend. I will message you though.

Thanks!


ReplyQuote



abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 16, 2019 7:00 AM  

Hi Hans, im busing adding the stuff you gave me. Theres an error coming up  when trying to add a 3 second delay on startup.

"Delay  was not declared in this scope"


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 16, 2019 7:13 AM  

Hi Hans, i have another error on the second bit of code


ReplyQuote
Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1437
July 16, 2019 11:30 PM  

Looks like I made a type - add a ")" (without the double quotes) before the ";" in the code of the highlighted line.

So the following line:

     setPixel(NUM_LEDS-1- i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4)); 

becomes:

     setPixel(NUM_LEDS-1- i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4))); // <- add ( here 

As for the error "delay not in scope"; it may be that the change above fixes that. If not then please post the full error message (should tell you the affected line number).


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 17, 2019 7:30 AM  

Hi Hans, I managed  to create the initial delay. Thereafter, i tried to add the code for the first 4 and last 4 leds to turn white. That didnt work however, after deleting that bit, my code was somehow altered. Error: setAll was not in the scope. I've attached it


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 17, 2019 7:39 AM  

Hi Hans, here is the entire sketch. Please see what you can do for me.
i have the delay. It works.
Just need, first 4 and last 4 to stay white (but slightly blended to white from amber)
thereafter, when the  25 sec timer is  up, they should all fade off, the start sequence again.

thanks!


ReplyQuote



Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1437
July 17, 2019 10:33 PM  

I have not yet been able to test the code, but maybe we should walk through the error messages, so you'd be able to debug.
So loaded your code into my Arduino IDE and did a test compile (menu: Sketch -> Verify/Compile) which resulted in these error messages:

Arduino: 1.8.7 (Mac OS X), Board: "Arduino/Genuino Uno"
In file included from /Users/hans/Documents/Arduino/sketch_jul18a/sketch_jul18a.ino:1:0:
/Users/hans/Documents/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.001
 # pragma message "FastLED version 3.002.001"
                     ^
/Users/hans/Documents/Arduino/sketch_jul18a/sketch_jul18a.ino: In function 'void newRGBLoop()':
sketch_jul18a:12:19: error: 'setAll' was not declared in this scope
   setAll(0xff,20,0); // set all to amber
                   ^
sketch_jul18a:16:59: error: expected ')' before ';' token
      setPixel(i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4); // 235 = 255 - 20, 20 for amber (from your code)
                                                           ^
sketch_jul18a:16:59: error: expected ')' before ';' token
sketch_jul18a:17:72: error: 'setPixel' was not declared in this scope
      setPixel(NUM_LEDS-1- i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4))); 
                                                                        ^
sketch_jul18a:19:13: error: 'showStrip' was not declared in this scope
   showStrip();
             ^
/Users/hans/Documents/Arduino/sketch_jul18a/sketch_jul18a.ino: At global scope:
sketch_jul18a:26:7: error: expected declaration before '}' token
       }
       ^
exit status 1
'setAll' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So let's go through these messages;

1) " # pragma message "FastLED version 3.002.001" "

This is just a message that we can ignore in this case.

2) "setAll(0xff,20,0); // set all to amber" (sketch_jul18a:12:19: error: 'setAll' was not declared in this scope)

You'll see that in the file "sketch_jul18a", line 12, at the 19th character of that line, setAll appears not defined.
Let's go through some more message to see if there is a connection with the other messages. After all "setAll()" is defined at the end of the sketch, so other typos/errors may cause this.

3) "setPixel(i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4);" (sketch_jul18a:16:59: error: expected ')' before ';' token)

As before, line 16 character 59; we're missing a ')' before the ';' character.

Easy fix, change line 16 to:

setPixel(i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4)));

We are actually missing 2 ')' ... you can see this in the IDE. When setting your text cursor at a ')', the editor will highlight the '(' that goes with it.
Keep this one in mind; forgetting a ')' or a ';' or '}' are quite common.

So, recompile/verify, and we will see; this did not fix the other problems, so let's continue.

4) "showStrip();" (expected declaration before '}' token)

This may be the culprit ... 

If we look at the code, you'll see there is a boo-boo there:

void setup()
{ delay(2000);
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}
void newRGBLoop() {
  setAll(0xff,20,0); // set all to amber
  // set first 4 and last 4 to a fade white to amber (you may have to tweak the calculation)
  for(int i=0; i<4; i++) {
     setPixel(i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4))); // 235 = 255 - 20, 20 for amber (from your code)
     setPixel(NUM_LEDS-1- i, 0xff, 255 - (i*(235/4)), 255 - (i*(255/4))); 
  }
  showStrip();
  
  delay(25000); // wait for 25 seconds
  setAll(0,0,0); // set all LEDs to black/off
}
       
        
      }
      showStrip();
      delay(25); //time of strip to stay on
    }
    
    // Fade OUT
    for(int k = 255; k >= 0; k--) { 
      switch(j) { 
        case 0: setAll(0xff,25,0); break;
        
        
      }
      showStrip();
      delay(25); //time for strip to stay on
    }
  }
}

The bold section has no place to below to ... I assume you pasted some of the code in, but forgot to adapt or delete some of the old code.

Unfortunately, this doesn't resolve things yet.

5) undefined reference to `loop'

After removing the bold code in the step 4, we get a new error message, and this one is straight forward: the linker (ld) cannot find the "loop()" function in your code!

/var/folders/xb/gtxmm97s5ml1fmn0j78cck5h0000gn/T//cc0oU02c.ltrans0.ltrans.o: In function `main':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/main.cpp:46: undefined reference to `loop'
collect2: error: ld returned 1 exit status
exit status 1

Renaming "newRGBLoop" to "loop" fixes the issue.

Now, since I cannot test this, I'm not sure if this is what you were looking for.
However; lesson learned; be careful when pasting code, to not make a mess of things.
And with this walk through you may become more comfortable trying to read and debug error messages.


ReplyQuote
abi
 abi
(@abi)
Active Member
Joined: 1 year ago
Posts: 8
July 22, 2019 9:01 PM  

Hi Hans, Once again, thanks a million for all your efforts. I cannot tell you how pleased i am getting assistance in this regard.

i havent tried the changes as yet since im pushing to get the install complete..i have the running in white and settling at amber. Once im complete with the install, i can play with the  programming.

will chat soon! Take care


ReplyQuote
ppgflyer68
(@ppgflyer68)
Active Member
Joined: 3 months ago
Posts: 5
April 29, 2020 1:32 AM  

i have the Lumini APA102 3 inch (77mm) 60 RGB LED ring (available from sparkfun) i want to use for a clock. i know the code works, and works correctly with a 6 3/4 inch (172mm) 60 RGB LED ring that uses WS2811 LEDs. the issue i am having is that the 3 inch ring is manufactured in a counter clockwise direction apposed to the 6 3/4 inch ring manufactured in the clockwise direction. i have tried using for (int i = 59; i >= 0 ; i–) and/or for (int i = 0; i < numLEDs; i++) to try and reverse the direction of data flow. neither one has any effect and i am guessing it is because in the code, it is the time (hour, minute, seconds) that tell which LED is to be lit up, and when.

i have also tried playing with ARRAY, CRGBSet, and a few other possible tricks to tell the ring which way to run. all i run into are errors or having no effect as well…. any ideas?

Adafruit Trinket Pro 16Mhz - Arduino IDE 1.8.12

#include <FastLED.h>
#include <Wire.h>
#include <RTClib.h>
#include <EEPROM.h>
#include <Encoder.h>

DS3231 RTC;

#define DATA_PIN 6 //for 2 wire LED strips/rings
#define CLOCK_PIN 5
//#define LEDStripPin 8 //for single wire LED strips/rings
#define numLEDs 60 //number of LEDs in the strip/ring

//Setting up the LED strip
struct CRGB leds[numLEDs];
Encoder rotary1(10, 11); //setting up the Rotary Encoder
DateTime old; //Variable to compare new and old time, to see if it has moved on
int rotary1Pos = 0;
int subSeconds; //60th's of a second
long newSecTime; //Variable to record when a new second starts, allowing to create milli seconds
long oldSecTime;
#define clockState 0
int cyclesPerSec; // for use with different clock display modes
float cyclesPerSecFloat; // So can be used as a float in calcs
float fracOfSec; // for use with different clock modes
int timeHour;
int timeMin;
int timeSec;
int modeAddress = 0; // Address of where mode is stored in the EEPROM
long currentMillis;
long previousMillis = 0;
int state = 0;
int mode; // Variable of the display mode of the clock
int modeMax = 3; // Change this when new modes are added. This is so selecting modes can go back beyond.
int advanceMove = 0;
long lastRotary;
int rotaryTime = 1000;
int LEDPosition;
int fiveMins;
int LEDOffset = 30; // change this to allow differant led ring mounting, 30 for wires at the bottom, 0 for wires at the top

void setup()
{
// Set up all pins

// Start LEDs, uncomment to change type of LEDs being used and comment out the unused LED type.
// LEDS.addLeds<WS2811, LEDStripPin, GRB>(leds, numLEDs); // Structure of the LED data. I have changed to from rgb to bgr, as using an alternative LED strip. Test & change these if you're getting different colors.
LEDS.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, numLEDs);

// Start RTC
Wire.begin(); // Starts the Wire library allows I2C communication to the Real Time Clock
RTC.begin(); // Starts communications to the RTC

Serial.begin(9600); // Starts the serial communications

// Uncomment to reset all the EEPROM addresses. You will have to comment again and reload, otherwise it will not save anything each time power is cycled
// write a 0 to all 512 bytes of the EEPROM
// for (int i = 0; i < 512; i++)
// {EEPROM.write(i, 0);}

// Load any saved setting since power off, such as mode & alarm time
mode = EEPROM.read(modeAddress); // The mode will be stored in the address "0" of the EEPROM

}

void loop()

{

DateTime now = RTC.now(); // Fetches the time from RTC

rotary1Pos = rotary1.read(); // Checks the rotary position

if (rotary1Pos <= -4 && lastRotary - millis() >= rotaryTime)
{
advanceMove = -1;
rotary1.write(0);
lastRotary = millis();
}
if (rotary1Pos >= 4 && lastRotary - millis() >= rotaryTime)
{
advanceMove = 1;
rotary1.write(0);
lastRotary = millis();
}
{
switch (mode)

case clockState: // State 0

if (advanceMove == -1 && mode == 0)
{
mode = modeMax;
advanceMove = 0;
}
else (advanceMove != 0);
{
mode = mode + advanceMove;
EEPROM.write(modeAddress, mode);
advanceMove = 0;
}
}

{
timeDisplay(now);
}
// Update LEDs;
LEDS.show();
memset(leds, 0, numLEDs * 3);
}

void clearLEDS()
{
for (int i = 0; i < numLEDs; i++) // set all LEDs to off
{
leds[i].r = 0;
leds[i].g = 0;
leds[i].b = 0;
}
}

void timeDisplay(DateTime now)
{
switch (mode)
{
case 0:
outlineClock(now); // displays white at the 12 hour marks around the clock face, red for hour, green for minutes, and blue for seconds
break; // the hour is displayed with 3 red leds just to stand out as being the hour indicator, the two on either side of the center red led are slightly dimmer
case 1:
outlineDSTClock(now); //displays the same as above, only one hour earlier for day light savings time
break;
case 2:
minimalClock(now); // displays just one red led for the hour, green for minute, and blue for seconds
break;
case 3:
minimalDSTClock(now); //displays the same as above, only one hour earlier for day light savings time
break;

default: // Keep this here and add more timeDisplay modes as defined cases.
{
mode = 0;
}
}
}

void outlineClock(DateTime now)

{
// for (int i = 59; i >= 0 ; i--)
for (int i = 0; i < numLEDs; i++)
{
fiveMins = i % 5;
if (fiveMins == 0)
{
leds[i].r = 5;
leds[i].g = 5;
leds[i].b = 5;
}
}
if (now.second() != old.second())
{
old = now;

}

// set hour, min & sec LEDs
unsigned char hourPos = ((now.hour() % 12) * 5 + (now.minute() + 6) / 12);
leds[(hourPos + LEDOffset + 59) % 60].r = 10;
leds[(hourPos + LEDOffset) % 60].r = 20;
leds[(hourPos + LEDOffset + 1) % 60].r = 10;
leds[(now.minute() + LEDOffset) % 60].g = 20;
leds[(now.second() + LEDOffset) % 60].b = 20;

}

void outlineDSTClock(DateTime now)
{
//for (int i = numLEDs - 1; i > -1; i--)
for (int i = 0; i < numLEDs; i++)
{
fiveMins = i % 5;
if (fiveMins == 0)
{
leds[i].r = 5;
leds[i].g = 5;
leds[i].b = 5;
}
}
if (now.second() != old.second())
{
old = now;

}

// set hour, min & sec LEDs
unsigned char hourPos = ((now.hour() % 12) * 5 + (now.minute() + 6) / 12);
leds[(hourPos + LEDOffset + 54) % 60].r = 10;
leds[(hourPos + LEDOffset + 55) % 60].r = 20;
leds[(hourPos + LEDOffset + 56) % 60].r = 10;
leds[(now.minute() + LEDOffset) % 60].g = 20;
leds[(now.second() + LEDOffset) % 60].b = 20;
}
void minimalClock(DateTime now)
{
unsigned char hourPos = (now.hour() % 12) * 5;
leds[(hourPos + LEDOffset) % 60].r = 10;
leds[(now.minute() + LEDOffset) % 60].g = 10;
leds[(now.second() + LEDOffset) % 60].b = 10;
}
//
void minimalDSTClock(DateTime now)
{
unsigned char hourPos = (now.hour() % 12) * 5;
leds[(hourPos + LEDOffset + 55) % 60].r = 10;
leds[(now.minute() + LEDOffset) % 60].g = 10;
leds[(now.second() + LEDOffset) % 60].b = 10;
}

 

in essence, what i need for this sketch is a way to basiclly tell the led ring that LED0 is LED59,  LED1 is LED58, LED2 is LED57............. LED57 is LED2, LED58 is LED1, LED59 is LED0

so that the clock would run the correct direction


ReplyQuote
Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1437
April 29, 2020 7:10 AM  

From what I can see, looking at this function:

void outlineClock(DateTime now)
{
// for (int i = 59; i >= 0 ; i--)
for (int i = 0; i < numLEDs; i++)
{
fiveMins = i % 5;
if (fiveMins == 0)
{
leds[i].r = 5;
leds[i].g = 5;
leds[i].b = 5;
}
}

if (now.second() != old.second())
{
old = now;
}

// set hour, min & sec LEDs
unsigned char hourPos = ((now.hour() % 12) * 5 + (now.minute() + 6) / 12);
leds[(hourPos + LEDOffset + 59) % 60].r = 10;
leds[(hourPos + LEDOffset) % 60].r = 20;
leds[(hourPos + LEDOffset + 1) % 60].r = 10;
leds[(now.minute() + LEDOffset) % 60].g = 20;
leds[(now.second() + LEDOffset) % 60].b = 20;
}

The first for-loop draws the "5" markers on the clock. So turning it around should give the same result indeed.

The "// set hour, min & sec LEDs" section is where the hour/minute/second is drawn. I think.
Since you want the reverse order, you could try this (untested!):

  // set hour, min & sec LEDs
unsigned char hourPos = ((now.hour() % 12) * 5 + (now.minute() + 6) / 12);
leds[NUM_LEDS - ( (hourPos + LEDOffset + 59) % 60 )].r = 10;
leds[NUM_LEDS - ( (hourPos + LEDOffset) % 60 )].r = 20;
leds[NUM_LEDS - ( (hourPos + LEDOffset + 1) % 60 )].r = 10;
leds[NUM_LEDS - ( (now.minute() + LEDOffset) % 60 )].g = 20;
leds[NUM_LEDS - ( (now.second() + LEDOffset) % 60 )].b = 20;

I didn't do the math yet (I need more coffee to be awake enough 😊 ), but I assume the original math was correct.
Of course all this under the assumption you use mode = 0.

I hope this fixes it, or gets you started in the right direction.


ReplyQuote
ppgflyer68
(@ppgflyer68)
Active Member
Joined: 3 months ago
Posts: 5
April 29, 2020 7:59 AM  

well, i made the changes and when i compiled it. 

Arduino: 1.8.12 (Windows 10), Board: "Pro Trinket 5V/16MHz (USB)"

In file included from C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino:1:0:

C:\Users\Owner\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003

# pragma message "FastLED version 3.003.003"

^~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino: In function 'void outlineClock(DateTime)':

codetesting2:168:8: error: 'NUM_LEDS' was not declared in this scope

leds[NUM_LEDS - ((hourPos + LEDOffset + 59) % 60)].r = 10;

^~~~~~~~

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino:168:8: note: suggested alternative: 'HUE_RED'

leds[NUM_LEDS - ((hourPos + LEDOffset + 59) % 60)].r = 10;

^~~~~~~~

HUE_RED

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino: In function 'void outlineDSTClock(DateTime)':

codetesting2:197:8: error: 'NUM_LEDS' was not declared in this scope

leds[NUM_LEDS - ((hourPos + LEDOffset + 54) % 60)].r = 10;

^~~~~~~~

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino:197:8: note: suggested alternative: 'HUE_RED'

leds[NUM_LEDS - ((hourPos + LEDOffset + 54) % 60)].r = 10;

^~~~~~~~

HUE_RED

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino: In function 'void minimalClock(DateTime)':

codetesting2:206:8: error: 'NUM_LEDS' was not declared in this scope

leds[NUM_LEDS - ((hourPos + LEDOffset) % 60)].r = 10;

^~~~~~~~

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino:206:8: note: suggested alternative: 'HUE_RED'

leds[NUM_LEDS - ((hourPos + LEDOffset) % 60)].r = 10;

^~~~~~~~

HUE_RED

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino: In function 'void minimalDSTClock(DateTime)':

codetesting2:214:8: error: 'NUM_LEDS' was not declared in this scope

leds[NUM_LEDS - ((hourPos + LEDOffset + 55) % 60)].r = 10;

^~~~~~~~

C:\Users\Owner\Documents\Arduino\codetesting2\codetesting2.ino:214:8: note: suggested alternative: 'HUE_RED'

leds[NUM_LEDS - ((hourPos + LEDOffset + 55) % 60)].r = 10;

^~~~~~~~

HUE_RED

exit status 1
'NUM_LEDS' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

ReplyQuote



Page 1 / 2
Share: