I have a question/problem with one arduino project(this is not the full project, but just the part thats not working).
So.... I am working with IR receiver and a remote. The program is: until one of the buttons on the remote isn't pressed, a red led should be ON. When a button gets pressed on a remote, the red led should turn OFF. But it wont turn off. It stays on. I dont know where I screwed up....
It sound easy, and it is, but it wont work. I am still learning....
Here is the program:
#include <IRremote.h>
const int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int redPin = 6;
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hello
I read the instructions. Sorry about that...
Currently I am doing my project on tinkercad, because I have some problems with my arduino.
Here is my picture of everything I am working with on my project in tinkercad:
Ehh.... hopefully there is an image above this. Anyway... yea.
Serial.print("irrecv.decode ", irrecv.decode); Serial.print("results ", results); Serial.println("whatever you think this will do "irrecv.decode(&results));
to void loop() in this fashion:
void loop(){
digitalWrite(redPin, HIGH);
if(irrecv.decode(&results)){
Serial.print("irrecv.decode " , irrecv.decode);
Serial.print("results ", results);
Serial.println("whatever you expect this do ", irrecv.decode(&results));
digitalWrite(redPin, LOW);
irrecv.resume();
}
}
it works better if you label what it is you're seeing. Study Serial.print(F(... which is a better way to do this
The code you sent doesn't work. I'm sorry, but I cant send you the error. On tinkercad I cant copy it.
It just marks this part of the code red:
Serial.print("irrecv.decode " , irrecv.decode);
Serial.print("results ", results);
Serial.println("whatever you expect this do ", irrecv.decode(&results));
I'll put the attachment of that image too, but the error is really long.
I would do this in normal arduino application, but my arduino is going to arrive next monday.
Maybe tinkercad is the problem, and not the hole code.
Anyway, thanks guys. Sorry I cant give you more information...
Serial.print("irrecv.decode " , irrecv.decode);
Serial.print("results ", results);
Serial.println("whatever you expect this do ", irrecv.decode(&results));