Pages: [1]   Go Down
Author Topic: What can I do with these IR sensor results??  (Read 134 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
With the code that I found on this page, the IR-receiver reacts perfectly on my IR remote conol. But with a lot of data!
My question is: how can I be able to control for example a car with my IR remote with a block of information like this (see ned of message). I thought it would be just a code of something like 10 digits that I can use in a switch case statement. So I'm wrong I guess...

Thanks for your help in advance!
Bram

Quote
4   0
9032   0
9032   1
13472   1
13472   0
14056   0
14056   1
15708   1
15708   0
16288   0
16288   1
16824   1
16824   0
17408   0
17408   1
17932   1
17932   0
18524   0
18524   1
19040   1
19040   0
19640   0
19640   1
20164   1
20164   0
20760   0
20760   1
21296   1
21296   0
21876   0
21876   1
22412   1
22412   0
22996   0
22996   1
23508   1
23508   0
24112   0
24112   1
25768   1
25768   0
26348   0
26348   1
26864   1
26864   0
27464   0
27464   1
29120   1
29120   0
29700   0
29700   1
31352   1
31352   0
31932   0
31932   1
33584   1
33584   0
34172   0
34172   1
35824   1
35824   0
36408   0
36408   1
38060   1
38060   0
38640   0
38640   1
40296   1
40296   0
40876   0
40876   1
41416   1
41416   0
41992   0
41992   1
43640   1
43640   0
44232   0
44232   1
44768   1
44768   0
45348   0
45348   1
45884   1
45884   0
46468   0
46468   1
48080   1
48080   0
48700   0
48700   1
49236   1
49236   0
49816   0
49816   1
51448   1
51448   0
52052   0
52052   1
53700   1
53700   0
54284   0
54284   1
55944   1
55944   0
56520   0
56520   1
57060   1
57060   0
57644   0
57644   1
59276   1
59276   0
59876   0
59876   1
61532   1
61532   0
62108   0
62108   1
62648   1
62648   0
63228   0
63228   1
64884   1
64884   0
65464   0
65464   1
Bit stream end!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post your code. It looks like your dump output has two components: the IR key code, and the start/stop of the detection. I think a switch statement would be a good starting point.

If you can write a switch on the key codes, you can easily add forward/reverse/left/right commands. And if you pair that with the start/stop portion, your switch statement will be able to cancel each of the commands you write. That would be a good start, I would think.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, with the sketch from the IRremote library I was able to get short HEX-values, wich can be converted here (http://www.google.com/url?q=http%3A%2F%2Fwww.statman.info%2Fconversions%2Fhexadecimal.html&sa=D&sntz=1&usg=AFQjCNERxc-CB1qADFfYs_jLL8ZqVtUM2w) to get decimal values. Now I am able to control a led with my remote control.
Thanks for your help!
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 24
Posts: 1766
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Some examples and background details here:
http://arduino-info.wikispaces.com/IR-RemoteControl
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Pages: [1]   Go Up
Jump to: