error: a function-definition is not allowed here before '{' token
i'm new member. me pls
here error:
in function 'void manhinh1()':
error: function-definition not allowed here before '{' token
error: expected `}' @ end of input
thanks!
code: [select]
void manhinh1(){
tempc = analogread(adc);
tempc = tempc * 0.48828125;
lcd.setcursor(0, 0); lcd.print("nhiet: ");
lcd.setcursor(7, 0); lcd.print(tempc);
lcd.setcursor(13,0); lcd.print((char)223);
lcd.setcursor(14,0); lcd.print("c");
if(max > min){
if (tempc > max)
{digitalwrite(fan, low);
lcd.setcursor(2, 1); lcd.print("lam mat.....");}
else if (tempc < min)
{digitalwrite(hot, low);
lcd.setcursor(2, 1); lcd.print("dang suoi...");
delay(10000); }
else if (tempc > min && tempc < max)
{digitalwrite(fan, high);
digitalwrite(hot, high);
lcd.setcursor(2, 1); lcd.print("on dinh!!");}
}
else if (max < min){
lcd.setcursor(0, 1);
lcd.print("dat sai nhiet??");
}
delay(500);
void setnhietduoi(){
lcd.setcursor(0,0);
lcd.print("gioi han nhiet");
lcd.setcursor(0,1); lcd.print("min: ");
lcd.setcursor(5,1); lcd.print(min);
lcd.setcursor(11,1); lcd.print((char)223);
lcd.setcursor(12,1); lcd.print("c");
if (up.isuniquepress()) {
min = min + 5;
lcd.setcursor(5,1); lcd.print(min);
}
else if (down.isuniquepress()) {
min = min - 5;
lcd.setcursor(5,1); lcd.print(min);
}
}
void setnhiettren(){
lcd.setcursor(0,0);
lcd.print("gioi han nhiet");
lcd.setcursor(0,1); lcd.print("max: ");
lcd.setcursor(5,1); lcd.print(max);
lcd.setcursor(11,1); lcd.print((char)223);
lcd.setcursor(12,1); lcd.print("c");
if (up.isuniquepress()) {
max = max + 5;
lcd.setcursor(5,1); lcd.print(max);
}
else if (down.isuniquepress()) {
max = max - 5;
lcd.setcursor(5,1); lcd.print(max);
}
}
here error:
in function 'void manhinh1()':
error: function-definition not allowed here before '{' token
error: expected `}' @ end of input
thanks!
Arduino Forum > Using Arduino > Programming Questions > error: a function-definition is not allowed here before '{' token
arduino
Comments
Post a Comment