I'm hoping that I can start this thread in hopes to obtain support with pushing me through on this learning adventure. I am not a professional programmer, just a guy messing around trying to have some fun.
My question is twofold:
1.) Is there a table limit on concatenation and/or a workaround.
2.) See below regarding string.char
I'm starting by trying to control an RGB strip. My goal is to create a "cylon" or "larson" scanner, which I managed to do on the Arduino platform seen here --> https://www.youtube.com/watch?v=gAFo6edl3eA
I thought it would be fun to attempt this on the LUA ESP8266 platform. I started by rolling through the leds on a small table of 15 leds. When I manged to get that functioning, I pumped it up to my full length of 37 LEDs.
Q1) Is there a limit? I'm setting up values in a table, then I blast those values to the processor. It seems that the concatenate has a resrtiction past a certain number... something like 32 (forgot actual number). because when I add onto the table concatenate string past this magic number, it crashes producing an error.
This is just a snippet. For example, you don't see that I'm setting o=string.char(0,0,0).
for pos=1,led_len do
for i=1,led_len do n[i]=o end -- set entire table to zero (led off)
ws2812.writergb(1,n[1]..n[2]..n[3]..n[4]..n[5]..n[6]..n[7]..n[8]..n[9]..n[10]..n[11]..n[12]..n[13]..n[14]..n[15]..n[16]..n[17]..n[18]..n[19]..n[20]..n[21]..n[22]..n[23]..n[24]..n[25]..n[26]..n[27]..n[28]..n[29]..n[30]..n[31]..n[32]..n[33])
end
Q2) Can I send a string to the strip? Instead of manipulating string.char values, I thought it might be easier to manipulate a complete string. Ie; instead of sending 255,0,0 to the rgb strip, can I simply send the string equivalant, or "ÿ"?
3rd bonus question: Am I going about this completely incorrect?
Please be patient with me. I am a complete beginner!