I have a simple application to control servo motors. I want to send commands to the application using IR and/or bluetooth.
IR implementation uses Lego power functions transmitters implemented by Arduino-LPF library by Brickostan. It does use interrupt on PIN 3.
Bluetooth is implemented by standard SoftwareSerial library.
Used hardware is Nano.
Both control works great if I use only one of them. But in case I receive a serial bluetooth command, then I receive IR command and then I receive again bluetooth command, application freezes. Last bluetooth command is not processed. Debuging I can get just behind the " if (bluetooth.available() > 0)" line, but no longer reach bluetooth.read() line.
Application is frozen, does not respond to any new commmand, neither BT or IR.
I am not sending tens of command per second, it freezes even if I make a minute break between commands.
Can somebody guide me to the root of the problem?
Application code and LPF library attached. Control by IR is the main function, but because I wanted to try BLE device, I included also this control method.
Thanks for helping.
Arduino-LPF.zip (5.99 KB)
vyhybky.ino (6.68 KB)