I need help in this code :P

#define ROJO 13
#define AMARILLO 12
#define VERDE 2
#include <Servo.h>

Servo servo;
int angle = 0;

void setup()
{
pinMode(ROJO,OUTPUT);
pinMode(AMARILLO,OUTPUT);
pinMode(VERDE,OUTPUT);
servo.attach(8);
servo.write(angle);
}

void loop()
{
for(angle = 0; angle < 180; angle++)
{
servo.write(angle);
digitalWrite(VERDE,HIGH);
delay(45000);
digitalWrite(VERDE,LOW);
for(angle = 180; angle > 0; angle–)
{
servo.write(angle);
digitalWrite(AMARILLO,HIGH);
delay(5000);
digitalWrite(AMARILLO,LOW);
digitalWrite(ROJO,HIGH);
delay(30000);
digitalWrite(ROJO,LOW);
}
}

I need help in this code, in the Arduino Software shes say me this code error : Arduino:1.8.5 (Windows

10), Board:“Arduino/Genuino Uno”

C:\Users\matias\Documents\Arduino\sketch_jul22a\sketch_jul22a.ino: In function ‘void loop()’:

sketch_jul22a:36: error: expected ‘}’ at end of input

}

^

exit status 1
expected ‘}’ at end of input

Please help me , and fast :confused: :confused: :confused:

Please help me , and fast

If you properly indented your code, and put every { on a line by itself, you'd see that you have a } to end the second for loop, one to end the first for loop (that contains the second for loop), but not one to end the loop() function. The compiler told you that.

Use Tools + Auto Format to see such indentation/missing brace issues.

superprokill1:
servo.attach(8);

And that is why you must use code tags to post code.

MorganS:
And that is why you must use code tags to post code.

You don’t think the servo is connected to the smiley face pin? That’s the pin I usually use for servos.

But there is no pin marked with a smiley on my Arduino 8)

Smiley with Sunglasses might be a good pin number but the lack of a closing ) is more worrisome.

Ah, missed that one. So like

servo.attach(8));

:D

MorganS: And that is why you must use code tags to post code.

I Dont know!!!! , i dont put that emoji

Because you did not read the sticky How to use this forum - please read at the top of this forum section which contains a link to How to use this forum - please read.

Read all of it and specifically point 7 in that second one.