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 1:d488a7a0c9e1, committed 2018-03-19
- Comitter:
- diegocode
- Date:
- Mon Mar 19 23:24:44 2018 +0000
- Parent:
- 0:b9a539dbd0fe
- Commit message:
- Agregado de constantes para t ON y t OFF.; Bug de inicializaci?n de Ticker corregido
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 19 17:39:32 2018 +0000
+++ b/main.cpp Mon Mar 19 23:24:44 2018 +0000
@@ -3,7 +3,7 @@
/*
* Ejemplo 01 - Máquinas de estados
*
-* LED rojo 0.1s encendido y 0.9s apagado
+* LED rojo 0.1s encendido y 1.9s apagado
* Con máquinas de estados.
*
*/
@@ -12,8 +12,11 @@
#define TICK_MS 10
// constantes para tiempo on y tiempo off (En ms)
-#define TO_LED_OFF_MS 900 / TICK_MS
-#define TO_LED_ON_MS 100 / TICK_MS
+#define LED_T_ON_MS 100
+#define LED_T_OFF_MS 1900
+
+#define TO_LED_OFF_MS LED_T_OFF_MS / TICK_MS
+#define TO_LED_ON_MS LED_T_ON_MS / TICK_MS
// Defines para GPIO en S08
/*
@@ -99,7 +102,7 @@
void init_mcu(){
// ticker: ejecuta LED_Tick cada TICK_MS ms
- tick.attach(&LED_Tick, TICK_MS / 1000);
+ tick.attach(&LED_Tick, TICK_MS / 1000.0);
// Inicialización de GPIO y TPM1 para S08
/*