Lab that has to do with basic IO on mbed.
Dependencies: DebounceIn mbed PinDetect
Diff: JessesLab1/main.cpp
- Revision:
- 41:5bcf3ab83113
- Parent:
- 40:430e3884226a
- Child:
- 42:841b1bf3f173
--- a/JessesLab1/main.cpp Sun Jan 17 22:32:41 2016 -0500 +++ b/JessesLab1/main.cpp Mon Jan 18 03:40:13 2016 +0000 @@ -4,31 +4,15 @@ #include "PinDetect.h" PinDetect pb(p8); -PwmOut led(p21); +DigitalOut led(p21); int main() { -float pwr = 0; - pb.mode(PullUp); while(1) { - if(pb) { - - pwr = pwr + 0.1; - - if (pwr >= 1) { - pwr = 0; - } - - led.write(pwr); - } - else { - led.write(0); - } - - //led = !pb; + led = !pb; } }