exit status 1 Error compiling for board Arduino/Genuino Uno.

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

можно задать ворос что произашло при загрузки програми которая работала день назад видает теперь

exit status 1
Error compiling for board Arduino/Genuino Uno.

вот все что мне написал компилятор
D:\arduino-nightly\libraries\DS1307/DS1307.h:54:17: error: expected identifier before numeric constant

 #define SUNDAY  7

                 ^

D:\arduino-nightly\libraries\DS1307/DS1307.h:54:17: error: expected '}' before numeric constant

D:\arduino-nightly\libraries\DS1307/DS1307.h:54:17: error: expected unqualified-id before numeric constant

In file included from C:\Users\dima\Desktop\final\sketch_nov05a\sketch_nov05a.ino:4:0:

c:\users\dima\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\time.h:506:1: error: expected declaration before '}' token

 }

 ^

Using library DHT-sensor-library-master at version 1.2.3 in folder: D:\arduino-nightly\libraries\DHT-sensor-library-master
Використання бібліотеки LedControlMS з теки: D:\arduino-nightly\libraries\LedControlMS (legacy)
Використання бібліотеки DS1307 з теки: D:\arduino-nightly\libraries\DS1307 (legacy)
Using library Wire at version 1.0 in folder: C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\libraries\Wire
Using library Adafruit-BMP085-Library-master at version 1.0.0 in folder: D:\arduino-nightly\libraries\Adafruit-BMP085-Library-master
exit status 1
Error compiling for board Arduino/Genuino Uno.

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016
вот код
#include "DHT.h"
#include "LedControlMS.h"
#include <DS1307.h>
#include <Time.h>
#include <Wire.h>
#include <Adafruit_BMP085.h>
#define DHTPIN 2     
#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE);
DS1307 rtc(4, 5);
Time  t;
Adafruit_BMP085 bmp;
int ones_t;
int tens_t;
int hunds_t;
float P;
float tp ;
int tp_2;
int P_2;
int mint = minute();
int hr = hour();
int set_button = 0;
int set_button_t ;
int set_button_pin = 7;
int set_button_pin_t = 6;
int newhour = t.hour;
int newminute = t.min ;
int hundreds = 0;
int tens = 0;
int ones = 0;
int hundredsH = 0;
int tensH = 0;
int onesH = 0;
int T1 = 0;
int H1 = 0;
char mm = ' ';
char mm_2 = ' ';
int sminute = 0;
int shour = 0; 
int sminute1 = 0;
int hund = 0;
int ten = 0;
int shour1 = 0;
int hund2 = 0;
int ten2 = 0;
int onesP;
int tensP;
int hundredsP;
int thousandsP;

// I assume you know how to connect the DS1307.
// DS1307:  SDA pin   -> Arduino Digital 4
//          SCL pin   -> Arduino Digital 5

//***** These pin numbers will probably not work with your hardware *****
//pin 12 is connected to the DataIn 
//pin 11 is connected to the CLK 
//pin 10 is connected to LOAD 
//We have only a single MAX72XX. 
// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here
// I assume you know how to connect the DS1307.
// DS1307:  SDA pin   -> Arduino Digital 4
//          SCL pin   -> Arduino Digital 5
LedControl lc=LedControl(12,11,10,3);
unsigned long delaytime=250;
void setup() {
  lc.shutdown(0,false);
  lc.setIntensity(0,5);//яркость 
 //
  lc.shutdown(1,false);
  lc.setIntensity(1,5);
 //
  lc.shutdown(2,false);
  lc.setIntensity(2,5);
  //////
 //////////////
  pinMode(set_button_pin, INPUT);
  pinMode(set_button_pin_t, INPUT); 
  ///
  Serial.begin(9600);
   ///
  pinMode(2, INPUT);
  digitalWrite(2, HIGH);
  pinMode(3, INPUT);
  digitalWrite(3, HIGH);
  dht.begin();
  ////
   if (!bmp.begin()) {
  Serial.println("Could not find a valid BMP085 sensor, check wiring!");
  while (1) {}
  }
}
void timing(){

  t = rtc.getTime();
  set_button = digitalRead(set_button_pin);
  if(set_button==1){
    
    newhour++ ;
    if(newhour > 24){
    newhour = newhour-25;
    }
  rtc.setTime(newhour, t.min, 0);
  delay (300);  
  }
  set_button_t = digitalRead(set_button_pin_t);
  if(set_button_t==1){
    
    newminute++ ;
    if(newminute > 60){
    newminute = newminute-61;
    }
  rtc.setTime(t.hour, newminute, 0);
  delay (300); 
  }
 
  sminute = t.min;
  shour = t.hour; 
  sminute1 = sminute*10;
  hund = sminute1/100;
  ten = (sminute1-hund*100)/10;
  shour1 = shour*10;
  hund2 = shour1/100;
  ten2 = (shour1-hund2*100)/10;
  
  delay (10);
  Serial.println(rtc.getTimeStr());
  }
