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 4:05cffda0b6a6, committed 2018-11-22
- Comitter:
- JohanParraga
- Date:
- Thu Nov 22 01:34:07 2018 +0000
- Parent:
- 3:a8b858269c6b
- Commit message:
- trabajo final
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| main.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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()
{
--- a/main.h Tue Nov 20 02:51:43 2018 +0000 +++ b/main.h Thu Nov 22 01:34:07 2018 +0000 @@ -16,5 +16,6 @@ void moving2(); void joystick(); void sensor(); +void timer_interrupt(); #endif // MAIN_H \ No newline at end of file