Help Controlling ROV via live feed serial

Hello everybody

I am student in denmark looking for adivce on a school project where i am going to be using a arduino mega to control three dual-h bridges (L298N) to control DC engines. it's going to drive bilge pumps and lights on a ROV. the PCB are made and tested. now the trick is to control the engines via PWM signals. i need some help getting started

the idea is to control them via the computer, when i push the forward key, two engines should go HIGH.

simple right?

This is where i am right right now:

i know that a serial communication is necessary

the value of which the PWM should be determined is via a int where i can use a number (numbers 1-10, where ten is highest)

when i push an arrow the pin which the engine is connected to will be writen to via AnalogWrite, with the int.

the main problem is what commands i need to use, is it just a bunch of ''if statements''?

and a thing that have been troubling me is how to use communication in such a way that when i push a key (eg. an arrow key) the arduino respond instantly, instead of using the serial monitor where i have to push enter after each key when communicating with it

i am fairly new to the programming and are looking for advice on how i should start this

Sincerly, Mikkel

Interesting project. 20 reads and no responses yet. I'll take a crack, Mikkel.

It looks to me like you should use two Arduinos. One interacts with a panel of user's button switches and sends serial messages to the ROV's Arduino. (perhaps recycle a game controller for the switches)

The second Arduino is on the ROV. It waits for a message, interprets it and controls the L298N boards appropriately. I'd definitely use some of the stepper libraries. There are many L298N Arduino shields and programs to see as examples.

This way you can divide the project into 3: Sender-Arduino, ROV-Arduino, and SerialMessageLanguage definition.

Good luck!

Hi Have done a lot of work with hobby ROVs. The above advice is real good. First stage :- is to get the two Arduinos talking to each other.(with the length of required umblicle cable) Second stage :- Add a joystick or pots to the topside. And read with LCD.on bottomside. Third stage :- add motor controllers. I used model boat/car ECCs to drive the motors (just use the simple Servo commands) Bulge pumps might draw to much current for the L298. If you need a two way information system get it working first.

Regards Antony