control stepper motors with radio control

Hello everyone, I'm from Argentina, excuse my english

I'm doing a "slow car that carries some weight" which has two wheels to turn and traction back (and two free wheels forward) --- are two stepper motors nema17 high torque.
I try to handle it with my radio control station (PWM) and arduino.
ohhh I forgot, there are also two DRV8825 controllers to move the motors.

I just tried the Arduino-DRV8825 set and engines with a code and they work perfect. I also adjusted the current in the drivers.

I am finding it difficult to find a code that I can use with my radio and my engines to drive this micro car.

Is there any code already made for this? I understand that I would have to connect my pins according to the program ...... but programming I do not know anything! I will appreciate a lot of help ... it is sad to see the engines turned off

Standard servo signals are traditionally read using pulseIn() to measure the pulse width, although interrupts can also be used if you
want it to be done in the background.

I'm presuming by "radio control station (PWM)" you mean standard RC receiver?

yes ! standard RC receiver !

I need a complete code, I'm too ignorant in programming ...I know more about electronics

Grrrr 3, 2 , 1.... > :frowning:

https://playground.arduino.cc/Code/ReadReceiver
might be useful?

a bit difficult ... but I'll try

dont work

with this code I can move an engine alone ... but it pauses and then continues ...
It's too simple for my project but it works
Does anyone know how to improve this for two engines?

PIN 2 = INPUT from RC Receiver
PIN 9 = DIR
PIN 10 = PUL

#include <Stepper.h>
int ch2 = 0;

const int stepsPerRevolution = 200;

// initialize the stepper library:
Stepper myStepper(stepsPerRevolution, 9, 10);

void setup() {
pinMode(2, INPUT); //from RC reciever ch2 SC switch on Transmitter
myStepper.setSpeed(200);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
Serial.begin(9600);
}

void loop() {
//get current values of RC receiver
ch2 = pulseIn(2, HIGH, 20000);

Serial.print("ch2 ");
Serial.println(ch2);
Serial.println("------------");
delay(500);

if (ch2 < 1200)
{
Serial.println("clockwise");
myStepper.step(1000);
}
else if (ch2 > 1700)
{
Serial.println("counterclockwise");
myStepper.step(-1000);
}
}

:confused: help arduino genius !

I do not care for using pulsein() to read an RC receiver.
It blocks other processing.
I prefer to use interrupts. As MarkT pointed you to up in reply #4.

Without any of the motor control, try using the sample code to read RC values and print them to the serial monitor.
Then when you get that working, try using the RC values to decide what to do with your motors.

If you have difficulty with anything along the way, post the code here (don't forget to use code tags).
Then explain your difficulty. Best to do so like this:
I expected the code to do 'this'
It actually did 'that'
And unless it is very evident, explain how 'this' and 'that' differ.
You might notice that this method of describing your difficulty differs from your statement in reply #6.

Hey !

I will suggest you build the transmitter and receiver for this.. I can help you out with the code later.

But try to get NRF24L01+ 2.4GHz Wireless RF Transceiver Modules.

I did it and is not to hard, I'm also new at the arduino and programming part...

I'm from Venezuela, so my spanish is better than my english.

Let me know!

hey venezuela que bien me caen los hermanos venezolanos, en estas èpocas hay muchos en Argentina....gente educada y trabajadora.

Bien el problema es que ya tengo el equipo de radio, y comprè uno de exelente calidad.

en este post dejo una foto del mismo

This is the English language section of the Forum. There is a Spanish section if you prefer to use that language.

...R

someone who knows some car moved by NEMA type engines?

Robolink:
someone who knows some car moved by NEMA type engines?

No. Only Fords, Volkswagens and Toyotas.

...R

This link Shows NEMA information No where do they get involved with engines.

Paul