How to use the Arduino map() function

Поділитися
Вставка
  • Опубліковано 12 вер 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 4 місяці тому +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 4 місяці тому +2

    Outstanding explanation, thanks!

  • @DrVanV
    @DrVanV 8 місяців тому +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  8 місяців тому +1

      That's awesome, thanks for the tip!

  • @jamesboland1345
    @jamesboland1345 5 місяців тому

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

    • @CircuitCrush
      @CircuitCrush  5 місяців тому +1

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