Hi,
You should be able to use the new INO file even if you're not using the new DFRobot Relay Shield. In the
new INO file, you'll find constants (near line ~86) that allows you to configure how your setup works. Uncomment
only one of those strategy definitions.
- Code: Select all
#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)
For an older/original setup, you'd typically uncomment the STATUS_STRATEGY_3VCLOSED_5VOPENED line. Keep an old copy of your original PDE file, just
in case you can't make it work, but I really don't see why you wouldn't be able to. Foundations have remained the same throughout the versions.
Also, make sure you setup the relayPins and statusPins arrays appropriately. You should be able to set these up using the same values you have in your current PDE file.
I strongly suggest you make the basic open/close + status feedback work before trying to enable notifications. Divide and conquer is always a good approach when
tackling tasks that can be broken down into smaller chunks (baby steps).
Try it out and let us know how it went.
Best regards,