Це відео не доступне.
Перепрошуємо.

Arduino Tutorial 13: Programming DotStars (APA102)

Поділитися
Вставка
  • Опубліковано 25 бер 2018
  • In the previous tutorial I showed you how to connect DotStars to your Arduino and upload a sketch to light them up for the first time. The tutorial quickly went through the code in the example upload. Great for ensuring we're wired correctly, but we are left not understanding how to make our own patterns on the strips.
    In this tutorial I go a bit deeper on how you can write colors to individual LEDs and introduce some programming concepts that allow you to create patterns (including for loops, if statements, and bitwise operations). By the end of this tutorial you will understand how to send the correct color and brightness to a LED such that it can work for your project.
    You can find this tutorial and others like it on my website at:
    thezanshow.com/electronics-tut...

КОМЕНТАРІ • 30

  • @TomsTrainsandThings
    @TomsTrainsandThings 5 років тому +1

    Thank you so much for taking the time to walk us through all the different steps in this sketch. This is much easier to follow and understand why things are happening with the LEDs.

  • @EnventProductions
    @EnventProductions 6 років тому +9

    THANKYOU FOR MAKING THIS. so many videos are useless and this one really explains everything. thank you so much

  • @science4allworld587
    @science4allworld587 5 років тому

    The only and the best tutorial that is really worth calling as tutorial, because it literally teaches how n why n whats of programming apa...
    Thanks a lot

  • @TheWilliammccormick
    @TheWilliammccormick 6 років тому +1

    Great job in everything! Greatly appreciated!

  • @AnthonyGoodley
    @AnthonyGoodley 6 років тому

    Nice tutorial. Much appreciated.

  • @conradsinsua7415
    @conradsinsua7415 4 роки тому

    Freaking awesume tutorial, subscribed

  • @Xarmin96
    @Xarmin96 4 роки тому +1

    I think if you change DOTSTAR_BRG in your strip declaration to the match the color profile of your strip (it looks like you probably have a DOTSTAR_BGR), you won't have to worry about writing the hex color value in a non-standard format, and should be able to write it as RGB. Good tutorial, though, thanks for uploading!

  • @shivaartsbpet
    @shivaartsbpet 5 років тому +1

    good teacher

  • @xyzheng9672
    @xyzheng9672 4 місяці тому

    Truly inspired by your videos and interested in exploring possibility with you. :) Sienna from PCBWay.

  • @abhishekpillai5207
    @abhishekpillai5207 5 років тому

    Nice tutorial! I had a query. In the bounce back sketch would it not have been easier to get the snake moving by using the head and tail variables you used in the first sketch and then keep incrementing the head and tail by one, then if the head is = to 30 start lowering them with an else incrementnting hem.

  • @BestUnderPressure
    @BestUnderPressure 5 років тому

    Very good video, thanks. Do you happen to have a tutorial on how to fade the DotStars? Dim to bright and in reverse.

  • @jonascale
    @jonascale 4 роки тому +2

    ive watched many of tutorials on youtube looking for this information and non of them have come even close to telling me what i needed to know. thanks this has been very informative. One question that i do have though. Is if you wanted to pick a start pixel and an end pixel. and you wanted to create a path of lights to travel along starting a start pixel and then ending at end pixel. How can you make the led decrement at the end pixel so the trail length reduces as it hits the end pixel?

  • @jesperkuipers7556
    @jesperkuipers7556 5 років тому

    Thank you so much for explaining the coding really needid it! There is just this one thing( sorry, abslutly not formilure with arduino) is it possible to make an input as een wire that gives 12v to activate an other funtion? As for an example my full led strip is all white in the front of the car and when i switch on my blinker the led strip starts blinking?

  • @koenjanssen81
    @koenjanssen81 6 років тому

    As allready said: Greatly appreciated!!! Are there more APA102 tutorials coming?? I would love to somehow control it with my mobile phone (got a few ESP8266 but dont really know arduino code....)

  • @vinceb121
    @vinceb121 4 роки тому

    Does this same info apply to the all-white dotstars?
    Trying to modify the strand test so it will run two separate 144LED/m white strips

  • @RT-xj9im
    @RT-xj9im 6 років тому

    What if your using more than one strip that are different in length? Also your using the SP105E Controller

  • @djg500
    @djg500 5 років тому

    Nice tutorial. How can i get for example LED 0 to 4 in red, 5 to9 in green and 10 to 14 in blue? I'm new to arduino and DotStar. I coudn't figure that out :(

  • @EnventProductions
    @EnventProductions 6 років тому

    I do have a quick question. If I wanted to make it fade up as its moving forward so the head starts at 0%brightness then fades up to another percentage before moving forward how would I do that? If you have time could you get back to me. Thank you

    • @alexanderbaran-harper4748
      @alexanderbaran-harper4748  6 років тому

      There's a couple ways to do it. When you're defining the RGB value you can try keeping the ratio of colors the same, but increment. That is: start with (0,0,0), then move to (2,1,1), then (4,2,2), etc. This assumes a linear change in each of the three LED's color intensity as you do this. Maybe that will work? Alternatively there is a global brightness variable you can adjust in that Adafruit library. I am unsure how well the formatting is preserved in a UA-cam comment, but the notes are:
      // Set global strip brightness. This does not have an immediate effect;
      // must be followed by a call to show(). Not a fan of this...for various
      // reasons I think it's better handled in one's sketch, but it's here for
      // parity with the NeoPixel library. Good news is that brightness setting
      // in this library is 'non destructive' -- it's applied as color data is
      // being issued to the strip, not during setPixel(), and also means that
      // getPixelColor() returns the exact value originally stored.
      void Adafruit_DotStar::setBrightness(uint8_t b) {
      // Stored brightness value is different than what's passed. This
      // optimizes the actual scaling math later, allowing a fast 8x8-bit
      // multiply and taking the MSB. 'brightness' is a uint8_t, adding 1
      // here may (intentionally) roll over...so 0 = max brightness (color
      // values are interpreted literally; no scaling), 1 = min brightness
      // (off), 255 = just below max brightness.
      brightness = b + 1;
      }
      The details can really be found at the GitHub repository here: github.com/adafruit/Adafruit_DotStar/blob/master/Adafruit_DotStar.cpp
      Finally, if you check the data sheet you will find a brightness value you can send to the LED. I am unsure if that is the same communication the Adafruit library is doing, or if you can target individual LEDs with it. You would have to pull up the APA102 datasheet and write the code to specifically communicate to the strip what you want if the library is insufficient. I've made a tutorial that helps a user tackle data sheets and SPI communication (though with a different device): thezanshow.com/electronics-tutorials/arduino/tutorial-9
      Cheers!

  • @richardparked1405
    @richardparked1405 2 роки тому

    Hello sir I was use your code to upload to Arduino Nano and its error like this " 'adafruit_dotstar' does not name a type ". What can i do?

  • @allenvtvificandoityoucando5548
    @allenvtvificandoityoucando5548 3 роки тому

    I want to put RGB in my Motorcycle input voltage is 12v and i will use 12v led strip. Any other device to protect my arduino in voltage in case it will drop or will get high.thanks and more power

  • @kashif1964
    @kashif1964 5 років тому

    When will be next video from your side?

  • @internetuser9015
    @internetuser9015 5 років тому

    Where you declared the (I / O) port

    • @igormorozov6801
      @igormorozov6801 4 роки тому

      I think SPI library declare standart pins for I/O.
      SCK on 13pin UNO for example.

  • @kaamilverma1602
    @kaamilverma1602 4 роки тому

    where are u ???? come back please

  • @kikillo201081
    @kikillo201081 4 роки тому

    are those WS2813 led strings?

  • @Max_agri
    @Max_agri 3 роки тому +1

    Add subtitles to your videos. I will be grateful for russian subtitles.