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.
Dependencies: HC_SR04_Ultrasonic_Library PinDetect
radar.h
- Committer:
- vhx
- Date:
- 2018-06-29
- Revision:
- 1:b4179d7a5f2c
- Parent:
- 0:23a36e52a5fa
File content as of revision 1:b4179d7a5f2c:
#ifndef _RADAR_H_
#define _RADAR_H_
// must import HC_SR04_Ultrasonic_Library
// https://os.mbed.com/components/HC-SR04/
#include <ultrasonic.h>
/* Range enum */
enum {
RANGE_NONE=0,
RANGE_FAR,
RANGE_MID,
RANGE_CLOSE,
RANGE_MAX
};
extern void radar(void);
/* Globals */
// Global position variable
extern int volatile position;
//Set the trigger pin to PC_8 and the echo pin to PC_6
//have updates every .1 seconds and a timeout after 1
//second, and call dist when the distance changes
extern ultrasonic mu;
extern DigitalOut led1;
extern DigitalOut led2;
extern DigitalOut led3;
#endif //_RADAR_H_