• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Problem z biblioteką DS1302 - LCD-Blue-I2C
#11
Witam jakie oprogramowanie najlepiej ściągnąć? Aktualnie mam 1.8.1 może to jest przyczyną że nie kompiluje się !!!
 
Odpowiedź
#12
Podaj błędy całość.
 
Odpowiedź
#13
np:co z tym kodem jest nie tak

#include <Time.h>
#include <Wire.h>          
#include <LiquidCrystal_I2C.h>
#include <DS1302RTC.h>



DS1302RTC RTC(27, 29, 31);


#define DS1302_GND_PIN 33
#define DS1302_VCC_PIN 35
#include <Time.h>


LiquidCrystal_I2C lcd();

void setup() {
  
  
  lcd.begin(20, 4);
  
  
  digitalWrite(DS1302_GND_PIN, LOW);
  pinMode(DS1302_GND_PIN, OUTPUT);

  digitalWrite(DS1302_VCC_PIN, HIGH);
  pinMode(DS1302_VCC_PIN, OUTPUT);

  lcd.print("RTC activated");

  delay(500);
  
  lcd.clear();
  if (RTC.haltRTC())
    lcd.print("Clock stopped!");
  else
    lcd.print("Clock working.");

  lcd.setCursor(0,1);
  if (RTC.writeEN())
    lcd.print("Write allowed.");
  else
    lcd.print("Write protected.");

  delay ( 2000 );
  
    
  lcd.clear();
  lcd.print("RTC Sync");
  setSyncProvider(RTC.get);         
  if(timeStatus() == timeSet)
    lcd.print(" Ok!");
  else
    lcd.print(" FAIL!");
  
  delay ( 2000 );
  
  lcd.clear();
}

void loop()
{
  static int sday = 0; 

  
  lcd.setCursor(3, 0);
  print2digits(hour());
  lcd.print("  ");
  print2digits(minute());
  lcd.print("  ");
  print2digits(second());
  
  // Update in 00:00:00 hour only
  if(sday != day()) {
    
    lcd.setCursor(0, 1);
    lcd.print(dayShortStr(weekday()));

    
    lcd.setCursor(5, 1);
    lcd.print(" ");
    print2digits(day());
    lcd.print("/");
    print2digits(month());
    lcd.print("/");
    lcd.print(year());
  }
 
  if(timeStatus() != timeSet) {
    lcd.setCursor(0, 1);
    lcd.print(F("RTC ERROR: SYNC!"));
  }

  
  sday = day();

  
  delay (100);
}

void print2digits(int number) {
  if (number >= 0 && number < 10) {
    lcd.write('_');
  }
  lcd.print(number);
}
 
Odpowiedź
#14
błędy

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
DS1302_LCD:8: error: 'DS1302RTC' does not name a type
DS1302_LCD.ino: In function 'void setup()':
DS1302_LCD:21: error: request for member 'begin' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:30: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:34: error: request for member 'clear' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:35: error: 'RTC' was not declared in this scope
DS1302_LCD:36: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:38: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:40: error: request for member 'setCursor' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:41: error: 'RTC' was not declared in this scope
DS1302_LCD:42: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:44: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:49: error: request for member 'clear' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:50: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:51: error: 'RTC' was not declared in this scope
DS1302_LCD:51: error: 'setSyncProvider' was not declared in this scope
DS1302_LCD:52: error: 'timeStatus' was not declared in this scope
DS1302_LCD:52: error: 'timeSet' was not declared in this scope
DS1302_LCD:53: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:55: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:59: error: request for member 'clear' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD.ino: In function 'void loop()':
DS1302_LCD:67: error: request for member 'setCursor' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:68: error: 'hour' was not declared in this scope
DS1302_LCD:69: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:70: error: 'minute' was not declared in this scope
DS1302_LCD:71: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:72: error: 'second' was not declared in this scope
DS1302_LCD:75: error: 'day' was not declared in this scope
DS1302_LCD:77: error: request for member 'setCursor' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:78: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:78: error: 'weekday' was not declared in this scope
DS1302_LCD:78: error: 'dayShortStr' was not declared in this scope
DS1302_LCD:81: error: request for member 'setCursor' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:82: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:84: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:85: error: 'month' was not declared in this scope
DS1302_LCD:86: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:87: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:87: error: 'year' was not declared in this scope
DS1302_LCD:90: error: 'timeStatus' was not declared in this scope
DS1302_LCD:90: error: 'timeSet' was not declared in this scope
DS1302_LCD:91: error: request for member 'setCursor' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:92: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:96: error: 'day' was not declared in this scope
DS1302_LCD.ino: In function 'void print2digits(int)':
DS1302_LCD:104: error: request for member 'write' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
DS1302_LCD:106: error: request for member 'print' in 'lcd', which is of non-class type 'LiquidCrystal_I2C ()()'
 
Odpowiedź
#15
Zamiast
Kod:
LiquidCrystal_I2C lcd();
daj
Kod:
LiquidCrystal_I2C lcd(0x27);
Pomagam za darmo więc szanuj mój czas.
Wklejaj tekst a nie jego zdjęcie.
Nie pisz następnego postu jak nie odpowiedziałeś na poprzedni.
Jak mądrze zadawać pytania
 
