Vincent Hervieux / Mbed OS Nucleo_radar

Dependencies:   HC_SR04_Ultrasonic_Library PinDetect

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers radar.h Source File

radar.h

00001 #ifndef _RADAR_H_
00002 #define _RADAR_H_
00003 // must import HC_SR04_Ultrasonic_Library
00004 // https://os.mbed.com/components/HC-SR04/
00005 #include <ultrasonic.h>
00006 
00007 /* Range enum */
00008 enum {
00009     RANGE_NONE=0,
00010     RANGE_FAR,
00011     RANGE_MID,
00012     RANGE_CLOSE,
00013     RANGE_MAX
00014  };
00015 
00016 extern void radar(void); 
00017 
00018 
00019 /* Globals */
00020  // Global position variable
00021 extern int volatile position;
00022 //Set the trigger pin to PC_8 and the echo pin to PC_6
00023 //have updates every .1 seconds and a timeout after 1
00024 //second, and call dist when the distance changes
00025 extern ultrasonic mu;
00026 
00027 extern DigitalOut led1;
00028 extern DigitalOut led2;
00029 extern DigitalOut led3;
00030 
00031 #endif //_RADAR_H_