expected 'while' before '}' token

I alredy finished my code and when I´m trying to download and compile my code i get the error in the last line of code, the error is

exit status 1
expected ‘while’ before ‘}’ token

please help me!

this is the code

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int buzzer = 13;
int ahoras = 0;
int aminutos = 0;
int asegundos = 0;
int segundostotal = 0;
int msg= 0;

int start = A1;
int empieza = 1024;
int buth = A5;
int butm = A4;
int buts = A3;

int varbuth = 0;
int varbutm = 0;
int varbuts = 0;

void setup()
{
lcd.begin(16, 2);

pinMode(buzzer, OUTPUT);
pinMode(buth, INPUT);
pinMode(butm, INPUT);
pinMode(buts, INPUT);
pinMode(start, INPUT);
msg = 0;
empieza = 1024;

varbuth = 1;
varbutm = 1;
varbuts = 1;
}

void loop()
{
if(msg==0)
{
lcd.setCursor(0,0);
lcd.print(“Temporizador com”);
lcd.setCursor(1,1);
lcd.print(“Arduino + LCD”);
delay(2500);
msg = 1;
lcd.clear();
}

do
{

varbuth = analogRead(buth);
varbutm = analogRead(butm);
varbuts = analogRead(buts);

if(varbuth == 0){
ahoras = ahoras + 1 ;
delay(250);
}

if(varbutm == 0)
{
aminutos = aminutos + 1;
delay(250);
}

if(varbuts == 0)
{
asegundos = asegundos + 1;
delay(250);}

lcd.setCursor(0,0);
lcd.print(“Digite o Tempo”);

lcd.setCursor(4,1);

if (ahoras < 10){
lcd.print(“0”);
lcd.print(ahoras);
lcd.print(":");}

if (aminutos < 10){
lcd.print(“0”);
lcd.print(aminutos); cd.print(":");}
if (asegundos< 0)
{
delay (1000);
segundostotal;}

ahoras = ((segundostotal / 60)/ 60);
aminutos = (segundostotal / 60) % 60;
asegundos = segundostotal % 60;

lcd.setCursor(0,0);
lcd.print(“Tempo restante”);

lcd.setCursor(4,1);
if (ahoras < 10){
lcd.print(“0”);

lcd.print(ahoras);
lcd.print(":");}

if (aminutos < 10){
lcd.print(“0”);
lcd.print(aminutos);

lcd.print(":");}
if (asegundos < 10){
lcd.print(“0”);

lcd.print(asegundos);}

if (segundostotal == 0)
{
lcd.clear();
lcd.setCursor(5,0);
lcd.print(“Tempo”);
lcd.setCursor(3,1);
lcd.print(“Finalizado”);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
}
}
}

Where is your "while"?

https://www.arduino.cc/reference/en/language/structure/control-structure/dowhile/

PS: if you had merely googled the error message plus arduino (e.g., expected 'while' before '}' token arduino), you would have been able to solve this problem on your own. Try that first, the next time you run into a problem.

And, I know it's easy to miss, but please read the "How to use this forum - please read" topic at the top of each forum page, for more advice on how to solve problems on your own and how you can help others help you.

Line 88 change cd to lcd Line 130 should look like }while(1);

Change the 1 to whatever condition you need https://www.arduino.cc/reference/en/language/structure/control-structure/dowhile/

You have a do{} block - that would be part of a do...while loop. But you don't have the while condition anywhere, so that's not valid syntax. do{} without a while(test) after it is not valid C.

@typematrix - no, line 130 most certainly shouldn't be while(1), as that would just loop for ever - there would be no way to break out of it. I have no idea what he was intending to do there, but that isn't it - otherwise he wouldn't have put any code after that, since the program would never escape it.

To be honest, unless you have a good reason, don't use do....while loops - they're less common, and more likely to be misread when you come back to the code later. Use normal for and while loops unless the situation really calls for do...while loop.

If you search google for do while c there are lots of pages describing it, and the differences between do...while and while loops - essentially a do....while loops always executes the code once, regardless of whether the test is true, whereas a while loop will not execute the conditional code at all unless the condition is true.

do without a while is not valid c - and as far as I can tell, he didn't want any sort of loop there, and the do and it's braces shouldn't be there at all?