get_port — Get origin port of I/O value
uint8 get_port(uint8 io);
Retrieve the port that originated the I/O value indexed by io.
The port index, accordingly table 1.
Table 1 | ||
Index | Port Designator | Port Label |
---|---|---|
1 | PORT_USB_A | Input-A |
2 | PORT_USB_B | Input-B |
0 | PORT_USB_C | Output |
3 | PORT_USB_D | Prog |
4 | PORT_BT_A | |
5 | PORT_BT_B | |
6 | PORT_BT_C |
main { // If BUTTON_16 is active ... if(get_actual(BUTTON_16)) { // and if the value is comming from USB-B ... if(get_port(BUTTON_16) == PORT_USB_B) { // don't forward the input to the console. set_val(BUTTON_16, 0.0); } } }