How to use Excel to Animate LEDs! Arduino + WS2812 LEDs

Ғылым және технология

I actually just created this excel utility to help create some cool animations for a halloween costume... It just generates the function calls to set the bytes properly in the LED array. Here's the links mentioned:
Original how-to video on the WS2812:
• Easy Addressable LEDs ...
Then something in the Arduino Core broke that sketch, so I fixed it in this video:
• Updating Arduino Broke...
The Excel file I used:
kevindarrah.com/download/ardu...
The CODE:
kevindarrah.com/download/ardu...
That 328 board for the costume here: www.tindie.com/products/14948/
Check out my Tindie store (trigBoard is available) www.tindie.com/stores/kdcircu...
Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
/ kdarrah
Twitter: / kdcircuits
For inquiries or design services:
www.kdcircuits.com

Пікірлер: 117

  • @Factory400
    @Factory4004 жыл бұрын

    Kevin - great job taking something that looks complicated and demonstrating that it can be simple if you break it all down. These kinds of things are so helpful when I get stuck on something that looks too complicated for me to solve. Take a deep breath and continue to break the problem down until it is sufficiently simple to solve.

  • @TheBATeam
    @TheBATeam4 жыл бұрын

    That was actually some crazy learning shit! Very very awesome brother... Hoping to get more detailed videos from you like this

  • @prototypeworkshop438
    @prototypeworkshop4384 жыл бұрын

    Hey man, your videos are great! I am really impressed by your projects and have joined as one of your patrons. Keep it up! I am keen to see some more videos on EMC, recently I had an industrial servo controlled by an 8bit micro go nuts when someone was arc welding nearby.

  • @GeekRedux
    @GeekRedux4 жыл бұрын

    Thanks for this informative and clearly explained video! And for the file links--very helpful!

  • @GaryParkin
    @GaryParkin4 жыл бұрын

    LOL, I thought it was just me that used Excel for some weird things like writing code. This is so cool! I love it. Very awesome indeed.

  • @edup2306
    @edup23064 жыл бұрын

    Awesome! This is the best explanation how to handle an animation! Congrats !

  • @DCDLaserCNC
    @DCDLaserCNC4 жыл бұрын

    Excellent video! That is very clever using Excel to aid in mapping the LEDs! Thank you for sharing!

  • @allensmithphotography
    @allensmithphotography4 жыл бұрын

    Thank you very much for sharing this insight. I have been noodling over a very similar situation with a project I'm working on for embellishing my bench power supply

  • @BigBoyTechToys
    @BigBoyTechToys4 жыл бұрын

    Kelvin....this project is very amazing to me, you keep me crazy

  • @hoctrimededebutry8655
    @hoctrimededebutry86554 жыл бұрын

    Hello from France :-) Always a great pleasure to watch your video ! Your explanations are clear. Thanks a lot

  • @jacobdavis000
    @jacobdavis0004 жыл бұрын

    Thanks! Awesome subject. I have the 8x32 array and haven't used yet, but you've helped me with the ideas to get mine working in 2d.

  • @avejst
    @avejst4 жыл бұрын

    Impressive work you have done as always Thanks for sharing :-)

  • @Chuzzlepuff
    @Chuzzlepuff2 жыл бұрын

    this tutorial was so thorough and helpful!

  • @certified-forklifter
    @certified-forklifter4 жыл бұрын

    that's excatly what i looked for. thanks for sharing.

  • @walterrldias
    @walterrldias4 жыл бұрын

    it blew my mind! i bought some pro minis and will give it a try...

  • @MakeDaley
    @MakeDaley4 жыл бұрын

    Awesome little tutorial thanks for sharing!

  • @tomkenney5365
    @tomkenney53654 жыл бұрын

    Nice. A little beyond my level now, but nice to see different options and ideas. Thanks.

  • @3dw3dw
    @3dw3dw4 жыл бұрын

    Wow! Thank you! This will save me hours and hours and hours.

  • @JeremyCook
    @JeremyCook4 жыл бұрын

    That is pretty clever. Nicely done.

  • @martijnvangorp
    @martijnvangorp4 жыл бұрын

    Hi! Great job! I did the same thing with a 24X24 matrix (9 matrixes of 8x8) but your arduino code is much simpler. SonI will use it ;-) I enjoyed integrating excel to create the code, fast and simple. Keep up the good work. Grtz from Belgium

  • @404-UsernameNotFound
    @404-UsernameNotFound Жыл бұрын

    Nice work. I know I am a bit late to the party, however here's an Excel tip. The CONCAT formula you can select a whole range of cells, thus eliminating the need to do multiple CONCATENATE. All you would need in cell H34 is =CONCAT(C23:C278).

  • @jaremi40
    @jaremi404 жыл бұрын

    excellent video right up my alley!

  • @SuperbonyTheCat
    @SuperbonyTheCat4 жыл бұрын

    thanks for your explanation, it helped me for my fire simulator --- 16x16 Matrix NeoPixel ws2812b + Arduino = fire simulation ---

  • @xmicks
    @xmicks4 жыл бұрын

    I recommend using nested for loops. One for the rows and one for the columns.

  • @mrromans9366
    @mrromans93662 жыл бұрын

    This is a very informative video, thank you Kevin! Now I'm trying to do this with 2 of these 16x16 panels connected to each other, any idea of how to modify your excel file to accommodate for this? Looking to have the 2 panels side by side so a 16x32 arrangement.

  • @tripore
    @tripore4 жыл бұрын

    Awesome work. Thanks ! How about having a 16x16 matrix button/lights, a physical UI panel which you could press to visually build the frame ?

  • @Diggnuts
    @Diggnuts4 жыл бұрын

    Finally something useful to do with bloody excel.

  • @tahreezzmurdifin52
    @tahreezzmurdifin523 жыл бұрын

    wow... now that's awesome

  • @mitchh6471
    @mitchh64714 жыл бұрын

    This is awesome. I must learn from you young grasshopper.

  • @JuraganLED
    @JuraganLED4 жыл бұрын

    nice trick! thanks for sharing

  • @Rouverius
    @Rouverius4 жыл бұрын

    Cool. It makes me wonder if you could add some basic anti-aliasing for the edges. For example, define another number for anti-aliasing. Let's say 2. Then when there is a "2" then it count the "1" in the surrounding cells. That value could be a multiplier for the final RGB value.

  • @JLPrototyping
    @JLPrototyping4 жыл бұрын

    Nice project! 👍

  • @ohweh6963
    @ohweh69633 жыл бұрын

    Hello, great job! Is there a possibility to mod your Excel file for using it with 8x8-Matrix?

  • @wreckless_-jl6uu
    @wreckless_-jl6uu4 жыл бұрын

    More videos like this plz.. 🤪💯

  • @haroldfinz4863
    @haroldfinz48634 жыл бұрын

    Excellent. I respect that you wrote code to write code. (I've been there... awk vrml TeX... all text-only) BUT - you used Excel to build a mouse-driven graphical input to a code-generator. That's a level higher. I've python'ed animations for an 8x8 SenseHat (Raspberry Pi), and that's why I'm impressed.

  • @Kevindarrah

    @Kevindarrah

    4 жыл бұрын

    thanks!

  • @GingerTyPerior
    @GingerTyPerior11 ай бұрын

    This is very helpful! Do you know of a way to adjust the identifier for an irregular matrix where the number for a blank space = 0? And for the excel sheet, is there a way to expand that to matrices of different sizes/rectangles? My grid ends up being 23x13 when accounting for blank spaces.

  • @Frazzy626
    @Frazzy6264 жыл бұрын

    This concept is exactly what I was looking for. Now the question is. If I built a custom WS2812 LED display board with different amounts of LEDS per column and Row Its it possible to modify the Excel spreadsheet to make it custom for each specific LED layout? For example instead of a 16x16 led display in your example video. I would be using a 16x08 on the first row 16x09 on the second row 16x10 on the third row etc etc. I need to work the leds tightly around a object and each board needs to be where I can solder each led at the correct angle as the display will need to be curved as well.

  • @Snail641
    @Snail6413 жыл бұрын

    Great job

  • @leondcarpenter
    @leondcarpenter2 жыл бұрын

    Love this video. I almost have it working. My question is which axis is across the top in the spreadsheet. I am doing a 4x13 matrix (4 across the top and 13 down the side and think I may be reversed.

  • @g.s.3389
    @g.s.33894 жыл бұрын

    compliments, complimenti ;)

  • @pixelled1142
    @pixelled11424 жыл бұрын

    very helpful sir

  • @gregorymompezat2261
    @gregorymompezat22614 жыл бұрын

    you should take a look at how .gif(djif) format works so that you can build a parser that convert a .gif animation (16px,16px) into an animation for your led matrix. this might be ez because you have a X,Y converter already writen. I hope to see this

  • @goranjosic
    @goranjosic19 сағат бұрын

    Super interesting video. I also work on wa2812B matrix, one even made custom from strip 22x22 px. Matrix animations in excel are a new thing for me and they look super interesting, especially for some pixel art solutions (I love retro gaming). For simpler things, like shapes and the like, it's probably better to stick to mathematical formulas for animation. _Edit, just to add, I have made pygame (game) version that can animate matrix in similar fashion, because python is my first language, I'm much worse with C, but I would like to make something similar in arduino, with some of the cheap touch screens. I will definitely try._

  • @MarekCzechyra
    @MarekCzechyra4 жыл бұрын

    Hello, nice project. I very like this concept. I think you can make it faster. You can check is row is odd or even by chcecking value of the youngest bit. Also shift value by 4 bits left give you result of multiply by 16. Probably compiler already did it for you under the hood. I prefer make such optimalisations directly in code. Esspecialy in 8 bit uc.

  • @bakisha
    @bakisha4 жыл бұрын

    I think writing animation per frame is really tedious. Yes, excel can help, and it's all easy if you have few dots moving around, but when i wanted to make plasma effect on RGB cube, it was far easier to write animations as results of some functions that microcontroller can calculate, not as hand-draw per frame value. For example, in code you show, you can make two loops, outer loop "radius" that goes from 0 to 7, and inner loop that goes from 0 to PI, draw some color at mapLEDXY (radius/2+radius*sin(x),radius/2+radius*cos(y),0,0,255) and clearLEDs() between loops. It should animate circles that goes from small circle in center to bigger circles. Colors can be also be changed as some functions, so it can be more intresting. But the point is, you are already using microcontroller to calculate things for your excel table, why not use it to calculate animations on-the-fly?

  • @siddharthdhaka

    @siddharthdhaka

    4 жыл бұрын

    I think , creating every pattern using math is difficult . tedious it is, but , we can do cool stuff with this. Think of creating a stick human and make him wave or make him jump. creating a function for that will be near impossible . [] \ | / |

  • @bakisha

    @bakisha

    4 жыл бұрын

    Well, i wouldn't say impossible. I just imagined your stick-man as 10 lines, each with it's own starting and ending x,y coords (or 14, if knees and elbows would make jump animation better ) . I admit i like pixelArt, and, few repeated frames animation on small resolution display is much faster to do as pre-calculated frames, but if you want 30 frames per seconds animation that last few minutes, it would be PITA to do it as hand-drawn frames.

  • @siddharthdhaka

    @siddharthdhaka

    4 жыл бұрын

    @@bakisha How will you make it wave one of it's hand?

  • @bakisha

    @bakisha

    4 жыл бұрын

    Starting point of line (let's say left hand) is fixed, ending point is loops from 0 to PI/2 , and from P/2 to 0. Calculate radius (length of arm), and calculate end coords as x=radius*sin(i) and y=radius*cos(i). Look it as quarter of circle, center is beginning of arm, end is calculated as sinus functions. Add PI/2 offset for right hand. Or PI/4 to all so hands start as at 45 angle. And once animation is made, it doesn't matter on what resolution it is played. It would look same on 16x16 and 64x64 panel.

  • @siddharthdhaka

    @siddharthdhaka

    4 жыл бұрын

    @@bakisha Your approach is nice . if i am understanding it right, wouldn't your function deform the whole stickman??.. or if not , how will we concentrate you function only on the hand and not deform any other part . let's say head is big and fall inside your quarter of the circle , where your hand will move. while writing this , some solutions came to my mind.. We need to take care of the cross-section of our stick man , to have success , without much headache . Symmetry will play quite a big role here . and for big head , we can reduce angle to something lesser than 60° ( 0 -60°) . some calibrations will be needed to find x and y chord , i guess.. but for asymmetrical figures it will be quite a headache to implement everything using math. Every character need to have its own defined Cross section , to facilitate applying further changes to it. we need to take care of all that. all this reminds me of games. their hit boxes and all other shit. :D Give your review on what i said. It was fun thinking and to have this constructive talk. Before your Mathematical analysis , my mind couldn't think of a way to do this using functions . Now i learned many things . which is nice :D .

  • @lars4999
    @lars49994 жыл бұрын

    Wow I didnt know what cool Things Exel also can do

  • @ggsggo
    @ggsggo4 жыл бұрын

    A cell can only display 255 characters. The order of data in a row can be reversed with an Index function/formula. Put this formula in B1 and copy it across to Q1. Have the row of data you want to reverse in B2:Q2. B1:Q1 will now hold the values in B2:Q2r but in reverse order. You can also make a function that returns the RGB or Hex color value. =INDEX($B$2:$Q$2,COLUMNS($B1:$Q$1))

  • @ZigZagZoccs
    @ZigZagZoccs4 жыл бұрын

    would this work for a 16x48 grid or is there another program to make animations on something like that?

  • @rolandtanguylannuzel5160
    @rolandtanguylannuzel5160 Жыл бұрын

    Nice idea but huge code generated. Maybe you could consider each row (or colum) as a uint16_t and each led position as a bit. Would take only 16 unsigned integer to describe a 16x16 matrix. Of course, you would have to adapt your code and test bits inside each integer. When == 1: switch ON when ==0 then switch OFF An extra parameter could define what to do with bits==0 : either switch off OR "do nothing" to keep previous leds ON if they were already lit. I'm working on such code and i'd be happy to share if interested. regards Roland (Paris, France)

  • @internetuser9015
    @internetuser90154 жыл бұрын

    Nice project brother ; But What's your project name ?

  • @dm6864
    @dm68643 жыл бұрын

    You video is amazing¡¡ How to do for a 32x8 matrix led?

  • @preinfinity
    @preinfinity3 жыл бұрын

    Can you make it so the value in the actual cells will be the color? Could you make something like "Green" be read as (0,255,0)?

  • @Dmirty1291
    @Dmirty12914 жыл бұрын

    круто. Вы знаете толк в извращениях. Я думал, что изображения будут генерироваться процедурно прямо на ардуинке

  • @melissaw546
    @melissaw5463 жыл бұрын

    Is there the possibility to use this script with the esp32? Because of the port manipulation.

  • @fallenlegend8371
    @fallenlegend83713 жыл бұрын

    does it any option to mix it with FastLED lybrary just want it to work with ws2801

  • @hammershigh
    @hammershigh4 жыл бұрын

    A column is vertical, a row is horizontal.

  • @marcsmithsonian9773

    @marcsmithsonian9773

    4 жыл бұрын

    Ql

  • @TheBATeam

    @TheBATeam

    4 жыл бұрын

    What if you are watching the grid from side? Its all relative!! 😅😅

  • @hammershigh

    @hammershigh

    4 жыл бұрын

    @@TheBATeam Obviously! Are you watching the grid from the side?

  • @TheBATeam

    @TheBATeam

    4 жыл бұрын

    @@hammershigh depends. .. what do you mean by side!

  • @ANTHONYBOOTH

    @ANTHONYBOOTH

    4 жыл бұрын

    unless you are laying on the sofa watching tv... :p

  • @betzalelzana2500
    @betzalelzana25003 жыл бұрын

    Where do I buy the LEDs from? PLS...

  • @karenpower2585
    @karenpower2585 Жыл бұрын

    can you post a link of the code to create the excel page? im not signed into microsoft so cant use the link for the premade excel page :)

  • @taranagnew436
    @taranagnew4364 жыл бұрын

    do you put the animation below void loop and how do you get red, green, blue or any other colour to show up in the animation?

  • @Kevindarrah

    @Kevindarrah

    4 жыл бұрын

    you can put your animation code in its own function before the loop from where you call it... or could put function below, but then you should use "function prototypes" - google that. The excel file can set the RGB color for each frame... or just use variables and set in code

  • @tekhawk7161
    @tekhawk71613 жыл бұрын

    how much of the code do i have to change if i wanted 8 x 32?

  • @moonmatthew
    @moonmatthew3 жыл бұрын

    exit status 1 'RGB' was not declared in this scope please help

  • @danieldiasdornelles5136
    @danieldiasdornelles51364 жыл бұрын

    Led cube 16x16x16?

  • @jfrefe3939
    @jfrefe39392 жыл бұрын

    Hello, I tried using your code provided, pasted it in Arduino IDE and loaded it to Arduino Leonardo but didn't displayed the "X" led on my 16x16 WS2812 matrix. just the 1st 10 leds full bright white. DIn at pin 8, RGB is grounded to GND pin and power source (No led on) if I pull out the GND from 16x16 to Arduino, it lights up the 1st 10 led. Any thoughts or I did something wrong? I'm sorry, not really good in coding at all.

  • @philnic8443
    @philnic84434 жыл бұрын

    Wouldn't matlab code be better for this?

  • @Nono-hk3is
    @Nono-hk3is4 жыл бұрын

    Back in the day, we would use this trick to quickly see if Y was even: if ((Y & 1) == 0) { // Do even thing } else { // Do odd thing } It works because in binary, all even numbers have 0 in the lowest bit, while odd numbers have a 1. Modulo operator has to do the entire division which at best was something like 3 instructions more than doing logical AND. It's very possible that by now compilers do this optimization for you, but worth a shot if you ever need more speed.

  • @Nono-hk3is

    @Nono-hk3is

    4 жыл бұрын

    Although now that I'm thinking about it, you could move the even/odd code into Excel so that Excel computes it once, turning the animation into a bunch of direct port stuffing calls. All of this assumes you need to get really fast animation for some reason.

  • @cattflap1447

    @cattflap1447

    4 жыл бұрын

    I still use that, very efficient.

  • @haroldfinz4863

    @haroldfinz4863

    4 жыл бұрын

    trivial code optimization is hardly the point of the video

  • @brijeshkhokhar
    @brijeshkhokhar4 жыл бұрын

    I saw STM32 development board on table.. , Can you make video about how to use STM32 microcontroller ?

  • @pcbdesignhub1847

    @pcbdesignhub1847

    4 жыл бұрын

    @Li Feng kzread.info/dash/bejne/X2GFpLiBpcfWnLQ.html

  • @johns3195
    @johns31952 жыл бұрын

    is this in live condition? or offline

  • @ghaliart281
    @ghaliart2813 жыл бұрын

    Does it apply relais??

  • @EngineerFromPakistan
    @EngineerFromPakistan14 күн бұрын

    how did you set up excel like that?

  • @leuizeknunes
    @leuizeknunes3 жыл бұрын

    hi there. It seems that your code does not work on ESP32. It reports "'PORTB' was not declared in this scope". Any quick fix for this?

  • @khayman68

    @khayman68

    3 жыл бұрын

    Did we ever get a resolution to this. I can't seem to get his code working on my Arduino Uno Wifi v2

  • @mmdnaderi7183
    @mmdnaderi71834 жыл бұрын

    I just think you should try visual studio for it? this idea just get into my mind? thank you

  • @cattflap1447

    @cattflap1447

    4 жыл бұрын

    +1 good idea

  • @kravtcovivan438
    @kravtcovivan4384 жыл бұрын

    Так, еще можно собственные шрифты делать.

  • @bthornet2
    @bthornet23 жыл бұрын

    Press ALT+ F11 in Excel for vba code. Visual basic.

  • @nevermind6270
    @nevermind62702 жыл бұрын

    This is a very ingenious and at the same time awful way of doing this. Something like that meme picture about android optimization.

  • @roderik1990
    @roderik19904 жыл бұрын

    How horrifying to use Excel for a task like this, when a simple script would do.

  • @alexanderislas4382

    @alexanderislas4382

    4 жыл бұрын

    I think that it's interesting as a concept and using different systems. Sure it could be easier, but you can learn something new when trying some different method.

  • @ClaytonBezui

    @ClaytonBezui

    4 жыл бұрын

    a lot of applications for this

  • @ergindemir7366
    @ergindemir73662 жыл бұрын

    Exceleduino

  • @JyrkiKoivisto
    @JyrkiKoivisto4 жыл бұрын

    I don't really get the problem... 16x16 matrix is easily indexed, either getting the index value from x/y co-ordinates or getting the x/y from a index value because of the 2's exponent and bit shifting.

  • @ggsggo
    @ggsggo3 жыл бұрын

    lets reinvent the wheel uint16_t XY(uint8_t xCol, uint8_t yRow) { uint16_t i; if( xCol %2 !=0) { // Odd colmns run backwards uint8_t reverseY = (mH - 1) - yRow; i = (xCol * mH) + reverseY; } else { // Even colmns run forwards i = (xCol * mH) + yRow; } return i; }

Келесі