Это видео недоступно.
Сожалеем об этом.

Arduino Tutorial 65: Creating Useful Commands from IR Remote Buttons

Поделиться
HTML-код
  • Опубликовано: 8 июн 2020
  • You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    In this tutorial we show you had to add an Infrared (IR) remote to your arduino project. This lesson shows how to map the HEX code coming from the IR module into useful commands.
    You can get the kit I am using for this series at the following link:
    amzn.to/2I7N4Ek
    I strongly suggest picking up an arduino nano, since it can plug directly into the breadboard, making a portable system more practical. You can pick one up here:
    amzn.to/2WXTC2M
    As projects get more complicated in these lessons, you guys really need to get a set of breadboard jumper wires which allow you to make neater connections on the board in your projects. You can pick a pack of these wires up here:
    amzn.to/2XrY5Kq
    In addition as projects get more complicated, you are going to need a bigger breadboard. This is a reasonable one here:
    amzn.to/2IY4d3M
    You can get the code and other details on our WEB site HERE:
    toptechboy.com...
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
    #Arduino

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

  • @williamwachter3279
    @williamwachter3279 Год назад +3

    You have kept me motivated throughout this series creating value for me every step on the way! I wish you a long and happy life. I am by nature, frugal, so understand how truly appreciative I am.

    • @paulmcwhorter
      @paulmcwhorter  Год назад +2

      Thanks! Really appreciate the support, it means a lot to me.

  • @Hino_55
    @Hino_55 4 года назад +3

    Did this before watching the video.
    I placed the delay at the very last line so that as the remote is pressed, the String almost instantaneously prints in the serial monitor.
    Thank you for this Sir Paul!

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

      Thats a GREAT Idea. Also lowered the delay to (100) and now it is "super snappy"

  • @steveholt8991
    @steveholt8991 Месяц назад

    Great lecture. Hardware differences made it necessary to go another way, but I got it working and the possibilities are obvious.

  • @keithdavies3334
    @keithdavies3334 4 года назад +3

    Thanks for another great tutorial Paul. I love working along with you in your natural, relaxed style. I did the assignment by building on Tutorial 40, controlling the DC motor using push buttons, and using the nano rather than the uno. Looking forward to the robot car tutorials. Keep up the great work!

  • @reece674
    @reece674 2 года назад +2

    Thanks again Paul. I ended up getting over my little cheap remote not working consistently and mixing up the data every now and then so I decoded the tv remote in my hotel room instead and used that haha. It was working spot on every time and made the project just that little bit easier.

  • @williamwachter3279
    @williamwachter3279 Год назад +1

    Maybe I will be able to figure out the remote on my garage door opener using your complete analysis!

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

    I did the homework. Have got my robot car from Amazon ready for the new tutorials.
    Thanks Paul.

  • @TMRu22311
    @TMRu22311 2 года назад +6

    Hey Paul, I know you have moved on to bigger/better things these days, but are there any future plans for more Arduino lessons? I am sure many of us would greatly appreciate that AND work along with your videos. There are so many great things one can do with these amazing microcontrollers!!! I would love to see a build series where you build a project and we work along with you. Either way, you are an amazing person and an EXCELLENT teacher. Thank you for all the effort you have put into these wonderful lessons.

    • @paulmcwhorter
      @paulmcwhorter  2 года назад +12

      I need to redo the arduino lessons at some point and maybe go into more advanced projects.

    • @TMRu22311
      @TMRu22311 2 года назад +2

      @@paulmcwhorter Please do, That would be wonderful :D :D :D You could give us a parts list at the beginning of each lesson so that we can work along with you.

    • @humanperson2798
      @humanperson2798 Год назад +2

      @@paulmcwhorter I would also love to see some tutorials on more advanced projects and skills!

    • @Mrgasman1978
      @Mrgasman1978 Год назад +1

      Awesome!! Also, please don't be afraid to ask us to buy some new pieces that are not included in the elego kit. I bought the nano and the flat wires and i tell you, they make a huge difference!

  • @sapnasinghal2997
    @sapnasinghal2997 2 месяца назад

    I am legend, and your tutorials make it easier!
    thank you paul

  • @electronichome1153
    @electronichome1153 Год назад

    I am legend. Great tutor again - it is really better if we do our home work in advance, then the lectures are really smooth.

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

    Yes I did this as homework. I reduced the 1500mS delay to 750mS, for a faster response, and also added a line to print "End of List", to confirm that the list has been parsed. Thanks for another great video. Looking forward to controlling the fan and motor.

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

    I managed to get it to work ok. Found that you can shorten the number of code lines be having only one "Serial.println(myCom);" after all the if clauses and before the delay. A very satisfying project.

  • @AnimeGIFfy
    @AnimeGIFfy 4 года назад +22

    You can use the "switch" statement to make the code much shorter.

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

      What would the switch statement replace? Thanks.

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

      @@roxleyldc it would replace all those if statements

    • @rabailes
      @rabailes Год назад

      You could use an array as well:
      long IRButtons[] = {0xBA45FF00, 0xB946FF00, 0xB847FF00, 0xBB44FF00, 0xBF40FF00, 0xBC43FF00, 0xF807FF00, 0xEA15FF00, 0xF609FF00, 0xE916FF00, 0xE619FF00, 0xF20DFF00, 0xF30CFF00, 0xE718FF00, 0xA15EFF00, 0xF708FF00, 0xE31CFF00, 0xA55AFF00, 0xBD42FF00, 0xAD52FF00, 0xB54AFF00};
      String txtButtons[] = {"PWR", "vUp", "Fnc/Stop", "Left", "Stop/Go", "Right", "Dn", "vDn", "Up", "Zero", "Eq", "St/Rept", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};
      ...
      for (int i = 0; i < 21; i++) {
      if (IRCommand == IRButtons[i]) {
      Serial.println(txtButtons[i]);
      break;
      }
      }

  • @rassulkuatov6160
    @rassulkuatov6160 7 месяцев назад

    Thank you so much! I decided to play with it and connected RGB LED and LED display!
    It was so much fun, thank you!
    I am happy that I bought a new breadboard and nano as you suggested!
    Wishing the best for you and your family!

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

    I am LEGEND. Added an additional function that contained a switch statement that printed what button was clicked that was based on the HEX code. Great tutorial. Onto #65

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

    Hi Mr. Paul , im a fan of of your classes and your ability to transmit knowlege. Now Im basically on my own but i found a difficulty in the process to use two similar devices in arduino. There is no a clear explanation on how to configure and manage these situation , please include a class for this situation. You are the best teacher in these technology.

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

    Now we're having fun. Loving this course.

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

    Thank you Sir! Thanks to your videos by lesson 6 I was already able to make my own proyect and program... FYI, you are a great teacher!!

  • @chukwusmart9918
    @chukwusmart9918 4 года назад +2

    Am always grateful. Best teacher ever 💪

  • @Rtech98
    @Rtech98 4 года назад

    Got it working quite well had a bit of trouble at first thought it was my code but it actually was my circuit setup. I was also able to get the Power button to function as an on and off switch. A fun little project to make I will probably an LCD display to let the user know what fan speed and mode they are on.

  • @nikhilsourav2025
    @nikhilsourav2025 3 года назад +14

    Them: "The best Arduino tutorial doesn't exist!"
    Paul McWhorter: "Hold my coffee"
    Thank you so much for this tutorial sir. I've almost completed it and learnt a lot!

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

    Another great lesson and one that will be extremely useful to my students for their robotics projects, I am doing the homework tonight. It is extremely important to do the homework, trying it out on your own rather than copying code because you learn more from your mistake than you do from copying and pasting!! See you in the next lesson. Thanks again!

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

    Dear Paul, thanks for your great Arduino tutorials. I did the project of this lesson, and it worked correctly.

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

    Sir, how to make library of IRremote to own..please 🙏🙏🙏 make a tutorial at this .....I have completed all tutorial of this series.. it's pleasure for me that you are my great teacher...

  • @CodingScientist
    @CodingScientist 4 года назад

    Nice stuff with IR, good job Paul

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

    Lesson 66 is going to be very very interesting..Thank u sir..

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

    great lessons i have learned lots

  • @williamwachter3279
    @williamwachter3279 Год назад

    Gettng inside the mouth of the machine, almost like being a dentist, tooth by tooth😂. I had no idea, thanks, Paul!

  • @ushachandramohanan1187
    @ushachandramohanan1187 4 года назад +20

    Sir can you make a new raspberry pie tutorials
    Waiting for your reply
    #with love from india

  • @muhammadrafiqulislamkhan6994
    @muhammadrafiqulislamkhan6994 Год назад

    Super project and I guess the most exciting project is coming next. The legendary Arduino magician is finally controlling everything by his programming magic, is not it? Thank you very much. God bless you.

  • @fun_engineering5710
    @fun_engineering5710 4 года назад

    I did the homework, it was fun.
    Thank you Sir, waiting for the robotics tutorials.

  • @conrayjones9290
    @conrayjones9290 4 года назад

    yes I did the homework and had great fun playing with the program.

  • @ronnelcacho3336
    @ronnelcacho3336 4 года назад

    Ill always watch your tutorial sir you are really inspiring.. I learned arduino because of your tutorial. Keep it up sir

  • @alexm.4720
    @alexm.4720 2 года назад

    Hey Paul, thanks for this amazing Arduino Series. I was able to complete the assignment. Writing the code was simple as well as connecting everything. The only problem i had, which took me like 2 hours to solve, was everything seemed to work perfectly. My code did exactly what you asked to do:
    Pressing power button, fan turned ON full speed forward.
    Pressing rw button, fan switched direction backwards.
    Pressing ff button, fan switched direction forward.
    Pressing st button, fan turned OFF.
    But when i pressed the vol+ or vol- (that was supposed to make the fan spin faster or slower) the fan would stop spinning and pressing the buttons on the Remote did nothing. After like an hour of checking my code and connections and even rewriting my code from zero, i decided to add a print inside the if statement and when pressing the vol+ or vol- button i realized it was not just the fan that stopped working but the whole program was crashing.
    I honestly had no idea what could be causing this problem, but, after a while of thinking, i remembered that when i was reading the IRremote Github (to convert my 2.x program to 3.x) it talked about the IRremote Library and something about it using PWM. I suddenly wondered if maybe the IRremote was somehow messing up the motor when i tried to analogWrite a PWM value. I googled "irRemote library messes pwm pins" and, on the first search result, i found the solution to my problem!!
    Turns out the problem was caused because i had connected my motor speed pin to digital PWM pin 3 and as the user Delta_G wrote as a response to the post "The IRRemote library uses timer 2. If you'll check, PWM is also messed up on pin 11. Pins 11 and 3 use timer 2 to drive the PWM. If it's being used for the IRRemote then they can't PWM."
    I switched my motor speed pin to pin 5 and BOOM! Everything worked perfectly!
    This assignment was a good one. I have learned so much thanks to you and i learn even more when i have to troubleshoot. Thank you for making this amazing Arduino Series. This is the code i wrote for the assignment if you would like to see:
    #include //Includes IR Library
    int IRpin=10; //Digital Pin where the IR Module Y pin is connected to
    unsigned long code; //Variable to store the IR module value
    String myCom; //Variable to assign a name to each Button on the Remote Control
    int dir1=3;
    int dir2=4;
    int speedPin=5;
    int mSpeed=255;
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600); //Inicialize Serial Comunication
    //Inicialize the IR Module
    IrReceiver.begin(IRpin, ENABLE_LED_FEEDBACK);
    pinMode(speedPin, OUTPUT);
    pinMode(dir1, OUTPUT);
    pinMode(dir2, OUTPUT);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    //We wait in the loop until there is data
    while (IrReceiver.decode()==0) {
    }
    //When there is data, we store it in the variable code
    code=IrReceiver.decodedIRData.decodedRawData;
    if (code == 0xBA45FF00) myCom="power";
    if (code == 0xB946FF00) myCom="vol+";
    if (code == 0xBB44FF00) myCom="rw";
    if (code == 0xBC43FF00) myCom="ff";
    if (code == 0xEA15FF00) myCom="vol-";
    if (code == 0xF20DFF00) myCom="st";
    if (myCom == "power"){
    digitalWrite(dir1, LOW);
    digitalWrite(dir2, HIGH);
    analogWrite(speedPin, 255);
    }
    if (myCom == "vol+"){
    mSpeed=mSpeed+25;
    if (mSpeed>255) mSpeed=255;
    analogWrite(speedPin, mSpeed);
    }
    if (myCom == "rw"){ //Spin backward
    digitalWrite(dir1, HIGH);
    digitalWrite(dir2, LOW);
    }
    if (myCom == "ff"){ //Spin forward
    digitalWrite(dir1, LOW);
    digitalWrite(dir2, HIGH);
    }
    if (myCom == "vol-"){
    mSpeed=mSpeed-25;
    if (mSpeed

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

      i struggled for over an hour trying to use the modern libraries, ended up so close. then i saw your breakdown and it really helped me with " code=IrReceiver.decodedIRData.decodedRawData;" that is what i needed to continue. thank you!

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

    having advanced just a fraction beyond your teachings, I had to come back and ask you why did you teach us to use "if" statements for each button rather than using "switch/case"? same question for why you used "int" to identify each lcd pin rather than using "LiquidCrystal lcd = LiquidCrystal (7, 8, 9, 10, 11, 12)"?
    I'd further add, that while this series has a most amazing, well designed tutorial, I'm a little disappointed that it didn't include any lessons on creating functions "void myfunction(){ }" They seem to be a pretty crucial part of Arduino programming. But I do recognize and thank you for including them in your Robot programming series!

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

    After figuring out how to adapt to the version 3 IR protocols, I am legend.

  • @yousafkhan525
    @yousafkhan525 4 года назад

    I am a beginner, big fan of your videos so far .Can you make a short video on how to use a segment display or about a beginner breadboard projects. Thank you.

  • @boowonder888
    @boowonder888 4 года назад

    I think if you wanna turn on the motor you have to insert digitalWrite high/low in the code. I always had a thng for dc motors since I opened one from a racing track car back in around 1980. I saw 3 parts inside and I was fascinated. To this day I scrap them and save them.

  • @kwissiekwissie
    @kwissiekwissie Год назад

    I AM LEGEND because it is now version 4 with all kinds of different code's. I've got no errors anymore....

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

    Paul i got this to work on my own but the code has changed since you made this video so I'm going to paste the new code below. I also did it a little different. I just printed the number instead of the word. All you'd have to do is replace the number with the word, or whatever you wanted it to print. Here's the new code as of 7/10/2022:
    NOTE: your "IR number" may be different so youll have to check that for each button.
    #include
    IRrecv IR(9);
    int led = 8;
    String myCom;
    void setup() {
    IR.enableIRIn();
    Serial.begin(9600);
    pinMode(led, OUTPUT);
    }
    void loop() {
    if (IR.decode()) {
    delay(1500);
    IR.resume();
    }
    if (IR.decode()) {
    if (IR.decodedIRData.decodedRawData == 0xE916FF00) {
    myCom = "0";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xF30CFF00) {
    myCom = "1";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xE718FF00) {
    myCom = "2";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xA15EFF00) {
    myCom = "3";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xF708FF00) {
    myCom = "4";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xE31CFF00) {
    myCom = "5";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xA55AFF00) {
    myCom = "6";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xBD42FF00) {
    myCom = "7";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xAD52FF00) {
    myCom = "8";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xB54AFF00) {
    myCom = "9";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xBA45FF00) {
    myCom = "pwr";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xB946FF00) {
    myCom = "vol+";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xB847FF00) {
    myCom = "func/stop";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xBB44FF00) {
    myCom = "back";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xBF40FF00) {
    myCom = "play/pause";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xBC43FF00) {
    myCom = "fwd";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xF807FF00) {
    myCom = "down";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xEA15FF00) {
    myCom = "vol-";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xF609FF00) {
    myCom = "up";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xE619FF00) {
    myCom = "eq";
    Serial.println(myCom);
    }
    if (IR.decodedIRData.decodedRawData == 0xF20DFF00) {
    myCom = "st/rept";
    Serial.println(myCom);
    }
    delay(1500);
    IR.resume();
    }
    }

    • @justmc62
      @justmc62 Год назад

      Thank you so much for posting this- Upgraded to library 3.9.0 and even though I followed the documentation the best I could , the new code changes still had me stumped. Your code posting cleared it up for me... Great to see a movement growing up around us !!

    • @diessos
      @diessos Год назад

      @@justmc62
      Found another command
      int command = IrReceiver.decodedIRData.command;
      that provides a numeric value...
      then built 2 arrays
      int arrCodes[] = {69,70,21,71,68,67,64,7,9,25,13,22,12,24,94,8,28,90,66,82,74};
      String arrButtons[] = {"PowerButton","VOL_UP","VOL_DOWN","FUNCSTOP","FF_LEFT","R_FF_RIGHT","PLAY","DOWN","UP","EQ","STREP","0","1","2","3","4","5","6","7","8","9"};
      then searched the first array looking for the index
      for(idxCode=0; idxCode You pressed:PowerButton
      11:30:19.268 -> You pressed:9

  • @snehashishbanerjee2575
    @snehashishbanerjee2575 4 года назад

    Your tutorials are always interesting, sir! I always enjoy the way you teach. As your tutorials are the BEST and most easy to understand on entire RUclips, I do have a request -- can you plz add a tutorial on 8X8 LED MATRIX in this series? For me, it's a very interesting component but I always struggle to make the circuit as well as the code right..! Thanx in advance sir..!

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

    discovered something. My Kit was missing the IR Receiver but had the Transmitter (remove controller). No buggy, sent for one and received both a receiver and another Transmitter. The button layout on the other Transmitter was different. They both looked VERY generic, like the had come out of the same molds etc, except one fascia was white and one was black with different placements of keys, but the same 3x7 matrix for the buttons. (21 buttons, some buttons missing or in a different place).
    When checking codes I discovered that the codes were all identical in both removes, with a twist.
    For example the "Zero" button on one gave a different code to the "Zero" button on the other remote, but the button at the same grid reference had the same 3 byte code. ie top left button on each remote gave the same code even though they were labeled as different buttons. So it seems that (at lease on these cheep remotes) its the grid position that determines the code of the button and not the button face value.
    Damn, that was wordy, but not sure I could cut it down much without loosing clarity. Hope its clear what I'm saying! Is it?
    Oh yeah, I did the homework plus some.

  • @2006death2006
    @2006death2006 4 года назад

    you sir have made me get 3 of the bords now and have made kits for displaying text on lcd screens when they get a dcc input and allso a high low input from a push swicth great work onces again

    • @phillovegrove4704
      @phillovegrove4704 4 года назад

      You got me on that one Paul. All was going great until the motor started and the IR stopped. Spent hours checking my wiring and code until I guessed it might be motor 'noise', cured it with 100uF on the supply near to the IR. Relieved to have watched your next tutorial. Keep em coming!

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

      @@phillovegrove4704 Dude. I can't believe I found this comment! This is my exact issue. Also figured it was RF garbage from the motor. What's odd is that the first time I got this working, that issue was not present. I then brought the whole thing to my lady's house, had to troubleshoot after the move, worked on it, brought it back home, and today this problem starts. So bizarre. When the motor is plugged into the breadboard *and spinning*, the LED indicator on the IR sensor goes nuts, and the sensor stops receiving. Unplug the motor, sensor works. I will report back once I've tried the capacitor trick!

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

      @@phillovegrove4704 Yeah, any interpretation of "100uf on the supply near to the IR" results in the IR sensor, or the Arduino, or the whole thing not powering on. I am observing the polarity of the capacitor--negative side goes to lower potential side of the connection...
      Would you mind elaborating? ...2 years later?

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

      Figured it out. The capacitor goes ACROSS the supply and ground (connects to supply and ground) at the IR sensor. 10uF did NOT work. 100uF DID work, as @Phil Lovegrove said.
      However, since this problem started, my remote readings still are not perfectly clean like they were before. 80% good. Occasional garbage. What's odd is the funny readings seem to only be present in the serial monitor--the fan responds as programed.

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

    Hey Paul, love your videos, do you maybe plan do a video on Bluetooth Moduls for Arduino, something like HC-05 ?

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

    I did almost the same thing but I printed everything outside the if statements

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

    Could you do more projects that combine multiple components? Also my main questions is could you do a series on the mega 2560 most complete kit. There are a few pieces in there I have no idea about but I want to. Here’s the list Max7219/LED matrix, DS3221 RTC module, IR receiver module, GY 521 Module, Rc522 RFID module and the prototype expansion board. Other videos aren’t helpful. It’s usually a fast forwarded shot of someone putting the components together then 30 secs of scrolling through their code without explaining why or how to set it up

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

    i fixed up some code that works with the new library version

  • @tameraziz2104
    @tameraziz2104 4 года назад

    Thanks Paul.

  • @larryfostano6626
    @larryfostano6626 4 года назад

    I am Legand, all I needed to do is remove the Serial.print statement printing HEX Serial.print();I also put in an LED to turn on with remote.

  • @sammysam1503
    @sammysam1503 4 года назад

    I am legend! Did this one on my own!

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

    Hey Paul, Are you planning to give RF tutorials for arduino? If yes, can you do a lora e32 module? Been a great help to all of us. Thanks so much and Keep it up!

  • @hasaanshah9716
    @hasaanshah9716 4 года назад

    Hey, hope your doing good. Great Video! I would like to know how you are recording the overhead shot of your Arduino boards. Do you use a tripod? I would like to setup something similar, where I record all my notes and work being done for school. Thank You for these amazing videos!!

  • @thanarajg3134
    @thanarajg3134 4 года назад

    Sir Can you Add a tutorial about " How to use Wireless RF 433MHz Transmitter and receiver Module " with Aurduino
    I learned arduino because of your tutorial . You Are A legend in teaching this.
    love from india

  • @mike-wr6uk
    @mike-wr6uk 2 года назад

    Hello paul, I have been trying to build an RC car using DPDT relays, and something on the internet said that using a diode creates a polarity on a relay, and I have not been able to find anything else about it on the internet except for the one thing I saw. So basically I want to ask you if you know anything about this, because I dont want to create a circuit to find out its all messed up. My specific questions are is there actually a polarity if I use a diode and if so, how do I know which side the polarity is on. Thanks for taking the time to read this.

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

    For some reason, only the first 9 if statements seem to work.. , I see that Hexadecimal numbers on E-Lego remote is just 6 characters long, where as my TV remote's is 8 characters long. that could be the problem, i am beginning to think..

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

    Hello Paul, can we write a password with the remote to send a signal?

  • @TheRealFrankWizza
    @TheRealFrankWizza 4 года назад

    I took two readings for every button.
    if (cmd.value==0xFFA25D || cmd.value==0xE318261B){
    myCom="You Pressed Power";
    Serial.println(myCom);
    }
    I am getting good accuracy like this.
    Your controller seems more constant on which value it hits than mine. I can get at least 3 for each button, depending on where I aim it. But I have an ir camera on my 3d printer so that might cause noise.

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

    "switch" "case" statement makes for cleaner, simpler code.

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

    Paul, pls tell range of this remote...

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

    Everything works fine on my download but one legend at the beginning: When I press any button on the IR transmitter, a legend shows to the plotter saying “The function decode (&results)) is deprecated and may not work as expected! Just use decode () without a parameter and IReciever.decoded IRData . .” I don’t know what it means.

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

    Sir, please make tutorials on RF modules. (nrf24l01 and else.)

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

    Please do make a tutorial on Bluetooth module for arduino.

  • @omarinhomoudy
    @omarinhomoudy 4 года назад

    Thanks very much

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

    Paul, in an effort to untether, I decided to output this sketch to my lcd display instead of using the serial monitor. So I included the lcd library, created the lcd object, connected the lcd screen to the nano on my big breadboard and re-assigned the IR pin to pin 6. However, I can’t get anything to print to the lcd! I kept the serial monitor going ( for debugging purposes) so I know the code from the remote is still working. Can I lcd.print(myCom) or is there a problem with lcd printing a string? Any guidance? Can everything we print to the serial monitor also be printed to the lcd display?

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

      Paul, I found the problem! I reloaded the Hello World sketch to check my connections and I got a blank screen. So I went to your Top Tech Boy website for an lcd lesson, checked the schematic, and found that I had not hooked up the VSS or the VDD connections- everything else was right. Doah! Now it’s Giddyup! I’ve made comments in my sketch to always hook up those connectors which I hadn’t done before and consequently missed it going forward. Thanks Brother! God Bless You!

  • @kuravani1963
    @kuravani1963 4 года назад

    Thanks for the Tutorial,,,

  • @bradleyo.4137
    @bradleyo.4137 4 года назад

    I am wondering which kit to buy to follow your tutorials, I have narrowed it down to two choices, the one you recommended, and a similar one I found that looks like it has better value but for a cheaper price.
    Here is the one I am inquiring about. - Smraza Ultimate Starter Kit
    My question is, would I still be able to follow your tutorials accurately with the second link or should I get the exact kit you have gotten (with your affiliate link of course)?
    Note: The reason I'm considering the second link is because it seems like it has a lot more cool sensors and motors.
    I will order a kit and watch your tutorial as soon as you respond and can't wait - thanks for your help.

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

      I am using Smraza super starter kit. There are minor differences in the kit he is using and the one I am using. Mine did not come with a L293D motor control chip or a DC motor. I picked those up off Amazon for cheap. The other component that is different is the remote. Everything else is the same.

  • @danielfynn6533
    @danielfynn6533 4 года назад

    Nice tutorial so far, but Sir, please can you make a video on how to load a bootloader to an ATMEGA 238 chip using an arduino UNO board?

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

    I AM.... not... legend... Officially giving up and moving on to watch you do it, Paul.
    Had this nearly completely working (only lacking speed control) 2 days ago. Then moved the setup to my lady's house. Something went wrong in transport. Troubleshooted. Figured that out--don't even remember what the prob was at this point. Brought it all back to my place. Something went wrong again in transport. Spent hours troubleshooting. When my volt meter graced the supply pin on the control chip + ground, the motor mystically started. (Lol.) More troubleshooting.
    Decided to switch to the new big breadboard you recommended (this must contain less resistive metal than the Elegoo breadboard because the motor started singing when I powered it up--I've never heard it go so fast). Now I've got a strange RF noise issue (my guess, but seems to be right) blasting from the motor, seemingly jamming the IR sensor. I can power the motor on, but once it's running, the IR sensor's indicator LED goes crazy and the sensor won't...sense.
    One lonely comment mentions what sounds like my new issue, says to use a 100uF capacitor, but vaguely describes where. A stackexchange.com post gets more specific. Finally cured *half* of the "RF noise" problem by putting a 100uF capacitor *across* the supply and ground to the IR sensor-the sensor's LED is no longer going buckwild, but still can't take input while the motor is running. Same stackexchange post said to try the Arduino's 3.3V supply for the sensor as well, as the motor is spewing AC noise along the 5V rail on my breadboard-taken with a grain of salt, until...
    After testing, confirmed that the issue is 90% gone with a combo of powering the sensor from the Arduino's 3.3V, and using the capacitor across *that* and ground, right smack at the IR sensor. I say 90% because the range of the remote seems to be effected (like the sensor is still "trying to overcome the noise floor"), and I get occasional strange readings in the serial monitor, while the motor seems to respond to commands as expected... odd. Maybe I have to press a button twice every once in a while. Maybe the odd serial mon readings and the need to press a button twice *are* related, and I'm too fried to notice.
    I'm really feeling like something is wrong, here. Mostly because this all worked fine 2 days ago, once I "figured out" the library version issue and rewired the whole thing. Didn't need the capacitor or the separate power supplies for the sensor and motor.
    If anyone could shed some light on this, I would be extremely appreciative. Maybe the next video will address some of my issues.

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

      A big issue on any project with a motor is noise. Try twisting the leads on the motor to form a little rope like structure, or put a capacitor between + and ground on the motor.

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

      @@paulmcwhorter Bah! Can't believe I didn't think of the twisting. We use lots of twisted pairs in the audio world, in balanced microphone signals and ethernet! Thank you for taking the time to give me some pointers! Twisted those suckers tightly!
      Also tried the capacitor both across the black and red motor wires and across the + and ground of the control chip. Tried 100uF and 10uF (one of those has to be what you meant, right?). The only place the capacitor seems to help, in my setup, is across + and ground of the IR sensor, as close as physically possible. The very best place I found, in terms of IR sensor performance, is just behind the IR pcb in the closest hole I can reach.
      I also realized that I've probably been testing with the motor much closer to the whole circuit than I was before, hence the new interference. When I move the motor (and its wires) physically away from my breadboard, it makes a big difference. I also suspect that the big metal plate this bigger breadboard is on has something to do with it. If I tape the motor to the plate, even with the separate voltage regulation and capacitor right at the sensor, I cannot receive commands, and see noise on the serial monitor once the motor's running. I can put the motor even closer to the circuit and get everything working, as long as the motor isn't sitting on top of the metal plate. Still some noise in the readout, but I can easily ID valid commands, and so can the IR sensor.

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

      So after lots of testing and troubleshooting trying to make speed control work (I un-gave up for a while), I've figured SOMETHING out...
      For testing, I made a new variable to store serial monitor input, and modded each if statement to depend on that variable. The idea was to use serial monitor to take motor control input instead of the IR sensor + remote. I commented out these lines: 1) IrReceiver.begin in void setup, 2) the "waiting" while loop (changed it out to wait for serial input) 3) the block of code starting with "cmd=" and ending with "IrReceiver.resume()".
      Everything works flawlessly. WTFork?
      Then I uncommented specifically the IrReceiver.begin(IRpin) ONLY, and now any PWM value other than 255 for mspeed results in the motor turning off, and the system taking no input from serial monitor. When I was using the IR sensor and remote for control, I had the same issue--if I dropped the speed by one increment (-20 to 235, in my code) the motor would shut down and stop taking IR input.
      (To be clear, my mulitple comments on this page are discussing different problems--a few with code (as this one is) and one's about RF interference from the DC motor. If you're confused by the last statement in the last paragraph, based on what you've previously read...)
      SO... Everything works as expected taking input from serial monitor as control commands, but the moment I initialize the IR receiver, the speed control breaks and I can take NO kind of input--even when only using the serial monitor for input! Wut!
      Anyway, I've re-given up, and am finally moving to the next video after a short break. This has been 4 days of my life and I feel like a failure!

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

    I have the official Arduino kit and my remote is different got their in the end putting all the buttons in.

  • @user-vn7ce5ig1z
    @user-vn7ce5ig1z 4 года назад +1

    It would be easier, cleaner, and less error-prone to eschew the pile of _if_ statements in favor of an array and enums.

    • @MJCPeters
      @MJCPeters 4 года назад

      What lesson was that in?

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

    Does anyone know if its possible to make the IR remote work even if the arduino isn't connected to your computer? I've been trying but it doesn't go...

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

      It's definitely possible. Need to make sure everything has 5V and ground!

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

    Made some typos but those were easy to find. Harder was finding why myCom was causing a failure to compile..... undefined in this scope error. Many scans through the lesson in still mode did not reveal problem, thinking it was not declared. Most of what I tried did not work. Finally gave up and went to toptechboy site and downloaded the code for the lesson, String myCode made all the difference! Could not find that in the video I was watching but had looked for it.
    Lot of copy paste and all keys now report without the hex code printing. Comment one line to stop that.....quite impressive

  • @Kagesh53150
    @Kagesh53150 4 года назад

    I was able to get the homework done. I needed to watch a couple of the past lessons to review the DC motor control. I am having an issue with the Remote Controller, I am not able to get consistent codes from it. One in every 3 to 5 button presses will be the correct code for the button, the rest are nonsense codes. I guess this could be a problem with the IR sensor module. I have put a new battery in the controller but that didn't help. Has anyone else seen this issue? Not sure if I should get a new controller or a new IR sensor? Or maybe both? Thanks!

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

      Hello, I had the same problem I used a delay of (750) right before resume(); Resume is the last line of code. Also mine is very sensitive in that if I don't point it correctly it will not receive correctly.

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

    Homework:
    #include
    int infrared=3;
    int wait=500;
    String myCom;
    int speedPin=5;
    int dir1=2;
    int dir2=4;
    int minSpeed=110;
    int maxSpeed=255;
    int Speed;
    int deltaSpeed=20;
    int ON;
    int spin;
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    IrReceiver.begin(infrared);
    pinMode(speedPin,OUTPUT);
    pinMode(dir1,OUTPUT);
    pinMode(dir2,OUTPUT);
    Speed=0;
    }
    void loop() {
    // put your main code here, to run repeatedly:
    while (IrReceiver.decode()==0){
    }
    //Serial.println(IrReceiver.decodedIRData.command,HEX);
    delay(wait);
    if (IrReceiver.decodedIRData.command==0x45){
    if (Speed==0){
    myCom="ON";
    Serial.println(myCom);
    Speed=(minSpeed+maxSpeed)/2;
    ON=1;
    spin=1;
    digitalWrite(dir1,HIGH);
    digitalWrite(dir2,LOW);
    analogWrite(speedPin,Speed);
    Serial.println(Speed);
    }
    else {
    myCom="OFF";
    Serial.println(myCom);
    Speed=0;
    ON=0;
    digitalWrite(dir1,LOW);
    digitalWrite(dir2,LOW);
    analogWrite(speedPin,Speed);
    Serial.println(Speed);
    }
    }
    if (IrReceiver.decodedIRData.command==0x46){
    if (ON==1){
    myCom="Speed Up";
    Serial.println(myCom);
    Speed=Speed+deltaSpeed;
    if (Speed>maxSpeed){
    Speed=maxSpeed;
    }
    analogWrite(speedPin,Speed);
    Serial.println(Speed);
    }
    }
    if (IrReceiver.decodedIRData.command==0x15){
    if (ON==1){
    myCom="Speed Down";
    Serial.println(myCom);
    Speed=Speed-deltaSpeed;
    if (Speed

  • @aaronmilliman7685
    @aaronmilliman7685 Год назад

    I am Legend, & late for work! gotta run.

  • @stephenmichael2687
    @stephenmichael2687 4 года назад

    I got the homework done. Is it considered cheating if I'm heavily using previous programs?

  • @Bambicarus
    @Bambicarus 4 года назад

    I have been stumped with this one. My remote will return various codes for the same button pressed. For example, If I press the 0 key 20 times I get 5 or 6 different codes, to make matters worse some of the codes are shared with other keys. Like both the 1 and 2 keys have the code '255' as one of their options.
    Any ideas why this might be? I have copied your code line for line!

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

      Hello, I had the same problem I used a delay of (750) right before resume(); Resume is the last line of code.

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

    Success, I am Legend!!!

  • @thomaseardley2900
    @thomaseardley2900 4 года назад

    why are lessons 66 and onward private videos are they meant ?

    • @gabrielfusaro223
      @gabrielfusaro223 4 года назад

      He posts new tutorial vids every week on Tuesdays, so you’ll get it pretty soon

  • @jamieyz
    @jamieyz 4 года назад

    Amazon was to send me some DC motor chips and a can opener. Only the can opener showed up. Bummer, I will have some soup and wait.

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

    I am Legend. Thanks

  • @blackframe5095
    @blackframe5095 4 года назад +2

    BooooooooooM ✨✨✨

  • @user-pd2ph6ws5r
    @user-pd2ph6ws5r 7 месяцев назад

    Still getting FFFFFFFF read outs on my monitor display. Can some one help me fix this?

  • @matthewcollins1858
    @matthewcollins1858 Год назад

    Present.

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

    I have never seen a RUclipsr who has less dislike to like ratio than him...👌

  • @weipengwang9960
    @weipengwang9960 4 года назад

    I am legend!

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

    I should get an award (or punishment) for most wordy comments.

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

      GOLD STAR. There you got your award for being active member of the channel community. Well done.

    • @justmc62
      @justmc62 Год назад

      Thank you so much for posting this- Upgraded to library 3.9.0 and even though I followed the documentation the best I could , the new code changes still had me stumped. Your code posting cleared it up for me... Great to see a movement growing up around us !!

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

    I am legend

  • @handywijaya11
    @handywijaya11 7 месяцев назад

    i AM LEGEND

  • @chrysndedigwe2569
    @chrysndedigwe2569 5 месяцев назад

    i am legend

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

    Where is your coffee???

  • @bigbear333uk1
    @bigbear333uk1 4 года назад

    Hi Paul I was the first one on Tuesday to comment but now it has disappeared do you know why?

    • @paulmcwhorter
      @paulmcwhorter  4 года назад

      I moderate comments so they dont show up until I approve them. This keeps spam and nonsense down. I did not delete your comment, it should be there

    • @bigbear333uk1
      @bigbear333uk1 4 года назад

      I understand which is good
      just to let you know i Have my Smart Robot 3.0 ready and waiting and love your teaching. I have learnt a lot from you.
      Thank you.

  • @jadismail7206
    @jadismail7206 4 года назад

    hi

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

    do more arduino tutorialsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

  • @fury4076
    @fury4076 4 года назад

    First comment ⚡ Amazing

  • @filipegameiro4344
    @filipegameiro4344 11 месяцев назад

    I im Legend

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

    This would have been the time to introduce the switch statement instead of going through all these if statements. This was a boring lesson...

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

    I use a switched case instead of if statements and it works well too. Here is my code:
    #include //Make sure to install the library
    int IRpin=3;
    IRrecv IR(IRpin);
    decode_results cmd;
    int msg;
    void setup()
    {
    Serial.begin(9600);
    IR.enableIRIn();
    }
    void loop() {
    while (IR.decode(&cmd)==0){}
    msg = cmd.value;
    switch (msg) {
    case 26775:
    Serial.println(0);
    break;
    case 12495:
    Serial.println(1);
    break;
    case 6375:
    Serial.println(2);
    break;
    case 31365:
    Serial.println(3);
    break;
    case 4335:
    Serial.println(4);
    break;
    case 14535:
    Serial.println(5);
    break;
    case 23205:
    Serial.println(6);
    break;
    case 17085:
    Serial.println(7);
    break;
    case 19125:
    Serial.println(8);
    break;
    case 21165:
    Serial.println(9);
    break;
    case -23971:
    Serial.println("PWR");
    break;
    case 25245:
    Serial.println("v+");
    break;
    case -22441:
    Serial.println("v-");
    break;
    case -28561:
    Serial.println("up");
    break;
    case -8161:
    Serial.println("down");
    break;
    case 8925:
    Serial.println("");
    break;
    case 765:
    Serial.println(">|");
    break;
    }
    delay(500);
    IR.resume();
    }
    I just didn't include the EQ, ST/REPT and FUNC/STOP because I didn't know what they are for

  • @user-um3ui1gu9t
    @user-um3ui1gu9t 3 года назад

    It is by no way smart to use string for anything in the code (like "pwr"...)
    Just use : #define cde_pwr 0xFFA25D
    Then you can compare the command received with a binary number.

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

      Thanks for the tip, but ya gotta be a little nicer. I shouldn't have to explain why...