Day IDK again(sorry).
So, today I really tried to make my car wirelessly steerable.
Using the library IrRemote (
https://github.com/shirriff/Arduino-IRremote) for arduino.
Been trying to figure out this old remote I found at home.
It works surprisingly well, the only problem is that it returns a 12th bit of value 1(true) every second press.
First Press on button 1:
1
Second Press on Button 1:
100000000001
It even keeps the toggle for a new button:
First Press on Button 2:
10
Second Press on Button 4:
100000000100
Should be easily filtered out by removing every 12th bit with a bitwise subtraction.
However, the wierd thing happens when I hold down a button.
Sometimes, it returns things like this. (Held down The button 3 for 10 seconds):
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11100100010000000000101100010100
11
11100100010000000000101100010100
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11100100010000000000101100010100
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
Have no idea what it is, but I'll either filter out it by doing an OR on the if statements, or to just ignore every input over 13 bits. However, I think it is a "placeholder" or "marker" for something, to indicate a cycle maybe.
And oh, here is my code, no comments on it because it is all on the website of the library I'm using.
http://pastebin.com/iR3Bau6G::UPDATE::
I think the error stated above is caused by bounces in the remote. Or that Serial.println() isn't fast enough. Have no idea, maybe it's even a problem with the IRremote library. I should maybe try another remote and see. (Not a sony one though, heard that it sends the info three times so that would just be a mess.)