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