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

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2019
  • 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 116

  • @Factory400
    @Factory400 4 ปีที่แล้ว +4

    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
    @TheBATeam 4 ปีที่แล้ว +15

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

  • @GaryParkin
    @GaryParkin 4 ปีที่แล้ว +2

    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.

  • @prototypeworkshop438
    @prototypeworkshop438 4 ปีที่แล้ว +1

    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.

  • @BigBoyTechToys
    @BigBoyTechToys 4 ปีที่แล้ว +1

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

  • @hoctrimededebutry8655
    @hoctrimededebutry8655 4 ปีที่แล้ว +1

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

  • @edup2306
    @edup2306 4 ปีที่แล้ว

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

  • @GeekRedux
    @GeekRedux 4 ปีที่แล้ว

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

  • @DCDLaserCNC
    @DCDLaserCNC 4 ปีที่แล้ว

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

  • @Chuzzlepuff
    @Chuzzlepuff 2 ปีที่แล้ว

    this tutorial was so thorough and helpful!

  • @allensmithphotography
    @allensmithphotography 4 ปีที่แล้ว

    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

  • @JeremyCook
    @JeremyCook 4 ปีที่แล้ว

    That is pretty clever. Nicely done.

  • @jacobdavis000
    @jacobdavis000 4 ปีที่แล้ว

    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.

  • @certified-forklifter
    @certified-forklifter 4 ปีที่แล้ว +1

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

  • @MakeDaley
    @MakeDaley 4 ปีที่แล้ว

    Awesome little tutorial thanks for sharing!

  • @xmicks
    @xmicks 4 ปีที่แล้ว

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

  • @avejst
    @avejst 4 ปีที่แล้ว

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

  • @3dw3dw
    @3dw3dw 4 ปีที่แล้ว +1

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

  • @jaremi40
    @jaremi40 4 ปีที่แล้ว

    excellent video
    right up my alley!

  • @walterrldias
    @walterrldias 4 ปีที่แล้ว

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

  • @tomkenney5365
    @tomkenney5365 4 ปีที่แล้ว

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

  • @martijnvangorp
    @martijnvangorp 4 ปีที่แล้ว

    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

  • @SuperbonyTheCat
    @SuperbonyTheCat 4 ปีที่แล้ว

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

  • @mitchh6471
    @mitchh6471 4 ปีที่แล้ว

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

  • @tripore
    @tripore 4 ปีที่แล้ว +1

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

  • @404-UsernameNotFound
    @404-UsernameNotFound ปีที่แล้ว +1

    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).

  • @mrromans9366
    @mrromans9366 2 ปีที่แล้ว +1

    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.

  • @JLPrototyping
    @JLPrototyping 4 ปีที่แล้ว

    Nice project! 👍

  • @Diggnuts
    @Diggnuts 4 ปีที่แล้ว

    Finally something useful to do with bloody excel.

  • @tahreezzmurdifin52
    @tahreezzmurdifin52 3 ปีที่แล้ว

    wow... now that's awesome

  • @JuraganLED
    @JuraganLED 4 ปีที่แล้ว

    nice trick! thanks for sharing

  • @Rouverius
    @Rouverius 4 ปีที่แล้ว

    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.

  • @Snail641
    @Snail641 3 ปีที่แล้ว

    Great job

  • @GingerTyPerior
    @GingerTyPerior ปีที่แล้ว

    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.

  • @g.s.3389
    @g.s.3389 4 ปีที่แล้ว

    compliments, complimenti ;)

  • @wreckless_-jl6uu
    @wreckless_-jl6uu 4 ปีที่แล้ว +3

    More videos like this plz.. 🤪💯

  • @pixelled1142
    @pixelled1142 4 ปีที่แล้ว

    very helpful sir

  • @ohweh6963
    @ohweh6963 3 ปีที่แล้ว

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

  • @leondcarpenter
    @leondcarpenter 2 ปีที่แล้ว

    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.

  • @Frazzy626
    @Frazzy626 4 ปีที่แล้ว

    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.

  • @haroldfinz4863
    @haroldfinz4863 4 ปีที่แล้ว

    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.

  • @ZigZagZoccs
    @ZigZagZoccs 4 ปีที่แล้ว

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

  • @lars4999
    @lars4999 4 ปีที่แล้ว

    Wow I didnt know what cool Things Exel also can do

  • @goranjosic
    @goranjosic 20 วันที่ผ่านมา

    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._

  • @preinfinity
    @preinfinity 3 ปีที่แล้ว

    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)?

  • @melissaw546
    @melissaw546 3 ปีที่แล้ว

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

  • @dm6864
    @dm6864 3 ปีที่แล้ว

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

  • @fallenlegend8371
    @fallenlegend8371 3 ปีที่แล้ว

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

  • @gregorymompezat2261
    @gregorymompezat2261 4 ปีที่แล้ว

    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

  • @jfrefe3939
    @jfrefe3939 2 ปีที่แล้ว

    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.

  • @MarekCzechyra
    @MarekCzechyra 4 ปีที่แล้ว

    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.

  • @ggsggo
    @ggsggo 4 ปีที่แล้ว

    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))

  • @taranagnew436
    @taranagnew436 4 ปีที่แล้ว

    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

  • @internetuser9015
    @internetuser9015 4 ปีที่แล้ว

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

  • @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 :)

  • @tekhawk7161
    @tekhawk7161 3 ปีที่แล้ว

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

  • @EngineerFromPakistan
    @EngineerFromPakistan หลายเดือนก่อน

    how did you set up excel like that?

  • @bakisha
    @bakisha 4 ปีที่แล้ว +6

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      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 .

  • @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)

  • @moonmatthew
    @moonmatthew 3 ปีที่แล้ว

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

  • @philnic8443
    @philnic8443 4 ปีที่แล้ว

    Wouldn't matlab code be better for this?

  • @betzalelzana2500
    @betzalelzana2500 3 ปีที่แล้ว

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

  • @Dmirty1291
    @Dmirty1291 4 ปีที่แล้ว

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

  • @johns3195
    @johns3195 2 ปีที่แล้ว

    is this in live condition? or offline

  • @brijeshkhokhar
    @brijeshkhokhar 4 ปีที่แล้ว +11

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

    • @pcbdesignhub1847
      @pcbdesignhub1847 4 ปีที่แล้ว

      @Li Feng th-cam.com/video/--QBVHudplQ/w-d-xo.html

  • @ghaliart281
    @ghaliart281 3 ปีที่แล้ว

    Does it apply relais??

  • @danieldiasdornelles5136
    @danieldiasdornelles5136 4 ปีที่แล้ว

    Led cube 16x16x16?

  • @Nono-hk3is
    @Nono-hk3is 4 ปีที่แล้ว +3

    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

  • @leuizeknunes
    @leuizeknunes 3 ปีที่แล้ว

    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

  • @hammershigh
    @hammershigh 4 ปีที่แล้ว +36

    A column is vertical, a row is horizontal.

    • @marcsmithsonian9773
      @marcsmithsonian9773 4 ปีที่แล้ว

      Ql

    • @TheBATeam
      @TheBATeam 4 ปีที่แล้ว +6

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

    • @hammershigh
      @hammershigh 4 ปีที่แล้ว +2

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

    • @TheBATeam
      @TheBATeam 4 ปีที่แล้ว +1

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

    • @ANTHONYBOOTH
      @ANTHONYBOOTH 4 ปีที่แล้ว +2

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

  • @mmdnaderi7183
    @mmdnaderi7183 4 ปีที่แล้ว +1

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

  • @kravtcovivan438
    @kravtcovivan438 4 ปีที่แล้ว

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

  • @bthornet2
    @bthornet2 3 ปีที่แล้ว

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

  • @nevermind6270
    @nevermind6270 2 ปีที่แล้ว

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

  • @roderik1990
    @roderik1990 4 ปีที่แล้ว +2

    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
    @ergindemir7366 2 ปีที่แล้ว

    Exceleduino

  • @JyrkiKoivisto
    @JyrkiKoivisto 4 ปีที่แล้ว

    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
    @ggsggo 3 ปีที่แล้ว

    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;
    }