Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MCP23S17 PinDetect USBDevice
Diff: main.cpp
- Revision:
- 1:f121b88d9c85
- Parent:
- 0:c1654e25cc43
- Child:
- 2:7570a8526148
diff -r c1654e25cc43 -r f121b88d9c85 main.cpp
--- a/main.cpp Wed Jan 15 18:13:43 2020 +0000
+++ b/main.cpp Wed Jan 15 18:21:55 2020 +0000
@@ -3,8 +3,9 @@
#include "PinDetect.h"
DigitalOut myled(p26);
+DigitalOut builtinLED(LED1);
DigitalIn pb(p22);
-DigitalIn pb2(p21);
+//DigitalIn pb2(p21);
// p10 is most significant bit
//BusIn ledSelect(p8, p9, p10);
@@ -33,13 +34,13 @@
int main() {
while(1) {
// Part 1
- myled = !pb;
+// myled = !pb;
// Part 2
float p = 1.0f;
pb1.mode(PullUp);
pb2.mode(PullUp);
- wait(0.1)
+ wait(0.1);
if (pb1) {
if (p > 0) {
@@ -50,7 +51,7 @@
p += 0.1;
}
}
- myled = p;
+ builtinLED = p;
// Part 3
// RGBLed myRBGLed = RGBLed(redPin, greenPin, bluePin);
@@ -80,5 +81,5 @@
// }
// Part 4
-
+ }
}