This is an old revision of the document!
pin_configure lets you change settings for certain pins on the WattmonPRO and MEGA.
This is actually not to be used unless you know what you are doing, because it may cause certain parts of the device to not function properly.
For the WattmonPRO:
pin_configure(int $pin_number, int $pin_type, optional int $cntype)
$pin_number - the internal pin number for mapping, see below
$pin_type - any of the following:
pin_type | description |
1 | OUTPUT (digital) |
2 | INPUT (digital) |
4 | ANALOG input |
16 | COUNTER (digital input) |
$cn_type - For change notification (counter) you can choose from the following
value | description |
0 | Trigger on High |
1 | Trigger on Low |
2 | Trigger on any change |
The wattmonpro has 16 configurable pins:
Pin Index | Default | Pin (Physical) | Settable as | Description |
0 | A1 (PIN 1) | ANALOG | ANALOG/INPUT/OUTPUT | Voltage of primary input |
1 | A2 (PIN 2) | ANALOG | ANALOG/INPUT/OUTPUT | Voltage of A2 input |
2 | A3 (PIN 3 ) | ANALOG | ANALOG/INPUT/OUTPUT | Voltage of A3 input |
3 | internally available | ANALOG | ANALOG/INPUT/OUTPUT | No physical connection |
6 | DI1 (PIN 16) | INPUT | INPUT/COUNTER | Digital input (opto-isolated) or counter |
7 | DI2 (PIN 17) | INPUT | INPUT/COUNTER | Digital input (opto-isolated) or counter |
8 | DI3 (PIN 18) | INPUT | INPUT/COUNTER | Digital input (opto-isolated) or counter |
9 | DI4 (PIN 19) | INPUT | INPUT/COUNTER | Digital input (opto-isolated) or counter |
10 | DO1 (PIN 21) | OUTPUT | INPUT/OUTPUT | Digital output |
11 | DO2 (PIN 22) | OUTPUT | INPUT/OUTPUT | Digital output |
12 | DO3 (PIN 23) | OUTPUT | INPUT/OUTPUT | Digital output |
13 | DO4 (PIN 24) | OUTPUT | INPUT/OUTPUT | Digital output |
14 | RL Latch On | OUTPUT | INPUT/OUTPUT | Latches the relay on (should never be kept on for long, just pulse to switch) |
15 | RL Latch Off | OUTPUT | INPUT/OUTPUT | Latches the relay off (should never be kept on for long, just pulse to switch) |