void loop() {
  timing();
  lc.setChar(0,0,ones,false); 
  lc.setChar(0,1,tens,true);
  lc.setChar(0,2,hundreds,false);
  lc.setChar(0,3,mm,false);
  lc.setChar(0,4,onesH,false); 
  lc.setChar(0,5,tensH,true); 
  lc.setChar(0,6,hundredsH,false);
  lc.setChar(0,7,' ',false);
  /////////////////////////////////
  lc.setChar(1,0,onesP,false); 
  lc.setChar(1,1,tensP,true);
  lc.setChar(1,2,hundredsP,false);
  lc.setChar(1,3,thousandsP,false);
  lc.setChar(1,4,ten,false); 
  lc.setChar(1,5,hund,false); 
  lc.setChar(1,6,ten2,true);
  lc.setChar(1,7,hund2,false);
  ////////////////
  lc.setChar(2,0,ones_t,false); 
  lc.setChar(2,1,tens_t,true);
  lc.setChar(2,2,hunds_t,false);
  lc.setChar(2,3,mm_2,false);
  lc.setChar(2,4,' ',false); 
  lc.setChar(2,5,' ',false); 
  lc.setChar(2,6,' ',false);
  lc.setChar(2,7,' ',false);
 
float H = dht.readHumidity();
  float T = dht.readTemperature();
  float hic = dht.computeHeatIndex(T, H, false);
  int i = 0;
if(H>95){
  H = H + 1.1;
}
if(T<0){
  mm = '-';
  T = T*-1;
}else{
  mm = ' ' ;
  }
  T1 =T*10; 
  hundreds = T1/100;            
  tens=(T1-hundreds*100)/10;    
  ones=T1-(hundreds*100+tens*10);
  H1 = H*10;   
  hundredsH = H1/100;        
  tensH=(H1-hundredsH*100)/10; 
  onesH=H1-(hundredsH*100+tensH*10);
  ////////////////////////////
   P = bmp.readPressure();
  P=(float)0.0075*P;
  P_2 = P*10;
  onesP=P_2%10;
  P_2/=10;
  tensP=P_2%10;
  P_2/=10;
  hundredsP=P_2%10;
  P_2/=10;
  thousandsP=P_2%10;
  tp = bmp.readTemperature();
  tp_2 = tp*10;
  ones_t=tp_2%10;
  tp_2/=10;
  tens_t=tp_2%10;
  tp_2/=10;
  hunds_t=tp_2%10;
  if(tp<0){
    tp=tp*-1;
    mm_2='-';
  }else{
    mm_2=' ';
  }
}

 

Arhat109-2
Offline
Зарегистрирован: 24.09.2015

Похоже на наведенную ошибку из предыдущего инклуда. Может быть связано с преобразованием скетча в версиях старше 1.6.7

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

Но используя arduino debug мене показалась ошибка в библиотеке time.h .

Зашел я значит на указаную строчку с ошибкой и ...

НОЧЕГО там небило.

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

версия же 1.6.10.0

 

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

В общем мне удалось решить ету проблему и так

1. Нажимаем WIN+R пишем туда %appdata% жмем ENTER.

2.находим папку Arduino15.

3.удаляэм ее.

!!!WARNING!!!

Настройки будут потеряни.