Pages: [1]   Go Down
Author Topic: IRremote and NewSoftSerial trouble  (Read 821 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a project in which I am using both IRremote library and NewSoftSerial. It appears that these two libraries have a little trouble working together and I don't know why. Yesterday when I was testing the whole thing there were no problems. Serial communication using newsoftserial worked and I could receive IR remote signals. Later I added a few things to my code and changed some things... and the thing started making problems. I don't have any idea what is wrong but I can't receive any IR codes anymore. A few moments after I restart arduino I still get them but after that no more IR codes are received. If I pull out serial lines and restart arduino I can again receive IR codes. Here is a complete code if anyone has any idea:

http://pastebin.com/yKkgCkFn

Here is a link to the IRremote library:
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

both of them blocks while reading data I guess. So if one reads the other can't resulting in missing data.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think that that is the case here. Because it was working before I started adding things. Probably I did something somewhere...
Logged


0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got it! The problem is with the tone function. If I use it and NewSoftserial and IRremote all together the IRremote library stops working. But if I comment out any references to tone() in my code the whole thing starts to work. I can now use IRremote and NewSoftSerial. I am still not happy because I need a way to generate sound at some points but at least it is not as important.
Logged


Pages: [1]   Go Up
Jump to: