Infrared radiation is a form of light similar to the light we see all around us. The only difference between IR light and visible light is the frequency and wavelength. Infrared radiation lies outside the range of visible light, so humans can’t see it: picture 0
Because IR is a type of light, IR communication requires a direct line of sight from the receiver to the transmitter. It can’t transmit through walls or other materials like WiFi or Bluetooth.

Connect IR Receiver to Arduino

https://roboticsbackend.com/arduino-ir-remote-controller-tutorial-setup-and-map-buttons/

infared_remote_codes.ino

IRremote_map.ino

Map each button to a number

Arduino IR Robot

https://www.tinkercad.com/things/38tyb8Jv6m3-arduino-ir-robot

picture 3

PWM

picture 6
A PWM (Pulse Width Modulation) is basically a way to get a specific voltage (ex: 4.1V) with only HIGH/LOW (5V/0V) states. The PWM creates a pulse running at a given frequency – 500Hz for Arduino Uno. Then, a duty cycle parameter will tell what percentage of each pulse is in the HIGH state or LOW state.

The frequent change of HIGH/LOW states produces an average voltage output. For example, at a 50% duty cycle (50% of the time HIGH, 50% of the time LOW), the output voltage would be 2.5V.

PWM pins

picture 5
You can use the PWM only on some digital pins, which have a “~” next to their number. The Arduino Uno pins compatible with PWM are the pins 3, 5, 6, 9, 10 and 11. So you have 6 pins where you can create a PWM, using the analogWrite() function.

Secrets of Arduino PWM

PWM and Timer Pin Mapping for Atmega328P

https://docs.simplefoc.com/choosing_pwm_pins

TimerPinsOther Info
TIM05, 6millis()
TIM19, 10
TIM23, 11IRremote

PWM on Pin 3 is generated by Timer2. IRremote, by default, uses Timer2 for timing. There is your conflict.

To fix it, move enA to a PWM pin that is not 3 or 11 (Timer2). The safest solution is to move them both to Pins 5 and 6 (Timer0). Timer0 is the millis() timer so it is unlikely that any future addition will cause a new timer conflict.

L293D_IRremote.ino

L293D_IRremote_e-stop.ino

L293D_IRremote_estop_ultrasonic.ino