Lab 1 Part 1

Dependencies:   mbed

Committer:
Nydrel
Date:
Thu Jan 18 02:17:11 2018 +0000
Revision:
3:9efbb5b3166e
Parent:
2:c2f5a8ab5433
Child:
4:840b77c5f7c1
Change - Now the LED is inactive when the pushbutton is not being pressed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Nydrel 0:abd47c95fef3 1 #include "mbed.h"
Nydrel 2:c2f5a8ab5433 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 2:c2f5a8ab5433 7 pb.mode(PullUp);
Nydrel 2:c2f5a8ab5433 8 while(1) {
Nydrel 3:9efbb5b3166e 9 myled = !pb;
Nydrel 0:abd47c95fef3 10 }
Nydrel 2:c2f5a8ab5433 11 }