NUM_LEDS value in LED-Strip Sketch can not be more than "201"?
-
Are you getting a message regarding low memory when uplpading?
Looks like you might be using an atmega328. It has a total of 2kB ram.
201 pixels use 603 bytes, plus another 201 for the heat so 804 bytes. That could very well be at the limit.
When verifying the sketch, you should get something similar to this:
Global variables use 1278 bytes (62%) of dynamic memory, leaving 770 bytes for local variables. Maximum is 2048 bytes. -
Are you getting a message regarding low memory when uplpading?
Looks like you might be using an atmega328. It has a total of 2kB ram.
201 pixels use 603 bytes, plus another 201 for the heat so 804 bytes. That could very well be at the limit.
When verifying the sketch, you should get something similar to this:
Global variables use 1278 bytes (62%) of dynamic memory, leaving 770 bytes for local variables. Maximum is 2048 bytes.actually i am using a nano.
it tells me:
Sketch uses 18372 bytes (59%) of program storage space. Maximum is 30720 bytes. Global variables use 1070 bytes (52%) of dynamic memory, leaving 978 bytes for local variables. Maximum is 2048 bytes.but there is no warning...
using wait(...) instead of delay(...) just gives me "wait can not be used as a function arduino" and nothing compiles... did you mean millis(...)?
-
@zen85 could it be you have an overflow somewhere. You multiply num_leds by another value into an int, perhaps that should be a long
-
actually i am using a nano.
it tells me:
Sketch uses 18372 bytes (59%) of program storage space. Maximum is 30720 bytes. Global variables use 1070 bytes (52%) of dynamic memory, leaving 978 bytes for local variables. Maximum is 2048 bytes.but there is no warning...
using wait(...) instead of delay(...) just gives me "wait can not be used as a function arduino" and nothing compiles... did you mean millis(...)?
-
@zen85 that is strange. Are you using the latest drivers?
See wait here
https://www.mysensors.org/download/sensor_api_20@electrik
its indeed strange.
i am using 2.3.1 - so this should be ok.... i replaced delay(wait) with wait(wait) which throws:
"'wait' cannot be used as a function"my nano uses the "atmega328p (Old Bootloader)" as processor... could that be an issue but i dont see how...?
-
@electrik
its indeed strange.
i am using 2.3.1 - so this should be ok.... i replaced delay(wait) with wait(wait) which throws:
"'wait' cannot be used as a function"my nano uses the "atmega328p (Old Bootloader)" as processor... could that be an issue but i dont see how...?
@zen85 said in NUM_LEDS value in LED-Strip Sketch can not be more than "201"?:
@electrik
its indeed strange.
i am using 2.3.1 - so this should be ok.... i replaced delay(wait) with wait(wait) which throws:
"'wait' cannot be used as a function"my nano uses the "atmega328p (Old Bootloader)" as processor... could that be an issue but i dont see how...?
ok... i see why wait(wait) was a problem... i displaced the variable "wait" with another one and then it compiles... but it has no impact on the issue.
i also checked out the limit again... it actually works up to 207 leds... more than that and it breaks...
-
I'm starting to run out of ideas... Is it just the flames that stop working, or is the normal dining still working (when you disable the flames code).
It seems to me the mysensors task maybe takes to much time from the led strip library, which is quite time critical -
Seems like teh Arduino IDE is unable to calculate the memory usage for the Adafruit led strip object.
When the Arduino IDE outputs
Global variables use 1078 bytes (52%) of dynamic memory, leaving 970 bytes for local variables. Maximum is 2048 bytes
it has not added the 603 bytes used by the Adafruit led strip object. So the real usage is 1 681 bytes which is 82%.Some general information on how Arduino memory works https://learn.adafruit.com/memories-of-an-arduino/optimizing-program-memory but there is not much you can do except switching to a mcu with more ram.
-
I'm starting to run out of ideas... Is it just the flames that stop working, or is the normal dining still working (when you disable the flames code).
It seems to me the mysensors task maybe takes to much time from the led strip library, which is quite time criticalits exactly as you guys say. taking a mega solves my issue and thats fine. i work with arduinos for many years now but its the first time i ran out of storage so i did not have this on the radar. i also learned much about arduinos with that issue. i guess thats a huge thanks for steering me into the right direction.
-
its exactly as you guys say. taking a mega solves my issue and thats fine. i work with arduinos for many years now but its the first time i ran out of storage so i did not have this on the radar. i also learned much about arduinos with that issue. i guess thats a huge thanks for steering me into the right direction.
-
learning is the most fun part of Arduino (at least for me) :-)
Great work! If you have the time, you're very welcome to share a photo or video of your project. I have gotten a lot of inspiration from stuff other people have made.
@mfalkvidd
i will definetly do that within the next days.