Я многократно повторяю одну и ту же ошибку - "не был объявлен в этой области, что мне делать?
Вот этот код :
/* LiquidCrystal Library - Hello World The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * LCD VSS pin to ground * LCD VCC pin to 5V * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) */ // include the library code: #include <LiquidCrystal.h> // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); //intialise all varibales being used in the program float currentTemp = tempsensor(); int ledPin = 13; // choose the pin for the LED int inPin = 7; // choose the input pin (for a pushbutton) int val = 0; // variable for reading the pin status digitalWrite(LED, HIGH); digitalWrite(LED, LOW); void setup() { pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inPin, INPUT); // declare pushbutton as input // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop() { val = digitalRead(inPin); // read input value if (val == HIGH) { // check if the input is HIGH (button released) float currentTemp = tempsensor(); if(currentTemp<maxTemp){ //turn the heat up(LED ) digitalWrite(LED, HIGH); }else if(currentTemp>maxTemp){ //turn off heat(LED) digitalWrite(LED, LOW); }else{} // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(maxTemp); } }
Вот такие ошибки:
ArduinoLcdButtonFunctions:71: error: 'tempsensor' was not declared in this scope float currentTemp = tempsensor(); ^ ArduinoLcdButtonFunctions:72: error: 'maxTemp' was not declared in this scope if(currentTemp<maxTemp){ ^ ArduinoLcdButtonFunctions:74: error: 'LED' was not declared in this scope digitalWrite(LED, HIGH); ^ ArduinoLcdButtonFunctions:77: error: 'LED' was not declared in this scope digitalWrite(LED, LOW); ^ ArduinoLcdButtonFunctions:83: error: 'maxTemp' was not declared in this scope lcd.print(maxTemp); ^ exit status 1 'tempsensor' was not declared in this scope
Что я могу сделать, чтобы исправить это ???
Что я уже пробовал:
Форумы Ardiuno, Youtube, StackOverFlow.