mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 16:16:13 +01:00
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
// myCMRI.h to be included in myAutomation.h
|
|
|
|
// see myHal.cpp_example.txt for explanation of parameters
|
|
|
|
#include "IO_CMRI.h" // CMRI nodes
|
|
// in config.h #define ARDUINOCMRI_COMPATIBLE
|
|
|
|
// define CMRI bus
|
|
HAL(CMRIbus, 0, Serial5, 9600, 500, 51)
|
|
|
|
// define CMRI nodes
|
|
HAL(CMRInode, 900, 72, 0, 4, 'M')
|
|
|
|
// define the pins - this is S-MINI emulation 24/48 I/O
|
|
// 16 of 24 input pins
|
|
//JMRI_SENSOR(900,16) // broadcast <Q/q sensor for state changes
|
|
// ... these pins do not need to be defined unless needed for JMRI
|
|
|
|
// 16 turnouts require definition with vPin, id
|
|
// define as PIN_TURNOUT in DCC-EX -- the servo parameters are done within the CMRI sketch
|
|
PIN_TURNOUT(924, 924, "Pin 0 on PCA module")
|
|
PIN_TURNOUT(925, 925, "Pin 1 on PCA module")
|
|
PIN_TURNOUT(931, 931, "Pin 7 on PCA module")
|
|
// ... thru 939
|
|
|
|
// define 16 or 32 pins for digital outputs
|
|
//PARSE("<Z 940 940 0>")
|
|
// ... these pins do not need to be defined unless needed for JMRI
|
|
|
|
// a testing sequence
|
|
// pin 941 is wired to pin 907. LED on pin 943
|
|
// pin 942 is wired to pin 911.
|
|
// use commands <z 941> <z -941> etc.
|
|
AUTOSTART
|
|
SEQUENCE(99)
|
|
AT(907) SET(943)
|
|
AT(911) RESET(943)
|
|
FOLLOW(99)
|
|
|
|
// CMRI sketch used for testing available here
|
|
// https://www.trainboard.com/highball/index.php?threads/24-in-48-out-card-for-jmri.116454/page-2#post-1141569
|