Easy Addressable LEDs with Arduino! WS2812B Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ค. 2024
  • UPDATE - I was using Arduino 1.83 recently and found that my code doesn't work as well - make sure you are using 1.67!!
    UPDATE - check this out for the simple fix: • Updating Arduino Broke...
    In this video, I'll show you how I was able to control the famous WS2812B addressable LED using a standard ATMEGA328P running at 16MHz. Yea, I know it's been done before, but what's the fun in that... Here's my 2 cents in how I I did it, plus this is super easy code. Just drop the function in and you're pretty much ready to go. Look for more videos coming up - I plan on working with an FPGA to control 1000's of these LEDs - should be pretty cool. Let me know in the comments below how this method works out for you.
    Here's the datasheet for the LED I'm working with:
    www.world-semi.com/uploads/sof...
    World Semi:
    www.world-semi.com/en/
    Google WS2812B in Ebay to find a similar panel that I used in the video.
    The CODE is HERE:
    kevindarrah.com/download/ardui...
    NOTE: This has only been tested with 45 LEDs, but should work with as many LEDs as you want. This code has only been tested with the ATMEGA328P-PU running at 16MHz. Using Digital Pin 8 for the Data line to the WS2812B is only supported at this time. I'm 99% sure the LEDs I was testing with are WS2812B's but since the panels are not marked, I could be wrong. Again, let me know how it works out for you.
    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
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @davewreski6900
    @davewreski6900 6 ปีที่แล้ว +3

    Kevin, WoW! This is the very first time I have seen anyone, yes, anyone that has done a great project without a library for help. You have brought true fun of programming a good project back to all of us and proved it can be done, without any help. Thank you.

  • @garthhowe297
    @garthhowe297 8 ปีที่แล้ว

    Wow...finally finished the video...great work. I ordered some of these leds tonight. I now need to look through your code, and watch the video again. I would not have expected you would achieve the needed timing.

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

    It is really wonderful that you have grasped so thoroughly these concepts and take the time to explain them to others. Thanks!

  • @axelsolhall5830
    @axelsolhall5830 5 ปีที่แล้ว +2

    This video is so amazing! To be able to control LEDs from scratch was just what I needed so I can continue building my circuit and code without relying on libraries and the like. Subbed and favorited!

  • @MPElectronique
    @MPElectronique 8 ปีที่แล้ว +5

    I really like your videos, they are from scratch! :) thank you!!!

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

    I see the driver code - looks great, and clever to use the for loop instead of "wasting" cycles with NOPs. Where can we find an example .ino code that uses your function to create light patterns?

  • @AtomkeySinclair
    @AtomkeySinclair 6 ปีที่แล้ว +2

    I love code like this. Excellent. Nudging NOPs in here and there to get the timing right is something I'm familiar with on old 8088 machines. Not exactly science, kinda like black electrical tape for code - but the thing is, it is 'exactingly' repeatable. So what if it isn't on the micron, the entire universe is analog anyway. The fact that it's 'just right' makes the code eloquent and even alive in its own aspect, because if you move the code to another processor it will behave differently. This is the art of the true programmer. Well done sir. It's been a while since I've seen it in action.

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

    Great tutorial and EVEN better! I did get this to work on an ATTiny85! I modified the sample to work on my small panel with 40 LEDs and FANTASTIC! You MUST set the ATTiny to work at 16MHz PLL (if you do not want to use an external crystal). I found out how to set the fuse for 16MHz PLL. Thanks!!Also I tried to change the number of LEDs to a lower amount like 10 on the same string and I got a strange effect. Occasionally the led that was lit was out side the number of LEDs I set it to. So numberOfLEDs set to 10 but I was using the same panel. I think it was because the next time through the loop the timing did not reset the string and the data continued down the string. Interesting!

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

    Thanks! This is great, I was scared when i saw how long the video was but you had good stuff to say. Good content!

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

    This is super helpful. I've been looking at other's examples, and this video is super clear in regard to how this all works. I think I might work on a version of this that uses a color palette instead for larger LED panels so they can still run from an Arduino.

  • @MilanKarakas
    @MilanKarakas 8 ปีที่แล้ว +1

    Excellent video! It is very useful, not only for programmable LEDs, but this way I am learning some tricks for fast outputing signals as well. Thanks again.

  • @lanthagamesmess1877
    @lanthagamesmess1877 6 ปีที่แล้ว +16

    Finally, someone who doesn't use either NeoPixel nor FastLED, thank you for sharing this, great video !

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

      Correct me if I'm wrong but the method this video explains is pretty much how FastLED runs under the hood. It's great that it goes to the extend of explaining everything but I think it's kind of dumb to reinvent the wheel when there are 2 great libs that you can use and work perfectly and have years of development behind them.

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

      @@frank20a Except when your teachers specifically ask you not to use any of these libraries...

  • @BryanByTheSea
    @BryanByTheSea 8 ปีที่แล้ว

    Great explanation on your coding. Learned a lot watching your explanation and referencing the scope. Good stuff. Thanks

  • @jorgeperezdelt
    @jorgeperezdelt 8 ปีที่แล้ว +1

    Thanks for taking the time to develope and share !!

  • @shnatko
    @shnatko 8 ปีที่แล้ว

    Good work, like seeing the score traces along w/ the code.

  • @cliveklugman2623
    @cliveklugman2623 8 ปีที่แล้ว

    got 60 2812B leds working so easily. your explanations are always so succinct. love your videos, thanks

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว

      +Clive Krugman awesome! good to hear!

  • @dylanborchert8156
    @dylanborchert8156 7 ปีที่แล้ว +12

    wow thank you so much, I finally understand how to control those RGB lights now

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

      i guess it is kinda off topic but do anybody know of a good place to watch new movies online?

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

      @Ayden Isaiah I would suggest FlixZone. Just google for it =)

  • @ka0bit0
    @ka0bit0 7 ปีที่แล้ว

    Awesome video ! I'm a total newb to programming and almost everything you talked about haha. I wanted to ask you, would I be able to integrate what you've gone over into making a custom taillight for my Yamaha C3/Vox project (motor bike) ?

  • @AldGregg
    @AldGregg 5 ปีที่แล้ว

    Hi, love this tutorial. I am wanting to make some LED juggling balls that can achieve some cool effects like your video. I have balls that glow but I want more than just colour change. What LEDs would be best for this? They would have to be able to withstand hard impacts when dropped. I will need to develop some sort of suspension system for the LEDs along with the central controller board. Can you point me in the right direction??

  • @guitarmaker2157
    @guitarmaker2157 7 ปีที่แล้ว +2

    thank you for posting a code that works great work

  • @matiascorrea4925
    @matiascorrea4925 8 ปีที่แล้ว +1

    I love how you make programs!!, I will be a programmer like you one day :), please make more videos about your programming skills. cheers from argentina!

  • @3toedSloth75
    @3toedSloth75 5 ปีที่แล้ว +1

    Nice informative video on the details of how the electronics work for these LEDs!
    Suggest refactoring the code to separate concerns a bit. One function should update the array and another function should push data on the wire. That way the code is more self describing and you don't have to set a variable to -1 to change behavior.

  • @KeithSalisbury
    @KeithSalisbury 7 ปีที่แล้ว

    Thanks Kevin, this is great video, really informative!

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

    Thank you for the video Dylan. Is this possible without an oscilloscope? I haven't purchased one yet. I don't even know which one to get on a limited budget. (Subscribed)
    I'm also interested why you didn't use one of the libraries like Adafruit.?

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

    Thanks for the video and walkthru of your code, especially when you explain the ''nop'' 8-) to adjust your tight timing, and it is very good you show the signals on the scope!!
    I was trying to probe the UpHere 6-pins from the fan/led controller, I think they use WS2813 as the led control is a 4 pins 5V,Gnd,Out,In where as fan is 12V,Gnd no speed control.

  • @djjoshua007
    @djjoshua007 5 ปีที่แล้ว +2

    Sweet!! :)~ I want to make one for my scuba tank ..

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

    thanks for this video dude, I'm wanted to get into LED and programming. For this chips with the build in driver, like the WS2812B, are you able to just program a single led and then just apply a power source and it will run through the programmed sequence with nothing else but the power?

  • @daveplummer7344
    @daveplummer7344 5 ปีที่แล้ว

    Thanks for the video, I really appreciated being able to see the signalling on the scope. One comment, on your code, all of the "&& MASK" stuff is redundant and always true.

  • @MrFarkasOfficial
    @MrFarkasOfficial 5 ปีที่แล้ว

    hey pal cool vid! what did you use to diffuse the light, if i may ask?

  • @joshc6699
    @joshc6699 8 ปีที่แล้ว

    holy freakin cow, thanks for that awesome explanation. more rambling the better with these types of things ;p

  • @papaluvspi
    @papaluvspi 8 ปีที่แล้ว +2

    Excellent Video. Very well explained. Thanks.

  • @brettthegreenmissile749
    @brettthegreenmissile749 7 ปีที่แล้ว

    fantastic video!
    i tried it on a cheap 1M 60 L.E.D strip from ebay and it works well. it twinkles slightly when its white but barely noticeable.
    looking at the code i cant work out why it keeps turning on and off white but if i take the delay out of the loop code it just goes crazy. any suggestions on how to get it to hold a colour?

  • @DerekWelchElectric
    @DerekWelchElectric 7 ปีที่แล้ว

    Thanks yet again Mr. Darrah!

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

    Love this stuff. Could this be integrated into a colour organ?

  • @hypertuch
    @hypertuch 8 ปีที่แล้ว

    Great videos man. U keep earning thumbs up.2 questions please: will it work on Digispark thumb arduino ? 2- Did you try making a low resolution screen/monitor using these addressable strips and Arduino ?

  • @muhammadsameer883
    @muhammadsameer883 6 ปีที่แล้ว

    Excellent explanation Kevin and very clever code. Thumbs up

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

    Thanks for making such an awesome video! What did you use to diffuse your LEDS at 2:00?

  • @elson2k
    @elson2k 8 ปีที่แล้ว

    Excellent video. As any of them, actually :)
    Keep up the good work & ideas ;)

  • @Magic-Smoke
    @Magic-Smoke 5 ปีที่แล้ว

    Very good - thanks for taking the time to explain!

  • @Engine_biulds
    @Engine_biulds 6 ปีที่แล้ว

    Do you think it's possible using a ring of addressable leds, with a little time to code, could make them function based off an input voltage?
    I'd like to have several back lit rings for my gauges in my car and run them based off inputs from speed and rpm signals then at a certain input have them all flash red for a shift light... I'm sure this will be a crazy sketch to write

  • @clearwavepro100
    @clearwavepro100 6 ปีที่แล้ว

    Thank you for sharing this!

  • @notionSunday
    @notionSunday 8 ปีที่แล้ว

    Thanks Kevin, another great video.

  • @EdwinFairchild
    @EdwinFairchild 6 ปีที่แล้ว +1

    in the for loopp couldnt you have set )b10000000 to a variable and just shift it right by 1 bit each time in the loop

  • @timothyfranjesevic1830
    @timothyfranjesevic1830 6 ปีที่แล้ว

    Hey I am new to Arduino programming and had a question. Can you use a similar program to turn all lights red except for randomly identified ones (1, 17, 54) as green? If so, I understood the high and low but how does it recognize the LED ID # and communicate which light to turn on?

  • @yicdgy1
    @yicdgy1 5 ปีที่แล้ว

    My brain just eploded!!! Thanks though for another great video!

  • @ClokworkGremlin
    @ClokworkGremlin 5 ปีที่แล้ว

    Check out the SK9822 LEDs. Slightly more expensive than WS2812 and they require a clock pin, but the transmission protocol they use is a lot simpler, they include a 32-level brightness setting for each LED, and I've experimentally been able to run my set at 3x the rate that the WS2812s are capable of before hitting the limit of what I could test.

  • @sankar2596
    @sankar2596 8 ปีที่แล้ว

    First Comment! Your videos are awesome! I learn a lot from them. I hope you keep making them. Peace!

  • @rpwood934
    @rpwood934 8 ปีที่แล้ว

    Your timing is dependent on the clock speed of the processor which is fine if everyone runs this on a Nano or Uno but I know by experience that this screws up if you try to run it on a Due or Leonardo. You might want to have a look at Adafruit's Neopixel library which does cater for different performance CPUs.

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

    Hi there, this is pretty cool. But I was looking for a way to program static letters and numbers. I want to learn how to program and Arduino to scroll writing left to right, right to left, as well as top and bottom. But more importantly, how to get letters and numbers to snap in and out and fade in/out of each other. For example, a countdown from 10 to 1 fade out and in over each other. Is there a way to do this?
    Thanks.

  • @thebassreview
    @thebassreview 7 ปีที่แล้ว

    I'm trying to work through using this with a set of RGBW LEDs, do you have any insight regarding this. I'm getting to kind of work, but the White keeps flashing while the LEDs that I assign a color to work fine.

  • @mt-qc2qh
    @mt-qc2qh 8 ปีที่แล้ว

    Hi Kevin, great videos. I'm looking for a new scope after my Tek finally bit the dust and see you use the Rigol. Is that the 100MHZ? Have you ever used the the Hantek? I like the 7" screen and the 70MHZ is pretty reasonable. Thank you in advance for your thoughts.

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว +1

      +m t Had the 100Mhz Rigol for a few years - nice scope for day to day work, but I'd really kill for a 4 channel. Haven't really been looking though. 7" screen would be nice - reviews seem okay for the Hantek. Thanks for the tip!

  • @seba007_
    @seba007_ 5 ปีที่แล้ว

    Do you know that you can use also the Adafruits Neopixel library? Its a way more comfortable then the Way you've done!

  • @DupczacyBawol
    @DupczacyBawol 6 ปีที่แล้ว +1

    Thank you. You are the man!

  • @SirHackaL0t.
    @SirHackaL0t. 7 ปีที่แล้ว

    A great video but I'm not sure what causes each high or low to be a different amount of time.

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

    Best low level explanation I found on youtube! Thanks
    Using the '&&' is not needed I think.
    Both the lines will gives the same result I guess?
    PORTB = ((RGB[i] & B10000000) && B10000000) | Existingport;
    PORTB = ((RGB[i] & B10000000)) | Existingport;
    Also your code depends upon the clock speed of the microcontroller. I don't know if you mentioned the clock speed?

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

    I am using NeoPixel Stick - 8 x 5050 RGB LED with Integrated Drivers but at start the LEDs start burning
    why its happened, Any idea?
    the Strip use multiple Amp according to Strip Colors
    is Constant -Current-Regulator necessary ? If Yes, Then how?

  • @donmilton9664
    @donmilton9664 8 ปีที่แล้ว

    Great tutorial and video! Love your videos. Very informative and precise.
    Quick question: This code is working for the Atmel 328. Could it work on an ATTiny? I used the Neopixel library on a tiny85 and it worked but it took up alot of space.
    BTW, I also have these same LEDs and the ones I have are using the WS2812B chip. But some others use the older WS2812 and the byte order is different. I mixed the during my experiment and was confused why some had different colors than expected. FYI Thanks Kevin!

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว

      +Don Milton Don, should work with ATTiny, but you'll have to change the PORT stuff, so the right pin is used. Let me know if you try it out.

    • @donmilton9664
      @donmilton9664 8 ปีที่แล้ว

      +Kevin Darrah I tried it out on the ATTiny85 and at first it was black and nothing happened. I did figure out that the right pin on the ATTiny is data pin 0. So I fixed that and when I uploaded it and tried it I got all white and ever LED on. I tried it on my Arduino UNO and it worked great. I am thinking it is because the ATTiny is 8MHz and the Arduino is 16MHz so it might be a timing issue. I could not figure out if I needed half the clock cycles because the timing is slower by a factor of 2. Thanks! I am looking forward to using this because it is definitely smaller than using the NeoPixel or FastLED libraries.

    • @kewakl8891
      @kewakl8891 7 ปีที่แล้ว

      It will work on the Tiny85 -
      I programmed the T85 using (UNO) 'Arduino as ISP'
      using the board manager - raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
      Clock : Internal 16MHz
      Burn bootloader to set the fuses for the T85 to internal 16 MHz
      Then upload to the T85 thru the 'Arduino as ISP'
      I have some code to allow the use of (almost!) any port/pin. However PORTB,C PINs 3,5 don't work, and PORTD PINs 3,5,6 don't work on UNO & clones (tried on several boards)

    • @kewakl8891
      @kewakl8891 7 ปีที่แล้ว +1

      will work on Tiny84

  • @iceberg789
    @iceberg789 8 ปีที่แล้ว

    very nice, thanks for the tutorial !

  • @BomKySu
    @BomKySu 6 ปีที่แล้ว +1

    Thanks bro.. So devoted..!!!

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

    Does this need an external power supply to drive or will the 5v frim the arduino work fine?

  • @69elchupacabra69
    @69elchupacabra69 7 ปีที่แล้ว

    At line 57, when setting the pin low, why use ExistingPort instead of defining and using a new variable WS2812pinLOW = PORTB & B111110?

  • @angelledlighting4521
    @angelledlighting4521 7 ปีที่แล้ว

    Nice! thanks for sharing!

  • @matth3wc
    @matth3wc 7 ปีที่แล้ว

    when using this led strip does the pin have to have pwm or can it be an ordinary digital pin?

  • @hamishwoyka5599
    @hamishwoyka5599 6 ปีที่แล้ว

    can you use these leds without a micro-controller? if so what would the colour of the led be?

  • @kennethsch2943
    @kennethsch2943 8 ปีที่แล้ว

    Hey, i would like to make a little LED Strip-Clock project and plan to use a teensy or an arduino mini for it. But could you please tell me what would make it easier with this teensy compared to the arduino?
    Nice video, greetings

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว

      +Can Ad I don't see why you couldn't use Arduino - the teensy would work better for large arrays of LEDs,

    • @kennethsch2943
      @kennethsch2943 8 ปีที่แล้ว

      +Kevin Darrah Thank you :) I was just wondering why you put that Info box at around 0:40

  • @guitarmaker2157
    @guitarmaker2157 7 ปีที่แล้ว

    for the code to run the bouncy ball as the one in the vid my one is running realy fast so how would i get the led to do what yours is doing

  • @saftschinken2353
    @saftschinken2353 5 ปีที่แล้ว

    I got a ws2812B LED Strip and I see recomendations to get a up to 1000µF Capacitor, but i can't see how much V they should be. And I found a 1000µF 25V capacitor. Is this ok or could it damage the strip?

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

    Is there any way to send the LED output do a different PIN? I'm using a Tinkerkad LCD module and D8 is not available. However, D6, D5, and D11 are available.

  • @BGroothedde
    @BGroothedde 8 ปีที่แล้ว +1

    Awesome! Changing the PORTB operations in the loop to inline assembly code could optimize it even more, but this is already fast enough. How about power though? How much juice will be flowing through port 8?

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว +1

      +Bas Groothedde power should be no prob - that digital pin 8 is just used for data pin, not to actually power the LEDs

    • @BGroothedde
      @BGroothedde 8 ปีที่แล้ว

      Kevin Darrah Ah got ya, I have never used these leds, so I didn't know that. I'll be ordering a few soon then haha

    • @CSmyth89
      @CSmyth89 8 ปีที่แล้ว +2

      +Bas Groothedde they're quite cool, I used them to make a digital Rubik's cube. Saved me doing a lot of difficult wiring and PWM while still trying to make time to sense swipes etc.
      Only think I would recommend is that if you plan on using a lot, I'd make more than one power rail as opposed to the Vin Vout pins all being daisy chained together. The voltage drop will cause the problems the furthest LED colours otherwise.

    • @CSmyth89
      @CSmyth89 8 ปีที่แล้ว

      +CSmyth89 also also, from what I recall (from very quick current tests @ 5V current per individual LED =17mA so full white brightness is about 51mA

    • @BGroothedde
      @BGroothedde 8 ปีที่แล้ว

      CSmyth89 good advice, thanks!

  • @TimGeersProductions
    @TimGeersProductions 8 ปีที่แล้ว

    could you put 512 of these in series and make a 8x8x8 rgb led cube?

  • @radioband2364
    @radioband2364 7 ปีที่แล้ว

    Cool! And what about multitasking? If I connect 3-4 LED panels to different pins - does it work?

    • @Kevindarrah
      @Kevindarrah  7 ปีที่แล้ว

      right now it only works with one pin, but you could just daisy chain your panels

    • @radioband2364
      @radioband2364 7 ปีที่แล้ว

      I think daisy chain connection is not reliable - if one wire in chain will be damaged - all next panels will be lost... So I search multiple pins solutions (one lost but others still working)...

  • @pirateman1966
    @pirateman1966 8 ปีที่แล้ว

    The data sheet is in Chinglish and I wanted to know the fastest buad? is it 800Kbps?
    what does "When the refresh rate is 30fps, cascade number are not less than 1024 points." mean?
    Does it mean "30fps is guaranteed for 1024 cascaded leds"?

  • @securi-t
    @securi-t 5 ปีที่แล้ว

    Slightly confused on how you connected the LEDs (specifically as it relates to your code & how addressable LEDs work, as I'm still learning). Did you take the output of the last LED in the first row to the top of the next row? Or did you go back up from the bottom unit?

    • @securi-t
      @securi-t 5 ปีที่แล้ว

      Nevermind, I was finally able to pause it and see how it was done... from top to bottom then back to the top.

  • @369hz5
    @369hz5 5 ปีที่แล้ว

    Can you do a video on SK6812

  • @MajorBreakfast
    @MajorBreakfast 8 ปีที่แล้ว +3

    Bought a strip with 60 LEDs and it works just fine :)
    You should consider putting that on github!
    A major improvement would be to use a class with methods leds.set() and leds.flush()

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว +3

      +MajorBreakfast cool! yea good idea

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

    Hi Kevin, do you have the connection plan for the LEDs? Can you share the connection plan with me?

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

    I am interested in the first animation of blocks of color that randomly bounce around. Cannot find it anywhere.

  • @joedempseysr.3376
    @joedempseysr.3376 6 ปีที่แล้ว

    Great video, good explanation. ONLY comment is you should space out the comments and stuff in your code so it would be easier for ys old timers to read.
    Also, use #defines for everything where a number appears in your code so you don't have to guess what the numbers are for.
    A.K.A. the "no magic numbers" rule in Software Engineering. Everything gets a name.

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

    hi Kevin. Thanks . I don’t see how to fetch the code listing for download and experiment. Please advice. J

  • @ccalmus
    @ccalmus 5 ปีที่แล้ว

    What kind of capacitor do you use exactly?

  • @MegaTacostand
    @MegaTacostand 6 ปีที่แล้ว

    how would you witch the colr of the array from green to another color

  • @mixtermuxter8602
    @mixtermuxter8602 8 ปีที่แล้ว +1

    man i loooove theese strips, i got like 5 m of them :-)

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

    I have a WS2812B led strip . with 180 RGB leds . I want to press button 1 . and have the 1st led on the strip blink , what i am trying to do , is have 6 buttons . each button controlling different actions on the RGB strip , and upon completion of each action , stop ,How can I accomplish this?? I have no clue where to even start . I have tried the Fastled library , I just know how to code it
    thank you , I know this is from 2016 , But hoping you can give me some help

  • @evertontrindaderisso8855
    @evertontrindaderisso8855 7 ปีที่แล้ว

    I'm using Ws2812B and I'm having trouble, how to adapt the code for this LED model?

  • @VladRusu2008
    @VladRusu2008 7 ปีที่แล้ว

    great work !

  • @markavery2888
    @markavery2888 5 ปีที่แล้ว

    Any reason you can't run a bunch of there in parallel and have them all do the same thing at the same time?

  • @aliha3218
    @aliha3218 8 ปีที่แล้ว

    hi, it is an amazing work but it doesn't work for me with the arduino mega 2560 can you help me please

  • @jasum437
    @jasum437 7 ปีที่แล้ว

    What kind of capasitor do you use ?

  • @eviancon
    @eviancon 5 ปีที่แล้ว

    Hi there. Is there a tutorial like this for WS2813?

  • @adamlhumphreys
    @adamlhumphreys 7 ปีที่แล้ว

    No need to repeat the same steps or add unnecessary "&&" comparisons which turns the value into a bool, (though I think you should be able to just use "&& true" to get the same result since any positive value should count as "true"). Just continue to use bitwise operators, particularly the "

  • @axelsolhall5830
    @axelsolhall5830 5 ปีที่แล้ว +1

    Every second update of RGB_update turns all pixels white, I think this is related to WS2812pinHIGH = PORTB | 1; but I cannot find the source of the problem. Can anyone help me with advice?
    EDIT: Sorry for the stupid questing, the solution was your update. Cheers mate, great video!

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

    Wouldn't it be possible to use a counter and interrupts to time the code properly?

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

    Wow, Super Great video

  • @Stogoh
    @Stogoh 7 ปีที่แล้ว

    The Adafruit Neo Pixel Lib. work on every pin, why doesn't this awesome method work as well? I havn't tried it out yet, but i will.

    • @Kevindarrah
      @Kevindarrah  7 ปีที่แล้ว +2

      I haven't really had a chance to test that, but it's because I had to avoid bit shifts, but by using the first bit PB0, I didn't have to shift....

  • @CYBERemnant
    @CYBERemnant 7 ปีที่แล้ว +11

    If your pixel has 6 soldering points, you have the WS2812 led. If it has only 4, then you have the WS2812B. Pretty sure about that.

    • @geluidsbox9195
      @geluidsbox9195 7 ปีที่แล้ว

      3* is the WS2812B

    • @andrews4276
      @andrews4276 7 ปีที่แล้ว

      How can they have 3? Vcc, GND, D-In, D-Out

    • @jaymeekae84
      @jaymeekae84 7 ปีที่แล้ว +3

      They have V, GND, D-In at one end and V, GND, D-Out at the other end

    • @DupczacyBawol
      @DupczacyBawol 6 ปีที่แล้ว +1

      BTW, I have 6-pin LED but FastLED.h library must be set to : FastLED.addLeds(leds, NUM_LEDS); to make it work correctly.

    • @joecagetube
      @joecagetube 6 ปีที่แล้ว

      i want to use the 4 pin WS2812B instead of the 6 pin WS2812 , any videos on how to use that? reduces the number of solder points

  • @ShampooWow
    @ShampooWow 8 ปีที่แล้ว

    Awesome video! I like it

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

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

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

    Thanks a lot! ... best explanation ever!!! ^_^

  • @edisonstoneking1164
    @edisonstoneking1164 8 ปีที่แล้ว

    where can i find the code down load for addressable Leds with Arduino! WS2812b

  • @b--n
    @b--n 8 ปีที่แล้ว

    Could you have used a bit shift to try and change how long it was written high for, rather than going over every 8 bits in your main loop?
    I'm thinking something like:
    //loop over all the values
    for (int i = 0; i < 135; i++) {
    //get the byte
    int b = RGB[ij];
    //run the loop 8 times (don't actually use k)
    //import with the shift left and assign by 1 bit - this means you're always checking MSB
    for (int k = 0; k < 8; k++, b

    • @Kevindarrah
      @Kevindarrah  8 ปีที่แล้ว

      +Ben Naylor Yea, I think I tried that early on - the one thing that bit me was when you hit the end of that internal for loop - now you've got double the checks when you're at the end of the loops. Could work though - let me know if you try this.