attempt 1

Dependencies:   mbed

Revision:
2:dcd904176b27
Parent:
1:54ae0e3ae1b7
Child:
3:f45ab902c0ad
--- a/main.cpp	Wed Mar 25 00:35:40 2015 +0000
+++ b/main.cpp	Wed Mar 25 23:10:44 2015 +0000
@@ -167,7 +167,7 @@
     //ELEVATOR STATE
     //int nofloor = 0;   //set nofloor state to 0
     
-    int Serv = 0;
+    //int Serv = 0;
     //initialize servo and dc motor
     float freq = 50;    //set 50 HZ freq for PWM and motor
     EN.period(1/freq);   
@@ -228,7 +228,7 @@
             floors[nextFloor-1] = false;
             nextFloor = getNextFloor();
             }
-        if(curFloor < nexFloor){
+        if(curFloor < nextFloor){
             up();
             direction = 1;
             }
@@ -236,10 +236,7 @@
             down();
             direction = 2;
             }
-            
-
-/////////////////////////////////////////END KEYPAD//////////////////////////////////////////////////////////            
-            
+                        
             
             }