maxVoltage()
[Digital I/O]
void maxVoltage(unsigned short pin, float voltage);Description
Sets the maximum input voltage for the specified pin.
Parameters
pin: the Custom Element pin.
max_voltage: the maximum input voltage allowed for the
pin.
Returns
Nothing.
Example Code
The code sets the maximum input voltage for the open-collector pin 7 to 15V.
void setup() {
pinLabel(7, "OUT"); // sets the pin 7 label to "OUT"
pinMode(7, OPEN_COLLECTOR); // sets the digital pin 7 as OPEN COLLECTOR output
maxVoltage(7, 15); // sets the maximum input voltage for the pin 7 to 15V
}
void loop() {}Notes and Warnings
The maximum input voltage can be set for all pins, except for the power and ground pins. The default value is defined by the family electronic standards.
This voltage will be used to raise warnings when the input voltage exceeds the maximum value.
