Using external libraries with PlatformIO and Arduino

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • One of the few comments under aprevious video asked for an explanation on how to use an external library in an Arduino-project under PlatformIO. Here I show the example of the FastLED library to control neopixel LED-chips.
    This video is unsponsored and not monetized, as usual.
    00:35 looking at the circuit boards
    01:10 the layout in KiCAD
    02:40 soldering connection pins
    04:00 connecting the board to an Arduino
    04:35 creating a new project in PlatformIO
    06:00 picking a library within PlatformIO
    10:18 success: a blinking LED
    circuit boards made by www.pcbgogo.com/
    - 1.0 mm thick
    - green solder mask, white silkscreen
    - lead-free HASL
    - castellated edge-contacts
    other tools used:
    TS-100 solder iron
    Felder Iso-Core Clean Sn100Ni+ solder wire 0.5 mm
    Arduino nano (clone), ATmega328 16 MHz, 5V
    Software used:
    KiCAD PCB layout www.kicad.org/
    QCAD general 2D design www.qcad.org/en/
    VS Code code.visualstu...
    PlatformIO plugin platformio.org/
    FastLED fastled.io

Komentáře • 7

  • @7alfatech860
    @7alfatech860 Před 2 lety +1

    I do like that platformIO allows you to add the library after you've already started the project. I usually add them right at the start when I know which ones I'll be using.
    But I would find it annoying that it will not add the header file into main.cpp when I specifically added the library to that specific project. Also, if you copy and paste a file developed elsewhere into platformIO, with the header files, it just throws its hands up and complains. And yet it is smart enough to find libraries for you and you can even give it a url. I think that if you put a specific header file in main, it should at least offer to find and install that library. I go back and forth with platformIO and just Notepad++ and ye olde Arduino😁

    • @uwezimmermann5427
      @uwezimmermann5427  Před 2 lety +2

      The name of a header file is arbitrary since you can make up your own libraries with random names which might be identical to other libraries on the net or in the known repositories. Also libraries in the repositories change over time, sometimes becoming incompatible to earlier versions. How should PlatformIO know which particular vintage version of library your project needs?
      I pretty much prefer that PlatformIO keeps the current version of the library in a local copy within your project tree, actually keeping track for you of available updates when a library comes from a standard repository - but letting you decide whether to update or not.

    • @7alfatech860
      @7alfatech860 Před 2 lety +1

      @@uwezimmermann5427 Thanks for the reply👍

  • @doquockhoa
    @doquockhoa Před rokem +1

    Can you make video about I2c protocol. I see a lot of video but I not understand? Thank you very much

    • @uwezimmermann5427
      @uwezimmermann5427  Před rokem +1

      What don't you understand and to which level of detail do you want to understand the I2C bus?
      I would recommend to read some documentation rather than relying on a youtube video. NXP - or rather former Philips - is the inventor of I2C and they have the standard document: www.nxp.com/docs/en/user-guide/UM10204.pdf

    • @Patten42
      @Patten42 Před 11 měsíci

      @@uwezimmermann5427 You are great at explaining and I am interested too. Like a typical circuit with data input from a sensor and output on a LCD or something while using a MC as 328p and coded in AVR-C?

    • @uwezimmermann5427
      @uwezimmermann5427  Před 11 měsíci

      @@Patten42 I am currently a bit overloaded with work, hence the lack of any new videos... but... and with soon 1000 subscribers...