This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
uphp:functions:pin_configure [2017/05/13 11:30] admin created |
uphp:functions:pin_configure [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | pin_configure | + | ======pin_configure====== |
- | 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: | + | Configure an <tooltip title=" |
- | pin_configure(int $pin_number, | + | ====Description==== |
- | $pin_number | + | <well size=" |
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | </ | ||
- | $pin_type - any of the following: | + | This function will change settings for certain pins on [[hardware: |
- | | pin_type | description | | + | |
- | | 1 | OUTPUT (digital) | | + | |
- | | 2 | INPUT (digital) | | + | |
- | | 4 | ANALOG input | | + | |
- | | 16 | COUNTER (digital input) | | + | |
- | The wattmonpro has 16 configurable pins: | + | ====Parameters==== |
- | |Pin Index|Default|Pin (Physical)|Settable as|Description| | + | |
- | |0|A1 (PIN 1)| ANALOG | ANALOG/ | + | |
- | |1|A2 (PIN 2)| ANALOG | ANALOG/ | + | |
- | |2|A3 (PIN 3 )| ANALOG | ANALOG/ | + | |
- | |3|internally available| ANALOG | ANALOG/ | + | |
- | |6|DI1 (PIN 16)| INPUT | INPUT/ | + | |
- | |7|DI2 (PIN 17)| INPUT | INPUT/ | + | |
- | |8|DI3 (PIN 18)| INPUT | INPUT/ | + | |
- | |9|DI4 (PIN 19)| INPUT | INPUT/ | + | |
- | |10|DO1 (PIN 21)| OUTPUT | INPUT/ | + | |
- | |11|DO2 (PIN 22)| OUTPUT | INPUT/ | + | |
- | |12|DO3 (PIN 23)| OUTPUT | INPUT/ | + | |
- | |13|DO4 (PIN 24)| OUTPUT | INPUT/ | + | |
- | |14|RL Latch On| OUTPUT | INPUT/ | + | |
- | |15|RL Latch Off| OUTPUT | INPUT/ | + | |
+ | < | ||
+ | ^< | ||
+ | |0 |VIN/A1 (PIN 2) |ANALOG|ANALOG/ | ||
+ | |1 |A2 (PIN 3) |ANALOG|ANALOG/ | ||
+ | |2 |A3 (PIN 4 ) | ||
+ | |3 |Internally available|ANALOG|ANALOG/ | ||
+ | |6 |DI1 (PIN 16) |INPUT |INPUT/ | ||
+ | |7 |DI2 (PIN 17) |INPUT |INPUT/ | ||
+ | |8 |DI3 (PIN 18) |INPUT |INPUT/ | ||
+ | |9 |DI4 (PIN 19) |INPUT |INPUT/ | ||
+ | |10|DO1 (PIN 21) |OUTPUT|INPUT/ | ||
+ | |11|DO2 (PIN 22) |OUTPUT|INPUT/ | ||
+ | |12|DO3 (PIN 23) |OUTPUT|INPUT/ | ||
+ | |13|DO4 (PIN 24) |OUTPUT|INPUT/ | ||
+ | |14|RL1 (PIN 13) |OUTPUT|INPUT/ | ||
+ | |15|RL2 (PIN 14) |OUTPUT|INPUT/ | ||
+ | |||
+ | < | ||
+ | |||
+ | ^< | ||
+ | |1 |Digital Output| | ||
+ | |2 |Digital Input| | ||
+ | |4 |Analog Input| | ||
+ | |16|Counter| | ||
+ | |||
+ | < | ||
+ | |||
+ | ^< | ||
+ | |0|Trigger on High | | ||
+ | |1|Trigger on Low | | ||
+ | |2|Trigger on any change| | ||
+ | |||
+ | ====Return Values==== | ||
+ | |||
+ | None | ||
+ | |||
+ | ====See Also==== | ||
+ | |||
+ | [[pin_get()]] - Return the value of an <tooltip title=" | ||
+ | |||
+ | [[pin_set()]] - Set a digital output to value 1 or 0 | ||
+ | |||
+ | [[adc_read()]] - Read an onboard <tooltip title=" | ||