api / mbed / trunk / DigitalIn
DigitalIn
class DigitalIn : public Base
A digital input, used for reading the state of a pin
Example
// Flash an LED while a DigitalIn is true
#include "mbed.h"
DigitalIn enable(p5);
DigitalOut led(LED1);
int main() {
while(1) {
if(enable) {
led = !led;
}
wait(0.25);
}
}operator int()
operator int()
An operator shorthand for read()
A digital input, used for reading the state of a pin
class DigitalIn : public Base
Create a DigitalIn connected to the specified pin
DigitalIn( PinName pin, const char * name = NULL )
Read the input, represented as 0 or 1 (int)
int read()
Set the input pin mode
void mode( PinMode pull )
An operator shorthand for read()
operator int()
