Advanced Arduino Code Optimisation with Pin Registers

Sdílet
Vložit
  • čas přidán 8. 07. 2024
  • In this video I will show you alternative to using pinmode, digitalRead and digitalWrite commands to manipulate arduino pins.
    Showing pin registers can help you optimise arduino code but also oin manipulation done this way is also much faster
    Link to code
    projecthub.arduino.cc/mdraber...
    If you like this content and you want to support me in creating similar videos go to my Patreon webpage
    / mariosideas
    Or Paypal
    www.paypal.com/cgi-bin/webscr...
    Music Credits;
    ------------------------------
    Track: Autumn - KV [Audio Library Release]
    Music provided by Audio Library Plus
    Watch: • Autumn - KV | Free Bac...
    Free Download / Stream: alplus.io/autumn
    ------------------------------
  • Věda a technologie

Komentáře • 39

  • @johneagle4384
    @johneagle4384 Před 2 lety +4

    Without videos like yours, my projects would be dead in the water. Thank you for the excellent explanation.

  • @user-ht2ij2do7t
    @user-ht2ij2do7t Před 6 měsíci +2

    ❤ From SRI LANKA 🇱🇰❤ I've learnt lot from your channel.. and I think you deserve much much more subscribers, likes and comments

  • @bobvanwagner6099
    @bobvanwagner6099 Před 4 měsíci

    Well done video presentaton. Thoughtfully done, nice pace.

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

    Fascinating 😊❤

  • @Lunolux
    @Lunolux Před 3 dny

    that was interesting, nice video
    thx

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

    Thanks, someone has built a circuit with an Atmga8 on it, so I THOUGHT I knew about them. One of the switches on their board goes to pin PC3.. so there I am DRDC &=PC3 your tutorial made me look at PC3 which turns into a 3 hmm thankfully only 3 leds and three switches!!

  • @fsmaia
    @fsmaia Před rokem

    Very good! Congrats.

    • @marios_ideas
      @marios_ideas  Před rokem

      Thanks. Don't forget to give video a like. Helps with growing the channel

  • @adambeedle
    @adambeedle Před 2 lety

    Great video 👍

    • @marios_ideas
      @marios_ideas  Před 2 lety

      Thx:) give vide a thumb up if you liked it

  • @thaboluvhimbi4208
    @thaboluvhimbi4208 Před 6 měsíci

    Informative

  • @jozefsoucik3115
    @jozefsoucik3115 Před 4 měsíci

    great vid. i always need deep understanding to understand the thing. this made me moved forward... Also i learned today, that you can achieve much memory saving by use for delay(1000) function thic code instead: for (long i = 0; i

  • @alielectronics17
    @alielectronics17 Před 2 lety

    nice video & nice explanation

    • @marios_ideas
      @marios_ideas  Před 2 lety

      Thx:) Give the video thumb up. Helps to promote my channel

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

    Nice explanation. Setting PIND also functions as a toggle...eg: PIND = B00010000 will toggle pin 4 each time the code is executed.

    • @marios_ideas
      @marios_ideas  Před 2 lety +4

      I did not know that:( I would have included it in my video

    • @mrtom64
      @mrtom64 Před 2 lety

      @@marios_ideas No worries, it seems wrong to 'set' a read only register but it works and is very useful.....and extremely quick. Apparently turning pins on and off is a 'thing' and the challenge is, of course, to do it the fastest.....you'll find lots of weird and wonderful 'port manipulation' code on the subject.

  • @IvanEng747
    @IvanEng747 Před rokem

    This example maybe apply in esp12F?

  • @shubham9672
    @shubham9672 Před 2 lety

    Please make next video on
    How to create fastest function
    Replacement for
    Digital read
    Digitalwrite
    Analog write
    Analog read
    Delay function

  • @shubham9672
    @shubham9672 Před 2 lety

    Is it good or bad
    14:40
    That pulse

  • @alcanceweb
    @alcanceweb Před 9 měsíci

    Great tutorial, thanks. I'm also interested in your small led modules. Could you please provide me link to buy them?

    • @marios_ideas
      @marios_ideas  Před 9 měsíci +1

      AliExpress . Search for lillypad leds. They are generally for electronics to be attached to clothing. But i thought they work great in breadboard projects

    • @alcanceweb
      @alcanceweb Před 9 měsíci

      Outstanding. Thank you, sir.

    • @marios_ideas
      @marios_ideas  Před 9 měsíci

      No problem. Consider supporting my channal

  • @snouzz-gaming917
    @snouzz-gaming917 Před rokem

    Hi
    great Video!
    Do you can explain how to write a code with register for nrf24l01 (Receiver & Transmitter) ?

    • @marios_ideas
      @marios_ideas  Před rokem

      My pleasure:) like and subscribe to my channal. Also consider supporting it.

  • @Sekhar_Home
    @Sekhar_Home Před 2 lety

    Pls make more advance video on port manipulation and writing of complex arduino codes

    • @marios_ideas
      @marios_ideas  Před 2 lety

      Any particular aspects you are interested in?

    • @Sekhar_Home
      @Sekhar_Home Před 2 lety

      @@marios_ideas sctually i need all.. but at first need ADC and timer programming.

  • @shubham9672
    @shubham9672 Před 2 lety

    Can we use digital pin D0 and D1 as output and drive LED

    • @marios_ideas
      @marios_ideas  Před 2 lety

      Yes

    • @shubham9672
      @shubham9672 Před 2 lety

      @@marios_ideas
      But if we attached LED to those pin then is there any problems with Rx TX communication

    • @marios_ideas
      @marios_ideas  Před 2 lety

      You cannot do both. I always thought D0 and D1 are off limits and reserved for RX TX. But with pin registers I was able to use them to control LEDs

    • @shubham9672
      @shubham9672 Před 2 lety

      @@marios_ideasfor example I built a blutooth controlled robot
      If I detected any obstacles can I drive D0 and D1 pin to logic low

    • @shubham9672
      @shubham9672 Před 2 lety

      If I do so .... Is blutooth connection disconnected

  • @Gaminiheraliyawala
    @Gaminiheraliyawala Před 27 dny

    This is fantastic... 👍👍👍 But, what is the IDE? Is it Arduino IDE? Appreciate your reply.... 🙏🏻🙏🏻🙏🏻

  • @no5x937
    @no5x937 Před 4 měsíci

    There is NO IF statement in the first code shown. Register D has 8 bits (NOT 7). Otherwise, great video.

    • @marios_ideas
      @marios_ideas  Před 4 měsíci

      Point me to the exact timestamps in the video so I can inform about those mistakes in the description