Dependencies:   PinDetect mbed Servo

Committer:
Rufaida
Date:
Mon Jun 18 17:47:17 2012 +0000
Revision:
0:81f78497df4e

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rufaida 0:81f78497df4e 1 #include "mbed.h"
Rufaida 0:81f78497df4e 2 /*including files needed*/
Rufaida 0:81f78497df4e 3 extern int Level;
Rufaida 0:81f78497df4e 4 extern int LED_Pos;
Rufaida 0:81f78497df4e 5 extern int sample_count;
Rufaida 0:81f78497df4e 6 extern int load;
Rufaida 0:81f78497df4e 7 extern int unload;
Rufaida 0:81f78497df4e 8 extern float current_sp;
Rufaida 0:81f78497df4e 9 extern float sp_incr;
Rufaida 0:81f78497df4e 10 extern int time_incr;
Rufaida 0:81f78497df4e 11 /*defining different speeds of the motor*/
Rufaida 0:81f78497df4e 12 #define up_full 1.0
Rufaida 0:81f78497df4e 13 #define up_slow 0.6
Rufaida 0:81f78497df4e 14 #define stopped 0.5
Rufaida 0:81f78497df4e 15 #define down_slow 0.4
Rufaida 0:81f78497df4e 16 #define down_full 0.0
Rufaida 0:81f78497df4e 17
Rufaida 0:81f78497df4e 18
Rufaida 0:81f78497df4e 19 #ifndef STATES
Rufaida 0:81f78497df4e 20 #define STATES
Rufaida 0:81f78497df4e 21
Rufaida 0:81f78497df4e 22 /*This is the list of the states*/
Rufaida 0:81f78497df4e 23 enum states {
Rufaida 0:81f78497df4e 24 st_At_Top_Closed,
Rufaida 0:81f78497df4e 25 st_Going_Bottom,
Rufaida 0:81f78497df4e 26 st_Wait_For_Bottom,
Rufaida 0:81f78497df4e 27 st_Wait_For_Ding_Bottom,
Rufaida 0:81f78497df4e 28 st_Wait_For_door_Bottom,
Rufaida 0:81f78497df4e 29 st_At_Bottom_Closed,
Rufaida 0:81f78497df4e 30 st_Going_Up,
Rufaida 0:81f78497df4e 31 st_Wait_For_Top,
Rufaida 0:81f78497df4e 32 st_Wait_For_Ding_Top,
Rufaida 0:81f78497df4e 33 st_Wait_For_door_Top,
Rufaida 0:81f78497df4e 34 st_Wait_For_Safety,
Rufaida 0:81f78497df4e 35 st_Wait_For_Bottom_Floor,
Rufaida 0:81f78497df4e 36 MAX_STATES
Rufaida 0:81f78497df4e 37 };
Rufaida 0:81f78497df4e 38
Rufaida 0:81f78497df4e 39
Rufaida 0:81f78497df4e 40 /*This is the list of the events*/
Rufaida 0:81f78497df4e 41 enum events {
Rufaida 0:81f78497df4e 42 ev_Go_To_Bottom_Button,
Rufaida 0:81f78497df4e 43 ev_Go_To_Top_Button,
Rufaida 0:81f78497df4e 44 ev_Bottom_Call_Button,
Rufaida 0:81f78497df4e 45 ev_Top_Call_Button,
Rufaida 0:81f78497df4e 46 ev_Near_Top_Button,
Rufaida 0:81f78497df4e 47 ev_Near_Bottom_Button ,
Rufaida 0:81f78497df4e 48 ev_Top_Button,
Rufaida 0:81f78497df4e 49 ev_Bottom_Button,
Rufaida 0:81f78497df4e 50 ev_Timeout,
Rufaida 0:81f78497df4e 51 ev_Safety,
Rufaida 0:81f78497df4e 52 ev_loading_event,
Rufaida 0:81f78497df4e 53 MAX_EVENTS
Rufaida 0:81f78497df4e 54 };
Rufaida 0:81f78497df4e 55 #endif