int pedestalButton = 13;
int pedestalLed = 12;
int mainButton = 6;
int deckButton = 3;
int GYButton = 4;
int banishButton = 5;
int phase1LED = 7;
int phase2LED = 8;
int phase3LED = 9;
int phase4LED = 10;
int sliderReading;
int phase = 0;
bool canIncreasePhase = true;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(pedestalLed, OUTPUT);
pinMode(phase1LED, OUTPUT);
pinMode(phase2LED, OUTPUT);
pinMode(phase3LED, OUTPUT);
pinMode(phase4LED, OUTPUT);
pinMode(pedestalButton, INPUT);
pinMode(mainButton, INPUT);
pinMode(deckButton, INPUT);
pinMode(GYButton, INPUT);
pinMode(banishButton, INPUT);
//pinMode(pedestalButton, INPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
}
void loop() {
//Serial.println(digitalRead(2));
sliderReading = analogRead((A0));
//Serial.println(sliderReading);
//Serial.println(sliderReading);
// put your main code here, to run repeatedly:
if(analogRead(A1) < 100){
//down
//Serial.println("down");
}
else if(analogRead(A1) > 1000){
//up
//Serial.println("up");
}
else if(analogRead(A1) > 100 && analogRead(A1) < 1000){
//no input
}
if(analogRead(A2) < 100){
//right
//Serial.println("right");
}
else if(analogRead(A2) > 1000){
//Left
//Serial.println("Left");
}
else if(analogRead(A2) > 100 && analogRead(A2) < 1000){
//no input
}
if(digitalRead(mainButton) == HIGH){
if(canIncreasePhase){
switch(phase){
case 0:
phase = 1;
break;
case 1:
phase = 2;
break;
case 2:
phase = 3;
break;
case 3:
phase = 4;
break;
case 4:
phase = 0;
break;
}
canIncreasePhase = false;
}
}
else if(digitalRead(mainButton) == LOW){
canIncreasePhase = true;
}
switch(phase){
case 0:
digitalWrite(phase1LED, LOW);
digitalWrite(phase2LED, LOW);
digitalWrite(phase3LED, LOW);
digitalWrite(phase4LED, LOW);
break;
case 1:
digitalWrite(phase1LED, HIGH);
digitalWrite(phase2LED, LOW);
digitalWrite(phase3LED, LOW);
digitalWrite(phase4LED, LOW);
break;
case 2:
digitalWrite(phase1LED, LOW);
digitalWrite(phase2LED, HIGH);
digitalWrite(phase3LED, LOW);
digitalWrite(phase4LED, LOW);
break;
case 3:
digitalWrite(phase1LED, LOW);
digitalWrite(phase2LED, LOW);
digitalWrite(phase3LED, HIGH);
digitalWrite(phase4LED, LOW);
break;
case 4:
digitalWrite(phase1LED, LOW);
digitalWrite(phase2LED, LOW);
digitalWrite(phase3LED, LOW);
digitalWrite(phase4LED, HIGH);
break;
}
if(digitalRead(pedestalButton) == HIGH){
digitalWrite(pedestalLed, HIGH);
digitalWrite(11, HIGH);
}
else if(digitalRead(pedestalButton) == LOW){
digitalWrite(pedestalLed, LOW);
digitalWrite(11, LOW);
}
Serial.println(digitalRead(pedestalButton));
}