View Single Post
  #13  
Old 12-19-2019, 04:44 PM
ddmckee54 ddmckee54 is offline
Green Horn
 
Join Date: Dec 2011
Posts: 228
ddmckee54 is on a distinguished road
Default Re: Remote LED switching with Arduino examples.

Wombii:

My plan was to monitor the steering and throttle/direction channels with the Nano. From the pulse widths of those two channels I was going to decode the various LED functions that I wanted to use.

These are the various lights that the Nano will control on my Manitou without using any additional channels:
Headlights/tail-lights - If we're moving turn these on.
Work-lights - If we're not moving, or just moving slowly turn on the work lights.
Back-up lights - If we're in reverse, pulse length less than 1.5 milli-seconds, turn on the back-up lights.
Front Turn signals - If we're turning the appropriate front turn signal will flash on for 250 milli-seconds and then off for 750 milli-seconds.
Rear Turn signals - These do double duty as turn signals and brake lights. If we're turning and not braking they flash in sync with the front turn signals. If we're turning and braking then they are off when the front turn signal is on and vice-versa.
Brake lights - When the average of the speed set-point is decreased, then we're braking - turn on the brake lights for a few seconds.

I've got a timing glitch in the rear turn signal programming and it doesn't always do what I want it to, but I'll find the little bugger and fix it.

I haven't got the R/C channel decoding logic written yet. I was going to use the pulsein function, but everything I've read says that I should be using interrupts instead. I need to look into interrupts and then get the R/C decoding logic written next.

Don

Last edited by ddmckee54; 12-19-2019 at 05:13 PM.
Reply With Quote