My question. I do not currently have a working Blue Tooth module so I opted to use the IR. It does work, actually this is the first build that worked without need to debug, and fight a little. It has a Ultra Sonic sensor that swivels and powers two motors. Pretty standard.
Well I did the k0070 project next which includes a BT and IR. Technically the IR works, but it takes lots of presses to get the button to register. So, I grabbed a spare arduino and loaded some IR test code on it, just to see the output in Serial Monitor of said button presses. IT does it there too. Several presses of the key before it spits out some HEX number starting with the letter J.
I am curious. Is there something I am missing? Messing with buffer or parity or baud rate maybe? It works, but takes way more presses of the button that it should.
You can test the remote. Most cell phone cameras are sensitive to IR. Point the remote at the cell phone camera and press a button. You should see a blue light blinking, in the camera, with the button press. If you have to press hard or many times to see the light, the remote is the problem.
So, we are testing with the “Example” provided to us through our sensor kit’s manufacturer…Elagoo. The IR module works with a single press of the key + or -. I also tested with the Arduino example for IR module which gives you some varied output from serial monitor. They all seem to work rather well, with single key presses. So this leads me to believe it is code issues with this “car kit”. Notably they do have a single shield for both driving the motors and the IR is built in, but I managed to trace what I believe is Digital pin 2 for the receive on the IR module. The examples are using D12 for that communication while the kit is using D2. Not sure that would make much difference. Perhaps it is in the code itself. Here is the code copied and pasted…again it works but takes several key presses before the signal is accepted…reminds me of IRQ issues in older PCs.
Attached. Code for smart car, option with IR and BT. AND the two libraries specific to this build.