ELEC2645 (2015/16) / Mbed 2 deprecated Sensor_Project

Dependencies:   N5110 SRF02 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

Go to the documentation of this file.
00001 /**
00002 @file main.h
00003 @brief Header file containing functions prototypes, defines and global variables.
00004 @brief Shows examples of creating Doxygen documentation.
00005 @brief Revision 1.0.
00006 @author XIN ZHANG
00007 @date   May 2016
00008 */
00009 
00010 #ifndef MAIN_H
00011 #define MAIN_H
00012 
00013 
00014 #include "mbed.h"
00015 #include "N5110.h"
00016 #include "SRF02.h"
00017 
00018 /**
00019 @namespace lcd
00020 @brief lcd connections
00021 */
00022 N5110 lcd (PTE26 , PTA0 , PTC4 , PTD0 , PTD2 , PTD1 , PTC3);
00023 /**namespace sensor
00024 @brief sensor connections
00025 */
00026 SRF02 sensor(PTE25,PTE24);
00027 Serial serial(USBTX, USBRX);
00028 /**
00029 @namespace r_led1
00030 @brief r_led1 connections
00031 */
00032 PwmOut r_led1(PTC2);
00033 /**
00034 @namespace r_led2
00035 @brief r_led2 connections
00036 */
00037 PwmOut r_led2(PTA1);
00038 /**
00039 @namespace buzzer
00040 @brief buzzer connections
00041 */
00042 PwmOut buzzer(PTA2);
00043 /**
00044 @namespace ticker
00045 @brief make led flashes at 2HZ
00046 */
00047 Ticker ticker;
00048 /**
00049 @namespace detect
00050 @brief make sensor detect at 2HZ
00051 */
00052 Ticker detect;
00053 
00054 volatile int g_timer_flag  = 0;    /*!<Flag in timer_isr */
00055 
00056 volatile int g_detect_timer_flag  = 0; /*!<Flag in detect-timer-isr */
00057 
00058 /**
00059 Setting LED flahses at 2 HZ
00060 */
00061 void timer_isr();
00062 
00063 /**
00064 Setting sensor detect at 2 HZ
00065 */
00066 void detect_isr();
00067 
00068 /**
00069 Drawing car at positon x and y
00070 @param x - draw the car at positon x
00071 @param y - draw the car at positon y
00072 */
00073 void drawCar(int x,int y);
00074 
00075 /**
00076 Clear car at positon x and y
00077 @param x - clear the car at positon x
00078 @param y - clear the car at positon y
00079 */
00080 void clearCar(int x,int y);
00081 
00082 
00083 int xOld=0;                /*! < Save car  previous position */
00084 int distanceArray [10];  /*!< Detect 10 times and add total distance in order to get mean vlaue */
00085 
00086 #endif