В чём ошибка? Arduino: 1.8.5 (Windows 7), Плата:"Arduino Nano, ATmega328P" C:\Users\семья\Desktop\термометр Arduino\i2c\HelloWorld\HelloWorld.ino: In function 'void loop()': HelloWorld:110: error: call of overloaded 'print(void (&)())' is ambiguous C:\Users\семья\Desktop\термометр Arduino\i2c\HelloWorld\HelloWorld.ino:110:15: note: candidates are: In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0, from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29, from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232, from sketch\HelloWorld.ino.cpp:1: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: size_t Print:rint(char) <near match> size_t print(char); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: no known conversion for argument 1 from 'void()' to 'char' C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: size_t Print:rint(unsigned char, int) <near match> size_t print(unsigned char, int = DEC); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: no known conversion for argument 1 from 'void()' to 'unsigned char' C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: size_t Print:rint(int, int) <near match> size_t print(int, int = DEC); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: no known conversion for argument 1 from 'void()' to 'int' C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: size_t Print:rint(unsigned int, int) <near match> size_t print(unsigned int, int = DEC); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: no known conversion for argument 1 from 'void()' to 'unsigned int' C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: size_t Print:rint(long int, int) <near match> size_t print(long, int = DEC); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: no known conversion for argument 1 from 'void()' to 'long int' C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: size_t Print:rint(long unsigned int, int) <near match> size_t print(unsigned long, int = DEC); ^ C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: no known conversion for argument 1 from 'void()' to 'long unsigned int' exit status 1 call of overloaded 'print(void (&)())' is ambiguous Этот отчёт будет иметь больше информации с включенной опцией Файл -> Настройки -> "Показать подробный вывод во время компиляции" Скетч Код (C++): #include <Wire.h> // библиотека для управления устройствами по I2C #include <LiquidCrystal_I2C.h> // подключаем библиотеку для LCD 1602 #define analogPin A0 // аналоговый выход MQ135 подключен к пину A0 Arduino //#define digitalPin 3 // цифровой выход подключен к пину 3 //#include "DHT.h" //#define DHTPIN 3 //#define DHTTYPE DHT11 // DHT 11 float analogValue; // для аналогового значения byte digitalValue; // для цифрового значения, можно, кстати и boolean, но не суть LiquidCrystal_I2C lcd(0x3F,20,4); // присваиваем имя lcd для дисплея 20х2 // создаем символ сердца и четырех букв на кириллице byte heart[8] = { 0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000 }; byte Ia[8]= { 0b01111, 0b10001, 0b10001, 0b01111, 0b00101, 0b01001, 0b10001, 0b00000 }; byte B[8] = { 0b11111, 0b10000, 0b10000, 0b11110, 0b10001, 0b10001, 0b11110, 0b00000 }; byte N[8] = { 0b10001, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001, 0b10001, 0b00000 }; byte F[8] = { 0b01110, 0b10101, 0b10101, 0b10101, 0b01110, 0b00100, 0b00100, 0b00000 }; byte U[8] = { 0b10001, 0b10001, 0b01010, 0b01110, 0b00100, 0b00100, 0b01000, 0b10000 }; byte L[8] = { 0b00011, 0b00101, 0b00101, 0b01001, 0b01001, 0b01001, 0b01001, 0b10001 }; byte I[8] = { 0b10001, 0b10001, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001, 0b10001 }; byte C[8] = { 0b10010, 0b10010, 0b10010, 0b10010, 0b10010, 0b10010, 0b11111, 0b00001 }; byte D[8] = { 0b00011, 0b00101, 0b00101, 0b00101, 0b01001, 0b11111, 0b10001, 0b10001 }; void setup() // процедура setup { pinMode(analogPin, INPUT); // режим работы аналогового пина //pinMode(digitalPin, INPUT); // режим работы цифрового пина delay(1000); // устаканимся lcd.init(); // инициализация LCD дисплея lcd.backlight(); // включение подсветки дисплея // присваиваем символам порядковый номер lcd.createChar(1, heart); lcd.createChar(2, Ia); lcd.createChar(3, B); lcd.createChar(4, N); lcd.createChar(5, F); lcd.createChar(6, U); lcd.createChar(7, L); lcd.createChar(8, I); lcd.createChar(9, C); lcd.createChar(10,D); analogValue = analogRead(analogPin); // чтение аналогового значения // digitalValue = digitalRead(3); // чтение цифрового значения lcd.setCursor(0,0); // устанавливаем курсор на начало второй строки lcd.print(char(6)); lcd.print(char(7)); lcd.print(char(8)); lcd.print(char(9)); lcd.print("A"); lcd.setCursor(0,2); // устанавливаем курсор на 2 символ первой строки lcd.print(char(10)); lcd.print("O"); lcd.print("M"); lcd.setCursor(6,0); lcd.print("T 22,22c"); lcd.setCursor(15,0); lcd.print("H 99%"); lcd.setCursor(2,1); lcd.print("P 777mm"); // dht.begin(); delay(1); } void an() { lcd.setCursor(1,3); lcd.print("Co2: "); // вывод аналогового значения в последовательный порт lcd.print(analogValue); delay(1); } void loop() // процедура loop { // float h = dht.readHumidity(); // float t = dht.readTemperature(); // float f = dht.readTemperature(true); // float hif = dht.computeHeatIndex(f, h); // float hic = dht.computeHeatIndex(t, h, false); // lcd.setCursor(6,2); // lcd.print("Humidity: "); // lcd.print(h); // lcd.print(" %\t"); // lcd.setCursor(15,2); // lcd.print("Temperature: "); //lcd.print(t); lcd.print(an) }
А что этот Код вообще делает?Только апает?Если Апать то только так Код (C++): #include <Wire.h> // библиотека для управления устройствами по I2C #include <LiquidCrystal_I2C.h> // подключаем библиотеку для LCD 1602 #define analogPin A0 // аналоговый выход MQ135 подключен к пину A0 Arduino //#define digitalPin 3 // цифровой выход подключен к пину 3 //#include "DHT.h" //#define DHTPIN 3 //#define DHTTYPE DHT11 // DHT 11 float analogValue; // для аналогового значения byte digitalValue; // для цифрового значения, можно, кстати и boolean, но не суть LiquidCrystal_I2C lcd(0x3F,20,4); // присваиваем имя lcd для дисплея 20х2 // создаем символ сердца и четырех букв на кириллице byte heart[8] = { 0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000 }; byte Ia[8]= { 0b01111, 0b10001, 0b10001, 0b01111, 0b00101, 0b01001, 0b10001, 0b00000 }; byte B[8] = { 0b11111, 0b10000, 0b10000, 0b11110, 0b10001, 0b10001, 0b11110, 0b00000 }; byte N[8] = { 0b10001, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001, 0b10001, 0b00000 }; byte F[8] = { 0b01110, 0b10101, 0b10101, 0b10101, 0b01110, 0b00100, 0b00100, 0b00000 }; byte U[8] = { 0b10001, 0b10001, 0b01010, 0b01110, 0b00100, 0b00100, 0b01000, 0b10000 }; byte L[8] = { 0b00011, 0b00101, 0b00101, 0b01001, 0b01001, 0b01001, 0b01001, 0b10001 }; byte I[8] = { 0b10001, 0b10001, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001, 0b10001 }; byte C[8] = { 0b10010, 0b10010, 0b10010, 0b10010, 0b10010, 0b10010, 0b11111, 0b00001 }; byte D[8] = { 0b00011, 0b00101, 0b00101, 0b00101, 0b01001, 0b11111, 0b10001, 0b10001 }; void setup() // процедура setup { pinMode(analogPin, INPUT); // режим работы аналогового пина //pinMode(digitalPin, INPUT); // режим работы цифрового пина delay(1000); // устаканимся lcd.init(); // инициализация LCD дисплея lcd.backlight(); // включение подсветки дисплея // присваиваем символам порядковый номер lcd.createChar(1, heart); lcd.createChar(2, Ia); lcd.createChar(3, B); lcd.createChar(4, N); lcd.createChar(5, F); lcd.createChar(6, U); lcd.createChar(7, L); lcd.createChar(8, I); lcd.createChar(9, C); lcd.createChar(10,D); analogValue = analogRead(analogPin); // чтение аналогового значения // digitalValue = digitalRead(3); // чтение цифрового значения lcd.setCursor(0,0); // устанавливаем курсор на начало второй строки lcd.print(char(6)); lcd.print(char(7)); lcd.print(char(8)); lcd.print(char(9)); lcd.print("A"); lcd.setCursor(0,2); // устанавливаем курсор на 2 символ первой строки lcd.print(char(10)); lcd.print("O"); lcd.print("M"); lcd.setCursor(6,0); lcd.print("T 22,22c"); lcd.setCursor(15,0); lcd.print("H 99%"); lcd.setCursor(2,1); lcd.print("P 777mm"); // dht.begin(); delay(1); } void loop() // процедура loop { lcd.setCursor(1,3); lcd.print("Co2: "); // вывод аналогового значения в последовательный порт lcd.print(analogValue); delay(1); } Вот так компилиться