DigitalRead

Name

 * digitalRead

Description
Read level on pin, return 0 for voltage considered as LOW and 1 for voltage considered as HIGH. If the pin is not configured as input, you will read the value driven by Pinguino (to be confirmed).

In any case, pin must never be driven under ground voltage (relative to pinguino) nor above power supply voltage (relative to Pinguino).


 * Since: Beta 3

The transition level depends of pin hardware, please consult the PIC datasheet for details.


 * Roughly for a +5V IC power supply, 0V to +0.8V is considered as LOW level, and +4.0V to +5.0V as HIGH level (TTL pins consider level +2.1V to +5.0V as HIGH).


 * Roughly for a 3.3V IC power supply, 0V to +0.49V is considered as LOW level and 2.65V to 3.3V as HIGH level (TTL pins consider +1.65 to +3.3V as HIGH).

Syntax
int digitalRead(int pin); u8 digitalRead(u8 pin);
 * P8:
 * P32:
 * Parameters:
 * pin = pin to read
 * Returns/Output :
 * level = 0 for low level, 1 for high level

pin should be configured as input using pinMode unless you know what you are doing.

Example
Input Example