-
Dependencies: mbed
Nucleo.h@0:07055f3355f6, 2018-03-07 (annotated)
- Committer:
- NathanLederman
- Date:
- Wed Mar 07 14:20:11 2018 +0000
- Revision:
- 0:07055f3355f6
TESTE1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NathanLederman | 0:07055f3355f6 | 1 | |
NathanLederman | 0:07055f3355f6 | 2 | #include "mbed.h" |
NathanLederman | 0:07055f3355f6 | 3 | |
NathanLederman | 0:07055f3355f6 | 4 | DigitalOut myled(LED1); |
NathanLederman | 0:07055f3355f6 | 5 | DigitalIn pb(USER_BUTTON); |
NathanLederman | 0:07055f3355f6 | 6 | |
NathanLederman | 0:07055f3355f6 | 7 | // SPST Pushbutton demo using internal PullUp function |
NathanLederman | 0:07055f3355f6 | 8 | // no external PullUp resistor needed |
NathanLederman | 0:07055f3355f6 | 9 | // Pushbutton from P8 to GND. |
NathanLederman | 0:07055f3355f6 | 10 | int main() { |
NathanLederman | 0:07055f3355f6 | 11 | pb.mode(PullUp); |
NathanLederman | 0:07055f3355f6 | 12 | while(1) { |
NathanLederman | 0:07055f3355f6 | 13 | myled = pb; |
NathanLederman | 0:07055f3355f6 | 14 | } |
NathanLederman | 0:07055f3355f6 | 15 | } |