Ошибка stray \ 342 in program
- Войдите на сайт для отправки комментариев
Чт, 31/03/2022 - 17:40
Ошибка:
Arduino: 1.8.19 (Windows 10), Плата:"Arduino Uno"
Test1:32:20: error: stray '\342' in program
time = millis() – time;
^
Test1:32:21: error: stray '\200' in program
time = millis() – time;
^
Test1:32:22: error: stray '\223' in program
time = millis() – time;
^
C:\Users\HOME\Desktop\Test1\Test1.ino: In function 'void setup()':
Test1:23:12: error: cannot convert 'EEPROMClass::write' from type 'void (EEPROMClass::)(int, uint8_t) {aka void (EEPROMClass::)(int, unsigned char)}' to type 'int'
m3= EEPROM.write;
^~~~~
Test1:32:24: error: expected ';' before 'time'
time = millis() – time;
^~~~
Несколько библиотек найдено для "EEPROM.h"
Используется: D:\Arduino\hardware\arduino\avr\libraries\EEPROM
Не используется: D:\Arduino\libraries\EEPROM-master
exit status 1
stray '\342' in program
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"
http://arduino.ru/forum/obshchii/vstavka-programmnogo-koda-v-temukomment...
#include <iarduino_RTC.h> iarduino_RTC time(RTC_DS1302, 2, 3, 4); #include <Adafruit_GFX.h> // подключаем графическую библиотеку #include <Adafruit_ST7735.h> // подключаем библиотеку для управления дисплеем #include <SPI.h> #include <EEPROM.h> #define TFT_CS 10 #define TFT_RST 9 #define TFT_DC 8 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); #define TFT_ #define TFT_MOSI 11 const int buttonPin = 5; int addr = 0; unsigned int f=241; int m=0, ert,g; int m3,t; const int buttonPinON = 6; int buttonState = 0; void setup() { pinMode(buttonPin, INPUT_PULLUP); tft.initR(INITR_BLACKTAB); f= EEPROM.read(addr); m3= EEPROM.write; delay(500); tft.fillScreen(ST7735_BLACK); tft.fillRoundRect(14, 10, 105, 15, 8, ST7735_WHITE); tft.fillRoundRect(15, 43, 95, 45, 8, ST7735_WHITE); tft.fillRoundRect(15, 95, 95, 40, 8, ST7735_WHITE); delay(300); time.begin(); uint16_t time = millis(); time = millis() – time; } void loop() { int sensorVal = digitalRead(5); int sensorValON = digitalRead(6); if (sensorVal == HIGH) ert = 1; if (ert==1) { if (sensorVal == LOW) { f=f+1; tft.fillRoundRect(15, 43, 95, 45, 8, ST7735_WHITE); // EEPROM.write(addr, f); delay(100); ert=0;} } if(sensorValON==HIGH) delay(100); if (((f-((f/100%10)*100))>=0)&&((f-((f/100%10)*100))<10)) { tft.setTextColor(ST7735_RED); tft.setTextSize(3); tft.setCursor(65,55); tft.println(m); tft.setCursor(85,55); tft.println(f-((f/100%10)*100)); } else { tft.setTextColor(ST7735_RED); tft.setCursor(65,55); tft.println(f-((f/100%10)*100)); } if (f>99) { tft.setCursor(45,55); tft.setTextColor(ST7735_BLACK); tft.setTextSize(3); tft.println(f/100%10); //СОТНИ if((f/100%10)>m3) { tft.fillRoundRect(15, 95, 95, 40, 8, ST7735_WHITE); tft.setCursor(30,105); tft.setTextColor(ST7735_RED); g=33*(f/100%10); //33 стоимость 1 м3 воды по состоянию на 1.01.2022 tft.print(g); tft.println("P"); } } m3=(f/100%10); }Я его слепила из того что было ...
1. что должно произойти в строке 23 ?
2. для чего используется time ?
Буковка e по русски?
вот так скомпилируется )))
#include <iarduino_RTC.h> iarduino_RTC time(RTC_DS1302, 2, 3, 4); #include <Adafruit_GFX.h> // подключаем графическую библиотеку #include <Adafruit_ST7735.h> // подключаем библиотеку для управления дисплеем #include <SPI.h> #include <EEPROM.h> #define TFT_CS 10 #define TFT_RST 9 #define TFT_DC 8 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); #define TFT_ #define TFT_MOSI 11 const int buttonPin = 5; int addr = 0; unsigned int f = 241; int m = 0, ert, g; int m3, t; const int buttonPinON = 6; int buttonState = 0; void setup() { pinMode(buttonPin, INPUT_PULLUP); tft.initR(INITR_BLACKTAB); f = EEPROM.read(addr); // m3 = EEPROM.write; delay(500); tft.fillScreen(ST7735_BLACK); tft.fillRoundRect(14, 10, 105, 15, 8, ST7735_WHITE); tft.fillRoundRect(15, 43, 95, 45, 8, ST7735_WHITE); tft.fillRoundRect(15, 95, 95, 40, 8, ST7735_WHITE); delay(300); time.begin(); uint16_t time = millis(); time = millis() - time; // time = millis() – time; } void loop() { int sensorVal = digitalRead(5); int sensorValON = digitalRead(6); if (sensorVal == HIGH) ert = 1; if (ert == 1) { if (sensorVal == LOW) { f = f + 1; tft.fillRoundRect(15, 43, 95, 45, 8, ST7735_WHITE); // EEPROM.write(addr, f); delay(100); ert = 0; } } if (sensorValON == HIGH) delay(100); if (((f - ((f / 100 % 10) * 100)) >= 0) && ((f - ((f / 100 % 10) * 100)) < 10)) { tft.setTextColor(ST7735_RED); tft.setTextSize(3); tft.setCursor(65, 55); tft.println(m); tft.setCursor(85, 55); tft.println(f - ((f / 100 % 10) * 100)); } else { tft.setTextColor(ST7735_RED); tft.setCursor(65, 55); tft.println(f - ((f / 100 % 10) * 100)); } if (f > 99) { tft.setCursor(45, 55); tft.setTextColor(ST7735_BLACK); tft.setTextSize(3); tft.println(f / 100 % 10); //СОТНИ if ((f / 100 % 10) > m3) { tft.fillRoundRect(15, 95, 95, 40, 8, ST7735_WHITE); tft.setCursor(30, 105); tft.setTextColor(ST7735_RED); g = 33 * (f / 100 % 10); //33 стоимость 1 м3 воды по состоянию на 1.01.2022 tft.print(g); tft.println("P"); } } m3 = (f / 100 % 10); }