-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathultrasonido.c
31 lines (26 loc) · 831 Bytes
/
ultrasonido.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ========================================
*
* Copyright YOUR COMPANY, THE YEAR
* All Rights Reserved
* UNPUBLISHED, LICENSED SOFTWARE.
*
* CONFIDENTIAL AND PROPRIETARY INFORMATION
* WHICH IS THE PROPERTY OF your company.
*
* ========================================
*/
/*** COMPONENTES INCLUIDOS ***/
#include "ultrasonido.h"
/*** VARIABLES ***/
uint8 activar_ultrasonido;
/*** FUNCIONES ***/
void enviar_pulso(void){ // Pulso de 10 microsegundos en el Trigger
SRF05_trigger_Write(ALTO); // del sensor SRF05 para inicializarlo
CyDelayUs(10);
SRF05_trigger_Write(BAJO);
}
/*** INTERRUPCIONES ***/
CY_ISR(sensar){ // Interrupcion del boton que activa
activar_ultrasonido = 1; // la bandera para inicializar el sensor
}
/* [] END OF FILE */