|
|
|
@@ -35,18 +35,17 @@ |
|
|
|
#define STEP 2 |
|
|
|
#define DIR 4 |
|
|
|
#define LIMIT_SWITCH 5 |
|
|
|
#define MOTOR_LED 15 |
|
|
|
|
|
|
|
static const byte led_gpio = 15; |
|
|
|
static const int WLS_Pin = 14; |
|
|
|
static const int WLS_DETECT_Pin = 12; |
|
|
|
|
|
|
|
static const int WLS_Pin = 34; |
|
|
|
static const int WLS_DETECT_Pin = 35; |
|
|
|
|
|
|
|
static const int GreenBtn_Pin = 12; |
|
|
|
static const int GreenBtn_Pin = 35; |
|
|
|
static const int RedBtn_Pin = 13; |
|
|
|
static const int BlueBtn_Pin = 14; |
|
|
|
static const int BlueBtn_Pin = 34; |
|
|
|
|
|
|
|
static const int RotEnc_Switch_Pin = 25; |
|
|
|
static const int RotEnc_Clk_Pin = 32; |
|
|
|
static const int RotEnc_Switch_Pin = 26; |
|
|
|
static const int RotEnc_Clk_Pin = 25; |
|
|
|
static const int RotEnc_Dta_Pin = 33; |
|
|
|
|
|
|
|
static const int MOVE_DOWNWARD = -1; // motor rotation counter clock wise |
|
|
|
@@ -141,7 +140,7 @@ void setup() { |
|
|
|
Display.init(); |
|
|
|
Display.display(); |
|
|
|
|
|
|
|
pinMode(led_gpio, OUTPUT); |
|
|
|
pinMode(MOTOR_LED, OUTPUT); |
|
|
|
pinMode(GreenBtn_Pin, INPUT); |
|
|
|
pinMode(RedBtn_Pin, INPUT); |
|
|
|
pinMode(BlueBtn_Pin, INPUT); |
|
|
|
@@ -176,6 +175,8 @@ void loop() { |
|
|
|
Display.setWlsConnected(WlsDetect.isConnected()); |
|
|
|
Display.showFrame(actualStatus); |
|
|
|
|
|
|
|
digitalWrite(MOTOR_LED, LOW); |
|
|
|
|
|
|
|
switch (actualStatus) { |
|
|
|
|
|
|
|
case INITIALIZATION: |
|
|
|
@@ -324,6 +325,7 @@ void loop() { |
|
|
|
|
|
|
|
case MOVING_ELEVATOR: |
|
|
|
//printStatus("MOVING_ELEVATOR"); |
|
|
|
digitalWrite(MOTOR_LED, HIGH); |
|
|
|
if (Router_Elevator.isLimitSwitchTriggerd()) { |
|
|
|
delay(200); |
|
|
|
SetActualStatus(RELEASE_SWITCH); |