How to use the Arduino map() function

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024
  • The Arduino map() function is a really handy built-in function. In this video' we'll introduce you to the Arduino map(), talk about what it does, and show you why and how you would use map() in your Arduino projects. Enjoy! Please hit the subscribe button on the lower right of the video!
    Want to know more about Arduino and create amazing, cool things with it? This is for you: go.learnarduin...

Комментарии • 8

  • @Lyrics23
    @Lyrics23 6 месяцев назад +1

    Thank you, that helped me a lot. it was so hard to work with soil moisture sensor's analog read so I had to do an equation to use it properly, but the map function solved all of that. 🌹🌹

  • @BobBob-ds1bd
    @BobBob-ds1bd 6 месяцев назад +2

    Outstanding explanation, thanks!

  • @DrVanV
    @DrVanV 10 месяцев назад +1

    A fairly minor alteration to the map function eliminates the issue with the output mapping to the max value for only the max input and improves the distribution of the output values.
    long mapEx( long x, long in_min, long in_max, long out_min, long out_max)
    {
    return((x - in_min) * (out_max - out_min + 1) / (in_max - in_min + 1) + out_max);
    }

    • @CircuitCrush
      @CircuitCrush  10 месяцев назад +1

      That's awesome, thanks for the tip!

  • @jamesboland1345
    @jamesboland1345 6 месяцев назад

    Question..do you need Internet to program Arduino..

    • @CircuitCrush
      @CircuitCrush  6 месяцев назад +1

      No, but you'll need Internet to download the IDE and any additional libraries you want