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 X_NUCLEO_IKS01A2
Revision 1:e5bfe1052c21, committed 2019-04-26
- Comitter:
- SimoneCastelliDezza
- Date:
- Fri Apr 26 13:48:53 2019 +0000
- Parent:
- 0:af59256ce908
- Commit message:
- cuao
Changed in this revision
--- a/Ciao.c Wed Apr 17 21:08:20 2019 +0000 +++ b/Ciao.c Fri Apr 26 13:48:53 2019 +0000 @@ -1,1 +1,6 @@ -#include "Prova2.h" \ No newline at end of file +#include "Prova2.h" + +//signed int variabile; + + +//variabile = (signed int)CIAO; \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/X_NUCLEO_IKS01A2.lib Fri Apr 26 13:48:53 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/ST/code/X_NUCLEO_IKS01A2/#138a7a28bd21
--- a/main.cpp Wed Apr 17 21:08:20 2019 +0000
+++ b/main.cpp Fri Apr 26 13:48:53 2019 +0000
@@ -1,18 +1,30 @@
#include "mbed.h"
-PwmOut mypwm(PWM_OUT);
+InterruptIn button(USER_BUTTON);
+
+DigitalOut led(LED1);
+
+//double delay = 0.5; // 500 ms
-DigitalOut myled(LED1);
+void pressed()
+{
+ led = !led; // 100 ms
+}
-int main() {
+//void released()
+//{
+// delay = 0.5; // 500 ms
+//}
+
+int main()
+{
- mypwm.period_ms(10);
- mypwm.pulsewidth_ms(1);
-
- printf("pwm set to %.2f %%\n", mypwm.read() * 100);
-
- while(1) {
- myled = !myled;
- wait(1);
+ // Assign functions to button
+ button.fall(&pressed);
+// button.rise(&released);
+
+ while (1) {
+// led = !led;
+// wait(delay);
}
}