// INPUTS
int buttonCallL0 = 2; // The button level 0 that you press to call lift
int buttonCallL1 = 3; // Ditto for Level 1 call button
int sensorTop = 4; // The sensor that tells when the Lift at top.
int sensorBottom = 5; // The sensor that tells when lift is bottom
int buttonDoorOpen = 6; // Door open button in lift
int buttonDoorClose = 7; // Door close button in lift
// OUTPUTS
int ledGoingDown = 8; // Going down indication light
int ledGoingUp = 9; // Goint up indicatior light
int ledSafeRed = 10; // Red when not ok to open door, Green when ok to open.
int ledSafeGreen = 11; //
int FakeMotor = 12; // represents the motor turning on or off
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); // Any baud rate should work
Serial.println("Lift Program Started\n");
// Setup inputs for buttons with internal internal pullups
pinMode(buttonCallL0, INPUT_PULLUP);
pinMode(buttonCallL1, INPUT_PULLUP);
pinMode(sensorTop, INPUT_PULLUP);
pinMode(sensorBottom, INPUT_PULLUP);
pinMode(buttonDoorOpen, INPUT_PULLUP);
pinMode(buttonDoorClose, INPUT_PULLUP);
// Setup outputs
pinMode(ledGoingUp, OUTPUT);
pinMode(ledGoingDown, OUTPUT);
pinMode(ledSafeGreen, OUTPUT);
pinMode(ledSafeRed, OUTPUT);
pinMode(FakeMotor, OUTPUT);
}
void loop() {
// Apply rules
// Update outputs
//Serial.print(digitalRead(buttonCallL0));
// put your main code here, to run repeatedly:
// Read the value of the input. It can either be 1 or 0
/* int buttonValue = digitalRead(buttonPin);
if (buttonValue == LOW){
// If button pushed, turn LED on
digitalWrite(LED,HIGH);
} else {
// Otherwise, turn the LED off
digitalWrite(LED, LOW);
}
*/
}