help with error message liquidcrystal595

Hello, ive been trying to use this DIY breathalyzer but im getting this error message, ive already tried to change the name of the LC libraries name but to no good.

sketch_mar26a:4: error: 'LiquidCrystal595' does not name a type
sketch_mar26a:13: error: expected `}' before 'int'
sketch_mar26a:13: error: expected ',' or ';' before 'int'
sketch_mar26a.ino: In function 'void setup()':
sketch_mar26a:32: error: 'lcd' was not declared in this scope
sketch_mar26a.ino: In function 'void loop()':
sketch_mar26a:41: error: 'readyPin' was not declared in this scope
sketch_mar26a:45: error: 'lcd' was not declared in this scope

Here is the code

 #include <LiquidCrystal595.h>                                                            
 // initialize the library with the numbers of the interface pins + the row count         
 // datapin, latchpin, clockpin, num_lines                                                
 LiquidCrystal595 lcd(2,3,4);      // can assign these any pin                            
 

int mq3_analogPin = A2; // connected to the output pin of MQ3
 const int ledCount = 6;    // the number of LEDs in the bar graph
 int minValue = 670;// to set LED range
 int maxValue = 840; // to set LED range
 int ledPins[] = {
   10,9,8,7,6,5 // Here we have the number of LEDs to use in the BarGraph };
 int readyPin = 12; // green light
 int notReadyPin = 13; // red light
 int buttonPin = 11; // tact button
 int readyThreshold = 680;
 float maxReading = 0;
 int buttonState = 0; // 0 if not ready, 1 if ready
 double BAC = 0;
 //-----------------------------------------------------------------------
 

void setup() {
   Serial.begin(9600); // open serial at 9600 bps
   for (int thisLed = 0; thisLed < ledCount; thisLed++) {
     pinMode(ledPins[thisLed], OUTPUT);
     pinMode(buttonPin, INPUT);
   }
   Serial.println("Warming up");
 

 lcd.setLED2Pin(HIGH); // turns the screen's backlight on (setLED2Pin(LOW) for backlight off)  
   lcd.begin(20,4);                                                                              
   lcd.print("Warming up");                                                                    
   delay(6000); // warm up time                                                                  
 

}
 //-----------------------------------------------------------------------
 void loop() {
   digitalWrite(readyPin, LOW); // turn green led off
   digitalWrite(notReadyPin, HIGH); // turn red led on
   buttonState = digitalRead(buttonPin);
   Serial.println("Waiting for button press to begin next test");
   lcd.setCursor(0,0);
   lcd.print("Press button");
   // waits until button is pressed before checking value
   while (buttonState == 0)
     buttonState = digitalRead(buttonPin);
   // read in first value
   int mq3_value = analogRead(mq3_analogPin);
   // if reading above threshold, sensor is not ready for next test
   if(mq3_value >= readyThreshold) {
     Serial.print("Don't blow yet: reading is ");
     Serial.println(mq3_value);
     lcd.clear();
     lcd.print("Not ready: ");
     lcd.setCursor(0,1);
     lcd.print("reading is ");
     lcd.print(mq3_value);
     delay(500);
   }
   // else the sensor is ready - read values in for 5 sec
   else {
     maxReading = 0;
     digitalWrite(readyPin, HIGH); // turn green led on
     digitalWrite(notReadyPin, LOW); // turn red led off
     Serial.print("Prepare to blow in 5, ");
     lcd.clear();
     lcd.setCursor(0,0);                                                                            
     lcd.print("Prepare to blow in 5, ");                                                          
     lcd.setCursor(0,1);
     lcd.print("in 5, ");
     delay(900);
     Serial.print("4, ");
     lcd.print("4, ");
     delay(900);
     Serial.print("3, ");
     lcd.print("3, ");
     delay(900);
     Serial.print("2, ");
     lcd.print("2, ");
     delay(900);
     Serial.println("1");
     lcd.print("1, ");
     delay(800);
     Serial.println("Blow for 5 sec");
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Blow for 5 sec");
     Serial.print("Initial reading: ");
     Serial.println(maxReading);
     
     for(int i = 0; i < 700; i++) {  // change this value to control blow duration
       int mq3_value = analogRead(mq3_analogPin); // read value
       Serial.println(mq3_value);
       // store max reading for this trial
       if(mq3_value > maxReading) {
         maxReading = mq3_value;
       } // end if
       lcd.setCursor(0,1);
       lcd.print(maxReading);
       // light lEDs based on max reading
       int ledLevel = map(maxReading, minValue, maxValue, 0, ledCount);
       for (int thisLed = 0; thisLed < ledCount; thisLed++) {
         if (thisLed < ledLevel) {
           digitalWrite(ledPins[thisLed], HIGH);
         } // end if
         else {
           digitalWrite(ledPins[thisLed], LOW);
         } // end else
       } // end inner for
     } // end outer for
     
     Serial.print("Max reading:     ");
     Serial.print(maxReading);
     Serial.print("  BAC: ");
     BAC = pow(((-3.757)*pow(10, -7))*maxReading, 2) + 0.0008613*maxReading -0.3919;
     Serial.println(BAC);
     Serial.println("");
     
     //lcd.setLED2Pin(HIGH); // turns the screen's backlight on (setLED2Pin(LOW) for backlight off)
     //lcd.begin(20,4);                                                                            
     // Print a message to the LCD.                                                                
     lcd.setCursor(0,0);                                                                            
     lcd.print("Max reading: ");                                                                    
     lcd.print(maxReading);                                                                        
     delay(3);                                                                                      
     lcd.setCursor(0,1);                                                                            
     lcd.print("BAC: ");                                                                            
     lcd.print(BAC);                                                                                
     delay(5);                                                                                      
   } // end outer else
 

 Serial.println("Waiting for button press to reset");
   buttonState = digitalRead(buttonPin);
   while (buttonState == 0)
     buttonState = digitalRead(buttonPin);
   maxReading = 0;
 } // end loop

// means that the rest of the line is ignored!

Mark

Mark's trying to point out that the line:

 int ledPins[] = {
   10,9,8,7,6,5 // Here we have the number of LEDs to use in the BarGraph };

won't compile because everything from the comment marks ("//") to the end of the line is ignored. This means the compiler never sees the "};" code that should be used to end the statement line.

how could i missed that :S thanks.

but now im having issued with the 595 librarie.

In file included from breath.ino:1:0:
C:\Users\joao\Documents\Arduino\libraries\LiquidCrystal595/LiquidCrystal595.h:98:16: error: conflicting return type specified for 'virtual void LiquidCrystal595::write(uint8_t)'
   virtual void write(uint8_t);
                ^
In file included from C:\Users\joao\Documents\Arduino\libraries\LiquidCrystal595/LiquidCrystal595.h:32:0,
                 from breath.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: error:   overriding 'virtual size_t Print::write(uint8_t)'
     virtual size_t write(uint8_t) = 0;
                    ^
Erro ao compilar.

ive already tried to change the "void" from line 98 to "size_t"

Post your current code and both the lib files (.h and .cpp) along with the current set of error messages.

Mark

The code

#include <LiquidCrystal595.h>                                                            
 // initialize the library with the numbers of the interface pins + the row count         
 // datapin, latchpin, clockpin, num_lines                                                
 LiquidCrystal595 lcd(2,3,4);      // can assign these any pin                            
 

int mq3_analogPin = A2; // connected to the output pin of MQ3
 const int ledCount = 6;    // the number of LEDs in the bar graph
 int minValue = 670;// to set LED range
 int maxValue = 840; // to set LED range
 int ledPins[] = {
   10,9,8,7,6,5 };// Here we have the number of LEDs to use in the BarGraph 
 int readyPin = 12; // green light
 int notReadyPin = 13; // red light
 int buttonPin = 11; // tact button
 int readyThreshold = 680;
 float maxReading = 0;
 int buttonState = 0; // 0 if not ready, 1 if ready
 double BAC = 0;
 //-----------------------------------------------------------------------
 

void setup() {
   Serial.begin(9600); // open serial at 9600 bps
   for (int thisLed = 0; thisLed < ledCount; thisLed++) {
     pinMode(ledPins[thisLed], OUTPUT);
     pinMode(buttonPin, INPUT);
   }
   Serial.println("Warming up");
 

 lcd.setLED2Pin(HIGH); // turns the screen's backlight on (setLED2Pin(LOW) for backlight off)  
   lcd.begin(20,4);                                                                              
   lcd.print("Warming up");                                                                    
   delay(6000); // warm up time                                                                  
 

}
 //-----------------------------------------------------------------------
 void loop() {
   digitalWrite(readyPin, LOW); // turn green led off
   digitalWrite(notReadyPin, HIGH); // turn red led on
   buttonState = digitalRead(buttonPin);
   Serial.println("Waiting for button press to begin next test");
   lcd.setCursor(0,0);
   lcd.print("Press button");
   // waits until button is pressed before checking value
   while (buttonState == 0)
     buttonState = digitalRead(buttonPin);
   // read in first value
   int mq3_value = analogRead(mq3_analogPin);
   // if reading above threshold, sensor is not ready for next test
   if(mq3_value >= readyThreshold) {
     Serial.print("Don't blow yet: reading is ");
     Serial.println(mq3_value);
     lcd.clear();
     lcd.print("Not ready: ");
     lcd.setCursor(0,1);
     lcd.print("reading is ");
     lcd.print(mq3_value);
     delay(500);
   }
   // else the sensor is ready - read values in for 5 sec
   else {
     maxReading = 0;
     digitalWrite(readyPin, HIGH); // turn green led on
     digitalWrite(notReadyPin, LOW); // turn red led off
     Serial.print("Prepare to blow in 5, ");
     lcd.clear();
     lcd.setCursor(0,0);                                                                            
     lcd.print("Prepare to blow in 5, ");                                                          
     lcd.setCursor(0,1);
     lcd.print("in 5, ");
     delay(900);
     Serial.print("4, ");
     lcd.print("4, ");
     delay(900);
     Serial.print("3, ");
     lcd.print("3, ");
     delay(900);
     Serial.print("2, ");
     lcd.print("2, ");
     delay(900);
     Serial.println("1");
     lcd.print("1, ");
     delay(800);
     Serial.println("Blow for 5 sec");
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Blow for 5 sec");
     Serial.print("Initial reading: ");
     Serial.println(maxReading);
     
     for(int i = 0; i < 700; i++) {  // change this value to control blow duration
       int mq3_value = analogRead(mq3_analogPin); // read value
       Serial.println(mq3_value);
       // store max reading for this trial
       if(mq3_value > maxReading) {
         maxReading = mq3_value;
       } // end if
       lcd.setCursor(0,1);
       lcd.print(maxReading);
       // light lEDs based on max reading
       int ledLevel = map(maxReading, minValue, maxValue, 0, ledCount);
       for (int thisLed = 0; thisLed < ledCount; thisLed++) {
         if (thisLed < ledLevel) {
           digitalWrite(ledPins[thisLed], HIGH);
         } // end if
         else {
           digitalWrite(ledPins[thisLed], LOW);
         } // end else
       } // end inner for
     } // end outer for
     
     Serial.print("Max reading:     ");
     Serial.print(maxReading);
     Serial.print("  BAC: ");
     BAC = pow(((-3.757)*pow(10, -7))*maxReading, 2) + 0.0008613*maxReading -0.3919;
     Serial.println(BAC);
     Serial.println("");
     
     //lcd.setLED2Pin(HIGH); // turns the screen's backlight on (setLED2Pin(LOW) for backlight off)
     //lcd.begin(20,4);                                                                            
     // Print a message to the LCD.                                                                
     lcd.setCursor(0,0);                                                                            
     lcd.print("Max reading: ");                                                                    
     lcd.print(maxReading);                                                                        
     delay(3);                                                                                      
     lcd.setCursor(0,1);                                                                            
     lcd.print("BAC: ");                                                                            
     lcd.print(BAC);                                                                                
     delay(5);                                                                                      
   } // end outer else
 

 Serial.println("Waiting for button press to reset");
   buttonState = digitalRead(buttonPin);
   while (buttonState == 0)
     buttonState = digitalRead(buttonPin);
   maxReading = 0;
 } // end loop

the H and CCP files are attached.

the error is the following:

In file included from breath.ino:1:0:
C:\Users\joao\Documents\Arduino\libraries\LiquidCrystal595/LiquidCrystal595.h:98:16: error: conflicting return type specified for 'virtual void LiquidCrystal595::write(uint8_t)'
   virtual void write(uint8_t);
                ^
In file included from C:\Users\joao\Documents\Arduino\libraries\LiquidCrystal595/LiquidCrystal595.h:32:0,
                 from breath.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: error:   overriding 'virtual size_t Print::write(uint8_t)'
     virtual size_t write(uint8_t) = 0;
                    ^
Erro ao compilar.

LiquidCrystal595.cpp (10.7 KB)

LiquidCrystal595.h (3.52 KB)