a simple code for elevator

Dependencies:   PinDetect mbed Servo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 /*
00002 * THE MAIN FILE OF THIS PROGRAM.
00003  * ^^^ ^^^^ ^^^^ ^^ ^^^^ ^^^^^^^
00004  *
00005  * FILE NAME: main.h
00006  * USAGE: library file of main.cpp
00007  */
00008 
00009 
00010 /*
00011 * including the wanted library files.
00012 */
00013 #include "mbed.h"
00014 
00015 /* Defines an enumeration type (event)*/
00016 #ifndef EVENT
00017 #define EVENT
00018 enum event {B_level_1, B_level_2, call_1, call_2, NR_top, NR_bottom, at_top, at_bottom, timeout, safety,MAX_EVENT} ;
00019 #endif
00020 
00021 /* Defines an enumeration type (state)*/
00022 #ifndef STATE
00023 #define STATE
00024 enum state {top, waiting_beeper_tp, waiting_door_tp, wating_top_sw, going_down,bottom, waiting_beeper_bm,
00025              waiting_door_bm, waiting_bottom_sw, going_up, waiting_for_safety, waiting_for_Bfloor,
00026             MAX_STATE
00027            } ;
00028 #endif
00029 
00030 
00031 
00032 /*variables that have been defined in another location*/
00033 extern int floor_level;
00034 extern int LED_order;
00035 extern int order;
00036 extern int upload;
00037 extern int loaded;
00038 extern float varying_speed;
00039 extern float speed_now;
00040 extern int  delta_time;
00041 
00042