AsstridL:
So my friend and I are really new to this (it´s a school project) and we are so confused. Which braces are mixed up?
Every { must have a corresponding } but they must be in the right place. Ckicking to the right of any { will cause the IDE to put a box round the corresponding } to that you can easily see what is in the code block
Do yourself a favour and Auto Format your code in the IDE and use code tags when posting code here. This is your code Auto Formatted
#include <Servo.h>
Servo doorServo;
Servo fingerServo;
int swPin = 2; //switch on pin 2
int pos = 0;
int selectedMove = 0; //move selector
void setup()
{
pinMode(swPin, INPUT);
doorServo.attach(9); //set door servo on Pin 9 pwm
fingerServo.attach(6); //set finger servo on Pin 6 pwm
doorServo.write(80); //set door to hiding position
fingerServo.write(0); //set finger to hiding position
}
{
void loop()
// basic move 1
{
void switchoff()
//Moving door
{
for (pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}
//Moving finger
for (pos = 0; pos < 180; pos += 4)
{
fingerServo.write(pos);
delay(15);
}
//hiding finger
for (pos = 180; pos >= 0; pos -= 4)
{
fingerServo.write(pos);
delay(15);
}
//hiding door
for (pos = 155; pos >= 80; pos -= 3)
{
doorServo.write(pos);
delay(25);
}
}
// basic move 1
void switchoff()
{
//Moving door
for (pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}
//Moving finger
for (pos = 0; pos < 180; pos += 4)
{
fingerServo.write(pos);
delay(15);
}
//hiding finger
for (pos = 180; pos >= 0; pos -= 4)
{
fingerwrite(pos);
delay(15);
}
//hiding door
for (pos = 155; pos >= 80; pos -= 3)
{
doorServo.write(pos);
delay(25);
}
}
All function definitions, such as loop(), should start on the left margin when Auto Formatted. Yours don't. This is usually a sign that there is a problem with { and/or }
Try to identify where the matching } is for each of your {