A new functionality has been released for SVLocoIO firmware. This is the Arduino program we use for all I/O Loconet modules. This means, it is the main Arduino software to manage sensors and outputs (street lights, layout illumination, ...).
It was missing a functionality that other boards do, which is to inform about the state of the inputs (sensors) at power on. When the command station is turned on, or the power on button of your software like Rocrail or iTrain is pressed, the module will send the current state of those ports configured as input.
With a bit more of technical detail, when a OPC_GPON command is sent throuth Loconet, the board responds a OPC_INPUT_REP message for each configured input.
If you want to deactivate this functionality, delete or comment the line in the top of the code:
#define INFORMATPOWERON
I also corrected some errors when calculating the input number of a pin. It was affecting to the debug mode making the input numbers to be printed wrong. With this correction the maximum input number has been increased to 2048.
You can download it from: https://github.com/ClubNCaldes/SVLocoIO
NOTE:
If you use this firmware with GCA185 Loconet shield board, remember you don't need the pulldown resistors of the board as the program uses the Arduino internal pullup resistors.
Dear Dani,
ReplyDeleteI am late to this project, and just have one question if you don't mind. Are the two pull up resistors the 4.7k ones R5 & 6.
Rgds,
Keith Kershaw
Weatherboard Indoor Railway
Queensland AU
Hi, which board are you refering to?
ReplyDeleteGCA185, sorry Dani I thought I was leaving the message on a specific thread.
DeleteSorry Dani GCA185
ReplyDeleteRgds,
KK
Hej Dani,
ReplyDeletethanks for the software, it works nicely. I am trying to learn how Loconet commands work. I wonder about one thing - to me it looks like you only generate OPC_INPUT_REP messages, no OPC_SW_REQ, which the original Jarbour LocoIO does (?) - so, are you controlling Switches/Turnouts with OPC_INPUT_REP or is there some fancy trick that I dont understand?
Hi Dani, thank you for your work. It inspired me to adapt the LocoIO keypad (similar to GCA123) with an ATmaga328. I had to make one change to the sketch. I needed the “Active High” option for my application. I have incorporated this into your sketch. I have published my solution here: http://simandit.de/simwiki/doku.php?id=weiteres:modellbahn:digital#locoio-keypad-arduino.
ReplyDeleteThe page is in German, but you can translate it in your browser.