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.
Revision 2:f705e6d3fe9e, committed 2020-11-04
- Comitter:
- fdurand
- Date:
- Wed Nov 04 09:16:05 2020 +0000
- Parent:
- 1:e470129442d8
- Commit message:
- Exemple Read_button
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 16 08:49:28 2020 +0000
+++ b/main.cpp Wed Nov 04 09:16:05 2020 +0000
@@ -1,3 +1,7 @@
+// Franck DURAND 2020
+// Cours 3 Exercice 1
+
+
#include "mbed.h"
DigitalIn mybutton(USER_BUTTON);
@@ -6,9 +10,10 @@
int main()
{
while(1) {
- if (mybutton == 0) { // Button is pressed
+ if (mybutton == 1) { // Button is pressed
myled = !myled; // Toggle the LED state
wait(0.2); // 200 ms
}
}
}
+