Ошибка 342, помогите решить
- Войдите на сайт для отправки комментариев
Чт, 16/06/2022 - 18:58
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int X;
int Y;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
const int input = A0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Water Flow Meter”);
lcd.setCursor(0,1);
lcd.print(“****************”);
delay(2000);
pinMode(input,INPUT);
}
void loop()
{
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“VOL. :0.00”);
lcd.setCursor(0,1);
lcd.print(“TOTAL:”);
lcd.print( TOTAL);
lcd.print(” L”);
}
else
{
TOTAL = TOTAL + LS;
Serial.println(FREQUENCY);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“VOL.: “);
lcd.print(WATER);
lcd.print(” L/M”);
lcd.setCursor(0,1);
lcd.print(“TOTAL:”);
lcd.print( TOTAL);
lcd.print(”L”);
}
}
delay(1000);
}
Ошибка:
sketch_jun16i:17:11: error: stray '\342' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:17:12: error: stray '\200' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:17:13: error: stray '\234' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:17:30: error: stray '\342' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:17:31: error: stray '\200' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:17:32: error: stray '\235' in program
lcd.print(“Water Flow Meter”);
^
sketch_jun16i:19:11: error: stray '\342' in program
lcd.print(“****************”);
^
sketch_jun16i:19:12: error: stray '\200' in program
lcd.print(“****************”);
^
sketch_jun16i:19:13: error: stray '\234' in program
lcd.print(“****************”);
^
sketch_jun16i:19:30: error: stray '\342' in program
lcd.print(“****************”);
^
sketch_jun16i:19:31: error: stray '\200' in program
lcd.print(“****************”);
^
sketch_jun16i:19:32: error: stray '\235' in program
lcd.print(“****************”);
^
sketch_jun16i:37:11: error: stray '\342' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:37:12: error: stray '\200' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:37:13: error: stray '\234' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:37:24: error: stray '\342' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:37:25: error: stray '\200' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:37:26: error: stray '\235' in program
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:39:11: error: stray '\342' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:39:12: error: stray '\200' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:39:13: error: stray '\234' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:39:20: error: stray '\342' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:39:21: error: stray '\200' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:39:22: error: stray '\235' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:41:11: error: stray '\342' in program
lcd.print(” L”);
^
sketch_jun16i:41:12: error: stray '\200' in program
lcd.print(” L”);
^
sketch_jun16i:41:13: error: stray '\235' in program
lcd.print(” L”);
^
sketch_jun16i:41:16: error: stray '\342' in program
lcd.print(” L”);
^
sketch_jun16i:41:17: error: stray '\200' in program
lcd.print(” L”);
^
sketch_jun16i:41:18: error: stray '\235' in program
lcd.print(” L”);
^
sketch_jun16i:49:11: error: stray '\342' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:49:12: error: stray '\200' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:49:13: error: stray '\234' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:49:20: error: stray '\342' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:49:21: error: stray '\200' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:49:22: error: stray '\234' in program
lcd.print(“VOL.: “);
^
sketch_jun16i:51:11: error: stray '\342' in program
lcd.print(” L/M”);
^
sketch_jun16i:51:12: error: stray '\200' in program
lcd.print(” L/M”);
^
sketch_jun16i:51:13: error: stray '\235' in program
lcd.print(” L/M”);
^
sketch_jun16i:51:18: error: stray '\342' in program
lcd.print(” L/M”);
^
sketch_jun16i:51:19: error: stray '\200' in program
lcd.print(” L/M”);
^
sketch_jun16i:51:20: error: stray '\235' in program
lcd.print(” L/M”);
^
sketch_jun16i:53:11: error: stray '\342' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:53:12: error: stray '\200' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:53:13: error: stray '\234' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:53:20: error: stray '\342' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:53:21: error: stray '\200' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:53:22: error: stray '\235' in program
lcd.print(“TOTAL:”);
^
sketch_jun16i:55:11: error: stray '\342' in program
lcd.print(”L”);
^
sketch_jun16i:55:12: error: stray '\200' in program
lcd.print(”L”);
^
sketch_jun16i:55:13: error: stray '\235' in program
lcd.print(”L”);
^
sketch_jun16i:55:15: error: stray '\342' in program
lcd.print(”L”);
^
sketch_jun16i:55:16: error: stray '\200' in program
lcd.print(”L”);
^
sketch_jun16i:55:17: error: stray '\235' in program
lcd.print(”L”);
^
C:\Users\Danek\Documents\Arduino\sketch_jun16i\sketch_jun16i.ino: In function 'void setup()':
sketch_jun16i:17:14: error: 'Water' was not declared in this scope
lcd.print(“Water Flow Meter”);
^~~~~
sketch_jun16i:19:33: error: expected primary-expression before ')' token
lcd.print(“****************”);
^
C:\Users\Danek\Documents\Arduino\sketch_jun16i\sketch_jun16i.ino: In function 'void loop()':
sketch_jun16i:37:14: error: 'VOL' was not declared in this scope
lcd.print(“VOL. :0.00”);
^~~
sketch_jun16i:37:19: error: expected unqualified-id before ':' token
lcd.print(“VOL. :0.00”);
^
sketch_jun16i:39:19: error: expected ')' before ':' token
lcd.print(“TOTAL:”);
^
sketch_jun16i:41:15: error: 'L' was not declared in this scope
lcd.print(” L”);
^
C:\Users\Danek\Documents\Arduino\sketch_jun16i\sketch_jun16i.ino:41:15: note: suggested alternative: 'LS'
lcd.print(” L”);
^
LS
sketch_jun16i:49:14: error: 'VOL' was not declared in this scope
lcd.print(“VOL.: “);
^~~
sketch_jun16i:49:18: error: expected unqualified-id before ':' token
lcd.print(“VOL.: “);
^
sketch_jun16i:51:15: error: 'L' was not declared in this scope
lcd.print(” L/M”);
^
C:\Users\Danek\Documents\Arduino\sketch_jun16i\sketch_jun16i.ino:51:15: note: suggested alternative: 'LS'
lcd.print(” L/M”);
^
LS
sketch_jun16i:51:17: error: 'M' was not declared in this scope
lcd.print(” L/M”);
^
sketch_jun16i:53:19: error: expected ')' before ':' token
lcd.print(“TOTAL:”);
^
exit status 1
stray '\342' in program
неправильно скопировали код из интернета
Кавычки нужно использовать обычные, а не косые. Для начала
спасибо, проблема с этим решена..