DigitalInOut Hello World
mbed 2 and mbed OS 5
This is an mbed 2 example. For an mbed-os example, please see:
Import programDigitalInOut_HelloWorld
DigitalInOut Hello World
main.cpp@1:7cee0b019b98, 2013-02-21 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Feb 21 17:06:42 2013 +0000
- Revision:
- 1:7cee0b019b98
- Parent:
- 0:0d0417932681
use latest version of mbed libraries
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:0d0417932681 | 1 | #include "mbed.h" |
mbed_official | 0:0d0417932681 | 2 | |
mbed_official | 0:0d0417932681 | 3 | DigitalInOut pin(p5); |
mbed_official | 0:0d0417932681 | 4 | |
mbed_official | 0:0d0417932681 | 5 | int main() { |
mbed_official | 0:0d0417932681 | 6 | pin.output(); |
mbed_official | 0:0d0417932681 | 7 | pin = 0; |
mbed_official | 0:0d0417932681 | 8 | wait_us(500); |
mbed_official | 0:0d0417932681 | 9 | pin.input(); |
mbed_official | 0:0d0417932681 | 10 | wait_us(500); |
mbed_official | 0:0d0417932681 | 11 | } |