
Lab 1 Part 1
Dependencies: mbed
main.cpp@1:d7bfa12605ab, 2018-01-18 (annotated)
- Committer:
- Nydrel
- Date:
- Thu Jan 18 02:12:12 2018 +0000
- Revision:
- 1:d7bfa12605ab
- Parent:
- 0:abd47c95fef3
- Child:
- 2:c2f5a8ab5433
Set up pushbutton and LED for first part of lab;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nydrel | 0:abd47c95fef3 | 1 | #include "mbed.h" |
Nydrel | 1:d7bfa12605ab | 2 | #include "PinDetect.h" |
Nydrel | 1:d7bfa12605ab | 3 | DigitalOut myled(p30); |
Nydrel | 1:d7bfa12605ab | 4 | DigitalIn pb(p16); |
Nydrel | 0:abd47c95fef3 | 5 | |
Nydrel | 0:abd47c95fef3 | 6 | int main() { |
Nydrel | 1:d7bfa12605ab | 7 | pb.mode(PullUp); //setup push button |
Nydrel | 1:d7bfa12605ab | 8 | wait(.01); //wait for starting pull up to take effect |
Nydrel | 1:d7bfa12605ab | 9 | while(1){ |
Nydrel | 1:d7bfa12605ab | 10 | myLed = pb; |
Nydrel | 0:abd47c95fef3 | 11 | } |
Nydrel | 0:abd47c95fef3 | 12 | } |