Well Im pretty much attacking this kit I bought lol. I am kind of just plugging things in and hoping it does something honestly. I just shoved a IR sensor (VS1838B) on my board ran the 5v line to it and a 220 ohm resistor (only because I saw someone use that for an LED on a tutorial lol. No clue what I am really doing).
So I am just reading the input. Curiously just being on gives the value 123-127. While holding down any button on the remote I am using you get 13.
I assumed that maybe the sensor becomes more resistant when IR light is present and that 125ish is what ambient light does to it. I decided to take out the resistor to someone test that theory (yes I know that's bad) oddly I still got 125 and 13 on a button press.
So I have more experimenting to do I guess.
int ir = A0;
int data = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
data = analogRead(ir);
if (data != 125) {
Serial.println(data);
}
else {}
delay(100);
}
Then if data is not equal to 125
Then print data.
Take out if statement.
Then use println(ir);
That is what you need to send
Hope tbst helps
Sorry I dont understand. Data is only initialized as "0", that code doesn't actually effect anything. I have the if statement there to filter out the 125s that it gets for just being on. (make it easier to read the log).
Also printing IR would result A0. You need to analog read A0 into memory first, which is why we have data.
seadanzig:
my bad just reread your code again I'm using my phone with a cracked screen. Have you looked at the data sheet for the ir receiver
Not that I really know how to read one, I found on in Japanese lol.
I just found this though, though it seems to be getting a different but similar result to me. Every button on the remote just puts the same number in the monitor.
Ampix0:
Well Im pretty much attacking this kit I bought lol. I am kind of just plugging things in and hoping it does something honestly. I just shoved a IR sensor (VS1838B) on my board ran the 5v line to it and a 220 ohm resistor (only because I saw someone use that for an LED on a tutorial lol. No clue what I am really doing).
Unless you want to spend a lot of extra time, a non-trivial amount of money replacing broken parts, and occasionally cause avoidable personal danger to yourself; this is a habit you need to break (at least while working with electronics). Seriously, you should have a basic understanding of how a part functions and what it's rated for both normal operation and the worst conditions it can withstand. The ratings are found in the part's datasheets, sometimes along with additional useful information.
Where did you buy this kit? Depending on who sold it to you, they might have datasheets for all the sensors. If not try doing a Google search for the part's datasheets.