ReonBalisty
Member
Arduino: 1.6.3 (Windows 7), TD: 1.22, Board: "Teensy 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz optimized (overclock), US English"
pedals_ino.ino: In function 'void loop()':
pedals_ino.ino:28:3: error: 'else' without a previous 'if'
pedals_ino.ino:28:9: error: expected primary-expression before ')' token
pedals_ino.ino:38:3: error: 'else' without a previous 'if'
pedals_ino.ino:38:9: error: expected primary-expression before ')' token
expected primary-expression before ')' token
Been working on this for a foot pedal build for Guildwars 2, as in to Jump (space) and Dodge (v), Finding I am having trouble with the building of this code. Looking for guidance please. Plus a Debounce addition to the code as well if that helps, with the update to 1.6.* my code no longer works to be verified and uploaded.
pedals_ino.ino: In function 'void loop()':
pedals_ino.ino:28:3: error: 'else' without a previous 'if'
pedals_ino.ino:28:9: error: expected primary-expression before ')' token
pedals_ino.ino:38:3: error: 'else' without a previous 'if'
pedals_ino.ino:38:9: error: expected primary-expression before ')' token
expected primary-expression before ')' token
Code:
const int pinZero = 0;
const int pinOne = 1;
int ledPin = 13;
boolean ledOn = true;
int buttonState = 0;
void setup () {
pinMode (pinZero, INPUT_PULLUP);
pinMode (pinOne, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.begin(9600);
Keyboard.begin();
}
void loop () {
buttonState = digitalRead(pinZero);
if (digitalRead(pinZero) == LOW) ; {
Keyboard.write(32);
digitalWrite(ledPin, HIGH);
delay(300);
}
else () ; {
digitalWrite(pinZero, HIGH);
digitalWrite(ledPin, LOW);
}
buttonState = digitalRead(pinOne);
if (digitalRead(pinOne) == LOW); {
Keyboard.write('v');
digitalWrite(ledPin, HIGH);
delay(300);
}
else () ; {
digitalWrite(pinOne, HIGH);
digitalWrite(ledPin, LOW);
}
}
Been working on this for a foot pedal build for Guildwars 2, as in to Jump (space) and Dodge (v), Finding I am having trouble with the building of this code. Looking for guidance please. Plus a Debounce addition to the code as well if that helps, with the update to 1.6.* my code no longer works to be verified and uploaded.