Odpowiedź
#16
Dlaczego teraz kompilujesz plik HelloWorld_i2c?
Pomagam za darmo więc szanuj mój czas.
Wklejaj tekst a nie jego zdjęcie.
Nie pisz następnego postu jak nie odpowiedziałeś na poprzedni.
Jak mądrze zadawać pytania
 
Odpowiedź
#17
Nadal błąd
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
DS1302_LCD:8: error: 'DS1302RTC' does not name a type
DS1302_LCD:16: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int)'
C:\Users\DANIEL\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:57: note: candidates are: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
C:\Users\DANIEL\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:55: note: LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)
DS1302_LCD.ino: In function 'void setup()':
DS1302_LCD:35: error: 'RTC' was not declared in this scope
DS1302_LCD:41: error: 'RTC' was not declared in this scope
DS1302_LCD:51: error: 'RTC' was not declared in this scope
DS1302_LCD:51: error: 'setSyncProvider' was not declared in this scope
DS1302_LCD:52: error: 'timeStatus' was not declared in this scope
DS1302_LCD:52: error: 'timeSet' was not declared in this scope
DS1302_LCD.ino: In function 'void loop()':
DS1302_LCD:68: error: 'hour' was not declared in this scope
DS1302_LCD:70: error: 'minute' was not declared in this scope
DS1302_LCD:72: error: 'second' was not declared in this scope
DS1302_LCD:75: error: 'day' was not declared in this scope
DS1302_LCD:78: error: 'weekday' was not declared in this scope
DS1302_LCD:78: error: 'dayShortStr' was not declared in this scope
DS1302_LCD:85: error: 'month' was not declared in this scope
DS1302_LCD:87: error: 'year' was not declared in this scope
DS1302_LCD:90: error: 'timeStatus' was not declared in this scope
DS1302_LCD:90: error: 'timeSet' was not declared in this scope
DS1302_LCD:96: error: 'day' was not declared in this scope
 
Odpowiedź
#18
sorki pomyliłem się ale tamten też nie wchodzi
 
Odpowiedź
#19
Którą wersję biblioteki LiquidCrystal ściągnąłeś? Podaj nazwę pliku zip.
Czy w katalogu C:\Users\DANIEL\Documents\Arduino\libraries\ masz jeszcze inne biblioteki LiquidCrysta? Jeśli tak to przenieś je w inne miejsce.
Dlaczego używasz starej wersji Arduino-IDE?
Pomagam za darmo więc szanuj mój czas.
Wklejaj tekst a nie jego zdjęcie.
Nie pisz następnego postu jak nie odpowiedziałeś na poprzedni.
Jak mądrze zadawać pytania
 
Odpowiedź
#20
Kod PHP:
#include <Time.h>
#include <Wire.h>          
#include <LiquidCrystal_I2C.h>
#include <DS1302RTC.h>



DS1302RTC RTC(272931);


#define DS1302_GND_PIN 33
#define DS1302_VCC_PIN 35



LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7);

void setup() {
 
 
  
  lcd
.begin(204);
 
 lcd.setBacklightPin(3,POSITIVE);
 
 lcd.setBacklight(HIGH);
 
 digitalWrite(DS1302_GND_PINLOW);
 
 pinMode(DS1302_GND_PINOUTPUT);

 
 digitalWrite(DS1302_VCC_PINHIGH);
 
 pinMode(DS1302_VCC_PINOUTPUT);

 
 lcd.print("RTC activated");

 
 delay(500);
 
 
  lcd
.clear();
 
 if (RTC.haltRTC())
 
   lcd.print("Clock stopped!");
 
 else
    lcd
.print("Clock working.");

 
 lcd.setCursor(0,1);
 
 if (RTC.writeEN())
 
   lcd.print("Write allowed.");
 
 else
    lcd
.print("Write protected.");

 
 delay 2000 );
 
 
    
  lcd
.clear();
 
 lcd.print("RTC Sync");
 
 setSyncProvider(RTC.get);         
  if
(timeStatus() == timeSet)
 
   lcd.print(" Ok!");
 
 else
    lcd
.print(" FAIL!");
 
 
  delay 
2000 );
 
 
  lcd
.clear();
}

void loop()
{
 
 static int sday 0

 
 
  lcd
.setCursor(30);
 
 print2digits(hour());
 
 lcd.print("  ");
 
 print2digits(minute());
 
 lcd.print("  ");
 
 print2digits(second());
 
 
  
// Update in 00:00:00 hour only
 
 if(sday != day()) {
 
   
    lcd
.setCursor(01);
 
   lcd.print(dayShortStr(weekday()));

 
   
    lcd
.setCursor(51);
 
   lcd.print(" ");
 
   print2digits(day());
 
   lcd.print("/");
 
   print2digits(month());
 
   lcd.print("/");
 
   lcd.print(year());
 
 }
 
 
 if(timeStatus() != timeSet) {
 
   lcd.setCursor(01);
 
   lcd.print(F("RTC ERROR: SYNC!"));
 
 }

 
 
  sday 
day();

 
 
  delay 
(100);
}

void print2digits(int number) {
 
 if (number >= && number 10) {
 
   lcd.write('_');
 
 }
 
 lcd.print(number);

A takie coś ?
 
Odpowiedź
  


Skocz do:


Przeglądający: 1 gości