Been working on this today.
Got the board reporting and firing the relay.
Couple of things.
First change. It's a fully fleged Leonadro. So select Leonado, and the correct comm port in the Arduino software.
Second change is the two relays on the board fire on pins D7 and D8.
So line 71 needs to be
static uint8_t relayPins[] = { 7, 8 }; // select if using DFRobot RelayShieldI'm struggling with the reporting though.
Analogue I/O pins 0 and 1 are available as pins on the board. 2-5 are unpopulated drilled and soldered holes.
A0 and A1 pins have the option of going to 5v or ground. A2-5 have "Aref" or 5v
I've tried A0 and A2 as my reference. and tried shorting. or not shorting them to ground, but I can't get them to change the status.
Here's my current attenpt
// *** IMPORTANT NOTE ***
//
// THE ARDUINO ETHERNET SHIELD RESERVES DIGITAL PINS 10, 11, 12, 13 AS WELL AS
// ANALOG PINS 0, 1, THEREFORE YOU SHOULD NOT USE ANY OF THOSE PINS FOR YOUR DEVICE(S) OR DOOR(S)
// open/close trigger relay should be connected to these digital output pins (digitalWrite).
// Adjust to match the number of devices you have hooked up (examples provided below in comment) ...
//static const uint8_t relayPins[] = { 9 }; // single device at pin #9
static uint8_t relayPins[] = { 7, 8 }; // select if using DFRobot RelayShield
//static uint8_t relayPins[] = { 2, 3 }; // two devices at pins #2 and #3
//static uint8_t relayPins[] = { 2, 3, 4, ... }; // even more devices at pins #2, #3, #4, etc ...
// status contact should be connected to these analog input pins (anologRead).
// Adjust to match the number of devices you have hooked up (examples provided below in comment) ...
//static const uint8_t statusPins[] = { 3 }; // single device at pin #3
static uint8_t statusPins[] = { 2 }; // select if using DFRobot RelayShield
//static uint8_t statusPins[] = { 2, 3 }; // two devices at pins #2 and #3
//static uint8_t statusPins[] = { 2, 3, 4, ... }; // even more devices at pins #2, #3, #4, etc ...
// status reading strategy (uncomment only one ... the one that reflects how you want status to be interpreted)
//#define STATUS_STRATEGY_3VCLOSED_5VOPENED // initial approach - uses analogRead combined with STATUS_OPEN_TRESHOLD (opened == +5v, closed == +3v)
//#define STATUS_STRATEGY_5VCLOSED_3VOPENED // alternate approach - uses analogRead combined with STATUS_OPEN_TRESHOLD (opened == +3v, closed == +5v)
//#define STATUS_STRATEGY_NORMALLY_CLOSED // classic door sensor - uses digitalRead to interpret door/device status (opened == high-impedance, closed == GND)
#define STATUS_STRATEGY_NORMALLY_OPENED // alternate approach - uses digitalRead to interpret door/device status (opened == GND, closed == high-impedance)
// Analog boundary value (0-1023) used to distinguish between device/door status == opened and closed. Only applicable
// when STATUS_STRATEGY_3VCLOSED_5VOPENED or STATUS_STRATEGY_5VCLOSED_3VOPENED is being used.
#define STATUS_OPEN_TRESHOLD 1000
Shorting pin 2 to ground gives me no change. (I'vetried the same thing with pin 0 selected, shorting it to ground also gives no change.)
Any thoughts on what I'm doing wrong?
Cheers
Craig