Hi, I am new to programming and even newer to Arduino programming. I need help with an error that I get frequently. When I place a } closing the Void Loop code, I get the following error:
In function 'void loop()':
33:1: error: expected ';' before '}' token.
avr[0m 1.8.6 [90m/home/tcad/.arduino15/packages/arduino/hardware/avr/1.8.6[0m
exit status 1
What I'm trying to make are two semaphores, which work like everyday semaphores, but I get this error. In addition to when I am about to finish executing the code, and then continue looping, the green led of the first traffic light, turns on, but also the red led of the first traffic light and the green led of the second traffic light. I don't know if someone could help me (it is for an assignment and I need it before 10pm).
Well, Consider: the last statement in loop is immediately followed by the first statement in loop. That's how it works. So microseconds after you set your leds, you set them differently.
We're not being cruel, by the way. Some here will do your assignment for you, and some will try to get you to think. Which approach is more likely to result in you learning anything? I vote for the latter.
Of course! I completely understand what you are saying. The truth is that I prefer to think before having everything served. I resorted to ask in this forum because my teacher does not answer my e-mails, and he does not help me at all. But what I want is to learn, I am very interested in this, so I agree with you.
(Sorry if I have written something wrong, I don't speak much English).
Good to hear that you've come here for help. It shows you're resourceful. Who knows, your instructor may be trying to encourage that by not being too accessible.
If you need to continue with problems on this assignment, please remain within this thread, rather than posting new topics. It's just the way we do things around here.