SETPIN pin, cfg [,target]
Will configure the external I/O ‘pin’ according to ‘cfg’:
The original Maximite has 20 I/O pins numbered 1 to 20, the Color Maximite adds another 20 I/O pins on the Arduino connector. These are labeled D0 to D13 and A0 to A5.
0 Not configured or inactive
1 Analog input (pins 1 to 10, A0 to A5)
2 Digital input (all pins and 5V tolerant on pins 11 to 20)
3 Frequency input (pins 11 to 14)
4 Period input (pins 11 to 14)
5 Counting input (pins 11 to 14)
6 Interrupt on low to high input change (pins 1 to 20, D0 to D8) for target
7 Interrupt on high to low input change (pins 1 to 20, D0 to D8) for target
8 Digital output (all pins)
9 Open collector digital output to 5V (pins 11 to 20, D0 to D13) In this mode the function PIN() will also return the output value.
The starting line number of the interrupt routine is specified in the third parameter ‘target’. This mode also configures the pin as a digital input so the value of the pin can always be retrieved using the function PIN().
See also:
IRETURN
PIN
PORT
PULSE
PWM
PWM STOP
Leave a Reply