KensCode / linesideSignal

An Arduino library for LED-based lineside model railroad signals
6 stars 3 forks source link

Using IR Sensors with KensCode/linesideSignal #2

Open wdhensley opened 4 years ago

wdhensley commented 4 years ago

I am hoping this reaches Ken Shores ....

I am VERY new to Arduino and have been converting my N scale railroad to DCC++ and JMRI. Motor control is done, I have turnout control using push buttons with feedback. I have added signal crossings using IR sensors in the track successfully. I have 3 head signal masts and using your code, have been able to make them cycle through the colors ... thank you for that ... I was beginning to think I couldn't get them to function correctly. I would like to add the signal masts to the layout using additional IR sensors. I have played around with the code but cant figure out how to turn on a particular head based on the status of an IR sensor in a block. When IR sensor is high, turn on a particular lamp, when it is low, turn on a different lamp. I was wondering if you might be able to provide me with some direction on how to accomplish signal mast head control using IR sensors. Thank you in advance!

KensCode commented 4 years ago

IR Detectors are fairly complex to deal with on an Arduino, as they don't output a simple high/low signal. I wrote some notes on my model railroad blog about the topic (many years ago), at SumidaCrossing/IRSensors. You can contact me with further questions via the email address on the About the Site page there.