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.
Diff: main.cpp
- Revision:
- 4:05cffda0b6a6
- Parent:
- 2:ff10ffd246e2
--- a/main.cpp Tue Nov 20 02:51:43 2018 +0000
+++ b/main.cpp Thu Nov 22 01:34:07 2018 +0000
@@ -2,6 +2,7 @@
#include "main.h"
Timer tiempo;
+Timeout timeout;
Serial command(USBTX, USBRX);
DigitalIn entrada (PC_9);
@@ -21,10 +22,12 @@
int Detectar();
int tme=0;
+
int main() {
init_servo();
init_serial();
debug_m("inicio \n");
+ timeout.attach(&timer_interrupt,10);
uint32_t read_cc;
while(1)
{
@@ -39,7 +42,7 @@
}
uint32_t read_command()
-{
+{
char intc=command.getc();
@@ -113,8 +116,15 @@
wait(1); //
}
- }
-
+ }
+
+void timer_interrupt(){
+
+ debug_m("interrumpido..\n");
+ abajo();
+
+timeout.attach(&timer_interrupt,10);
+}
void sensor()
{