User Tools

Site Tools


uphp:functions:pin_configure

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

valuedescription
0Trigger on High
1Trigger on Low
2Trigger on any change

The wattmonpro has 16 configurable pins:

Pin IndexDefaultPin (Physical)Settable asDescription
0A1 (PIN 1) ANALOG ANALOG/INPUT/OUTPUT Voltage of primary input
1A2 (PIN 2) ANALOG ANALOG/INPUT/OUTPUT Voltage of A2 input
2A3 (PIN 3 ) ANALOG ANALOG/INPUT/OUTPUT Voltage of A3 input
3internally available ANALOG ANALOG/INPUT/OUTPUT No physical connection
6DI1 (PIN 16) INPUT INPUT/COUNTERDigital input (opto-isolated) or counter
7DI2 (PIN 17) INPUT INPUT/COUNTERDigital input (opto-isolated) or counter
8DI3 (PIN 18) INPUT INPUT/COUNTERDigital input (opto-isolated) or counter
9DI4 (PIN 19) INPUT INPUT/COUNTERDigital input (opto-isolated) or counter
10DO1 (PIN 21) OUTPUT INPUT/OUTPUTDigital output
11DO2 (PIN 22) OUTPUT INPUT/OUTPUTDigital output
12DO3 (PIN 23) OUTPUT INPUT/OUTPUTDigital output
13DO4 (PIN 24) OUTPUT INPUT/OUTPUTDigital output
14RL Latch On OUTPUT INPUT/OUTPUTLatches the relay on (should never be kept on for long, just pulse to switch)
15RL Latch Off OUTPUT INPUT/OUTPUTLatches the relay off (should never be kept on for long, just pulse to switch)
uphp/functions/pin_configure.1494675123.txt.gz · Last modified: 2021/09/13 05:56 (external edit)