Each Sensor pin has an entry in the Base Station's Sensor table. The base station stores the actual Arduino IO Pin number internally, and you assign an ID value (anything from 0-32767) to the Sensor. JMRI references the Sensor using the ID value, not the Arduino pin number.
Sensor ID values do not need to be sequential. Each Sensor's ID can be any unused value within the allowed range (0-32767).
When using analog Arduino pins as digital inputs, use the pin's digital pin number. For example, analog pin A0 is digital pin 14
To control an Arduino IO pin using Indexed control, follow these steps.
The Hardware Address for an Indexed Sensor is the ID value assigned in the Base Station's internal Sensor table. For example, if your sensor is connected to Arduino pin 7, and that sensor is assigned ID value 13 in the Base Station, the Hardware Address for that sensor should be 13.
The User Name can be anything you like.
NOTE: Sensor configurations stored in the Base Station's EEPROM will be automatically added to the JMRI Sensor Table on startup.
In the JMRI Sensor Table...
Entry | Meaning | makes System Name | Mask | Equivalent | Minimum | Maximum |
---|---|---|---|---|---|---|
4:3 | (converts to 50) | DS50 | node : pin | 0 |
Use the JMRI/DCC++ "Configure Base Station" (4.6.x: "Configure Sensors & Turnouts") tool to store the Sensor ID and Arduino pin number in the Base Station.
Note: On JMRI versions 4.6.x and earlier, if you choose "Save Sensors" you will not be given the opportunity to write the changes to the Base Station's EEPROM. To write to EEPROM, you must choose "Close" instead of "Save Sensors".
Sensor IDs do not need to be sequential. You can use any unused value within the allowed range (0-32767). Sensor IDs can be the same as Turnout or Output IDs.
The "Configure Base Station" tool is a convenient way to program the Sensor, Turnout and Output tables in your Base Station. It is not, however, required to work with DCC++ within JMRI. You can, for example, set up your Base Station's tables using the DCC++ serial command interface, or the DCC++ Controller software. As long as the IDs assigned in the Base Station match the Hardware Address assigned in JMRI's Sensor Table, all will be well.