error: expected unqualified-id before 'if'

necesito ayuda, quiero encender 4 leds por medio de monitor serial pero me da un error y no se como arreglarlo

 int option1;
int option2;
int option3;
int option4;
int option5;
int led1=8;
int led2=9;
int led3=10;
int led4=11;
void setup()
   pinMode(led1, OUTPUT);
   pinMode(led2, OUTPUT);
   pinMode(led3, OUTPUT);
   pinMode(led4, OUTPUT);

void loop()
    if(option1=='a') {
        digitalWrite(led1, HIGH);
    if (Serial.available()>0){;
     if(option2=='b') {
        digitalWrite(led2, HIGH);
        if(option3=='c') {
        digitalWrite(led3, HIGH);
          if(option4=='d') {
        digitalWrite(led4, HIGH);
           else if(option5=='e') {
        digitalWrite(led1,led2,led3,led4, LOW);

este es el codigo con el que estoy trabajando,pero no me quiere funcionar necesito ayuda

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.



You have been reported for cross posting.

You have been added to the ‘Do not help this person . . . ever’ list.

Just for cross posting once? Don’t be so dramatic @spycatcher. Give them a chance. One screw up isn’t the end of the world.


That's right. Everyone SHOULD be smart enough to read that. But in reality not all are. Some of these folks are kids. Some don't speak English well. Some are just too dumb to notice. But you don't have to be like that to them. The ones that are rude or whiney sure. But if all they did was miss a rule then

You have been added to the 'Do not help this person . . . ever' list.

is a bit of an over reaction. There are certainly nicer ways to get that point across. We want to encourage diverse people to learn to code. Not to scare away anyone who doesn't read all the stickys first.

Please don't tell me you've never made a mistake when you were new at something. Would you appreciate a gentle pointer? Or someone telling you that you are never welcome again because of your one miss?


spycatcher2k: My choice to do what I want with my time!

Yeah but you don't have to be mean to other people to do it. Don't be a dick. Don't be a b%#ch. There's no call in running people off just because they don't fit your mold. If you don't want to help them anymore because they cross posted then don't. But leave the rest of us the option.

Or if you do insist on being that way about it, don't get all huffy next time you get called out on it and ask to delete your whole account. If this is the way you're going to treat people then maybe that isn't such a bad idea. Don't dish it if you can't take it.