input_state( )
Syntax: value = input_state(pin)
Parameters: pin to read. Pins are defined in the devices .h file. The actual value is a bit address. For example, port a (byte 5 ) bit 3 would have a value of 5*8+3 or 43 . This is defined as follows: #define
PIN_A3 43 .
Returns: Bit specifying whether pin is high or low. A 1 indicates the pin is high and a 0 indicates it is low.
Function: This function reads the level of a pin without changing the direction of the pin as INPUT() does.
Availability: All devices.
Requires: Nothing
Examples:Código: CExample Files: None
level = input_state(pin_A3);
This function reads the level of a pin without changing the direction of the pin as INPUT() does.Esta funcion lee el nivel del pin, SIN CAMBIARLE LA DIRECCION, ya que por defecto si usas input, le cambia la direccion.