подскажите ошибка в тексте
- Войдите на сайт для отправки комментариев
Втр, 11/02/2014 - 19:04
Вот такая ошибка
sketch_feb11b.ino: In function 'void setup()':
sketch_feb11b:50: error: a function-definition is not allowed here before '{' token
sketch_feb11b:96: error: expected `}' at end of input
[code] #include <UTFT.h> extern uint8_t SmallFont[]; UTFT myGLCD (ITDB18SP, 11, 10, 9, 12, 8); #include "DHT.h" #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); int sensor1Pin = A0; int sensor1Value = 0; int sensor2Pin = A1; int sensor2Value = 0; int DravPin = 6; int Klap1Pin = 7; int Klap2Pin = 5; void setup() { { myGLCD.InitLCD(1); myGLCD.setFont(SmallFont); myGLCD.clrScr(); Serial.begin(9600); dht.begin(); myGLCD.setColor(255, 0, 0); // синий цвет myGLCD.fillRect(0, 0, 159, 13); myGLCD.setBackColor(255, 0, 0); myGLCD.setColor(255, 255, 255); //белый цвет myGLCD.print("ETRA", CENTER, 0); myGLCD.setColor(0, 0, 255); // красныц цвет myGLCD.drawRect(0, 14, 159, 54); myGLCD.setBackColor(0, 0, 0); //черный myGLCD.setColor(255, 255, 255); myGLCD.print("air temperatureT*:", LEFT, 15); myGLCD.print("humidity airC%:", LEFT, 28); myGLCD.print("humidity landC%:", LEFT, 41); myGLCD.print("humidity landC%:", LEFT, 56); pinMode(DravPin, OUTPUT); pinMode(Klap1Pin, OUTPUT); pinMode(Klap2Pin, OUTPUT); } void loop() { sensorValue1 = analogRead(sensor1Pin); sensorValue2 = analogRead(sensor2Pin); float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(t) || isnan(h)) { } else { myGLCD.printNumI(t, 142, 15); myGLCD.printNumI(h, 140, 28); myGLCD.setColor(255, 255, 255); myGLCD.printNumI(sensor1Pin, 128, 41); delay (1); myGLCD.setColor(255, 255, 255); myGLCD.printNumI(sensor2Pin, 128, 56); delay (1); if (sensorValue1 == 140) { digitalWrite(DravPin, HIGH); digitalWrite(Klap1Pin, HIGH) } if (sensorValue1 > 140) { digitalWrite(DravPin, LOW); digitalWrite(Klap1Pin, HIGH) } delay (1); if (sensorValue2 == 140) { digitalWrite(DravPin, HIGH); digitalWrite(Klap2Pin, HIGH) } if (sensorValue2 > 140) { digitalWrite(DravPin, LOW); digitalWrite(Klap2Pin, HIGH) } delay (1); } } [/code]
Все устранил