Advice for coding motors

Hello! here is my code so far:

#include <IRremote.h>

// Remote Core

const int RemotePin=13;
IRrecv irrecv(RemotePin);
decode_results results;

// Car Core

int in1=2;
int in2=3;
int in3=4;
int in4=5;

// Void Setup Core

void setup() 
{
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);

}

// Void Loop Core

void loop() {
  if(irrecv.decode(&results))
  {
    Serial.println(results.value, HEX);
    delay(200);
    irrecv.resume();
  }

}

I am trying to find the best way to code the motors, though I don't know how to use 'results.value==[value]' with the elego remote that came with the 'uno R3 super starter kit'.

Sorry if this is a really obvious question, but either way I would appreciate any info y'all give me!

I assume you are using the L298N DC motor driver. Here is a simulation of motor steering code in a programming playground called Wokwi.

1 Like

@g00b3r Welcome to this forum. I see you are very new here, so you don't know how things work on this forum.

You might want to look at this How to get the best out of this forum before you proceed any further.
We only know what you tell us, and without knowing what you have, and why you want to do this, we don't stand a chance.

Now what you are missing is a whole lot of information to get us on the right track to solving your problem.

We need to know what sort of motors you have, there are many diffrent types. We need to know how they are wired up, so we require a schematic. That includes how they are being powered.

You know all this because it is infront of you, we can only guess, and very few of us have working crystal balls these days.

Your code does absoloutly nothing with regard to motors, it just reads an IR remote. What results are you getting from this?

Thank you for your future cooperation on this matter.

1 Like

Thank you so much! I will definitely be playing around with this until I am able to run it smoothly :smiley:

And how do you know it is running smoothly on a simulator?

Get serious.