Logo

Forums » Questions » arduino rc ppm interface coding

schaffertown
Avatar

Thank you for lawnbot. What an inspiration. I am making a wheel chair motored robot with dual hbridge control. I need help. I am using your code as a reference to make one of my own. I need to power a brake release on my motors using a mosfet. the only time the mosfet would not be powered is when both neutral lights are on. If one or both are off the mosfet needs power. Also I need to use switches on my rc transmitter to tell my reciever to tell my arduino what to do.The only info that i have found to be worth looking at has been your code. however I am now trying to do two things that are not in the code. Is there a place I can look the better explains the rc code? Thank you for your time.

johndavid400
Avatar

Hey there,

glad you like the lawnbot and thanks for the kind words, I would be happy to help you figure out the code or write more to suit your needs.

first off, I took the electric motor brakes that you speak of completely off of each motor to keep from having to do what you described - if you need advice on how to remove them, I would be glad to help with that too. But, in the event that you are intentionally keeping the solenoid brakes on the motors for safety, I could help you write some code to accomodate this... it would probably be doable without using any extra channels on your remote, meaning that we could program the Arduino to automatically disengage the brakes whenever you move forward/reverse and engage them when you hit neutral - does that sound like it would work?

If you are intent on adding switches to your transmitter, you can do so without too much fuss, but you will probably need to sacrifice at least one channel on your transmitter (which should not be a problem since most transmitters come with more than enough channels to work with).

Please let me know which code you are using (post a link to the code if you can) and I will direct you to some better comments.

cheers,

JD

schaffertown
Avatar

Thank you for your reply.  I am actually trying to modify your code from instructables. I was thinking of adding digital read to the neutral leds. If one or both are off power one of the arduino pins. No power to the pin when both leds are on. 

I also have electric start. I want to trigger with a switch on my tx. I want to set the arduino to power 3 pins one when the switch is in each of the three positions. If one was from 1000-1400ms one from 1400-1600ms and one from 1600-2000ms. 

I am using a mega board so I have lots of pins. I do not need all 3 positions for a starter.  I just think it would be a learning experience to see the changes in the code since I haven't been able to find any info on what I am doing.

Thanks again.