简体   繁体   中英

Arduino IR code not working (USING TINKERCAD)

ARDUINO PROBLEM

在此处输入图像描述

**So this is the circuit bord **

THE PROBLEM: when I try to run the code and try to press any button on the IR remote it does nothing ( it doesn't print the hexacode ! )

  • I have tried to change the circuit and tried to change the code. I was looking fro the arduino forums and tried every one, but still it doesn't work.
  • Is there a problem with tinkercad. simulation or is it with the code?

CODE: https://pastebin.com/1Uhn1j3a

CODE:


#include <IRremote.h>

const int RECV_PIN = A5;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
  Serial.begin(9600);
  irrecv.enableIRIn();
  irrecv.blink13(true);
}

void loop(){
  if (irrecv.decode(&results)){
        Serial.println(results.value, HEX);
        irrecv.resume();
  }
}

Two of the L293D ground pins are, according to your circuit layout, connected to the +5V rail inadvertantly. And the other two are connected to GND. According to this post the grounds are all internally connected, so in effect you would be shorting the +5V output to ground.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM