ARDUINO VARIABLES AND CONSTANTS - Arduino programming theory #2

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

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

  • @BasonTech
    @BasonTech  4 года назад +1

    👉 Don't forget to check arduino-tutorials.net for more Arduino tutorials and projects.
    If you have questions, don't hesitate to ask them in de comments. Remember: There are no stupid questions 😃
    🔔 Want to stay up-to-date with the latest videos? Subscribe to the Bas on Tech channel!

  • @thefsquad7787
    @thefsquad7787 5 лет назад +2

    Bedank man duidelijke video'
    s goed zo bas...

  • @carolinaborneaprendeelctronica
    @carolinaborneaprendeelctronica 2 года назад

    thanks now i understand the const variable

    • @BasonTech
      @BasonTech  2 года назад +1

      Great to hear! 😃

  • @LofiQuranStream
    @LofiQuranStream 3 года назад +1

    Thx!

    • @BasonTech
      @BasonTech  3 года назад

      You're welcome! 😃

  • @tomgaming410
    @tomgaming410 2 года назад

    If I use 2 of the same integers and use const at the same time, what happens? I also love your videos you explain everything so clearly thanks to you I was able to learn this course in 7 minutes

    • @BasonTech
      @BasonTech  2 года назад

      Sorry I don't get your question. Do you mean that if you have an int and a const with the same name?

  • @youssef8955
    @youssef8955 2 года назад

    hi man is there any instruction that allows you to configurate a lot of pins at one because I'm working with an arduino mega2560 and I have like 36-40 pins to configurate.

    • @BasonTech
      @BasonTech  2 года назад

      Unfortunately not, but you have to look at multiplexing of shift registers. The MAX7219 might be able to help you with this. It is used to drive 7-segment led displays

  • @NarutoUzumaki-ty2sk
    @NarutoUzumaki-ty2sk 4 года назад +1

    Hi Man Does It Matter If You Type The Variable Before Or After void setup?

    • @BasonTech
      @BasonTech  4 года назад +1

      Hi, it is best practise to write your global variables on the top of your code, under the includes. It probably does work, but it is not recommended. 😃

  • @pfranzpflanze4667
    @pfranzpflanze4667 3 года назад

    Hello.
    But what is the difference between const int and #define?

    • @BasonTech
      @BasonTech  3 года назад

      Good question! This post on stackoverflow gives an excellent explanation: stackoverflow.com/a/6442372/512089

  • @zeropoint-1041
    @zeropoint-1041 3 года назад

    was not declared in this scope
    18 | const char

    • @BasonTech
      @BasonTech  3 года назад

      Looks like you've made a typo on line 17 or 18. Maybe you forgot something?

  • @dakshmehta3518
    @dakshmehta3518 3 года назад

    Hi
    In arduino starter kit(love o meter)
    They used a constant for a pin
    Code:
    const int sensorPin = A0
    This is not even a integer how is it being run as there is a 'A' in it?

    • @BasonTech
      @BasonTech  3 года назад +1

      Very nice question! I couldn't find proof but A0 is actually a constant which points to the correct pin. If I remember correctly something like pin 14 is analog 0. So A0 actually represents the value 14 which is an integer 😃