Tengo este codigo para un Alcoholimetro con sensor MQ3 y me da el siguiente error:
CODIGO:
#include <Button.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
// Set pin to the LCD's rxPin
int pin = 2;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Set button pin
Button btn(7);
void setup()
{
Serial.begin(9600);
lcd.clear();
//Push the button to start
lcd.print("Apasa-ti butonul");
lcd.print("pentru a incepe!");
btn.setup(); // setup & describe the button's normal state
btn.normallyOpen(); // button closes circuit when pressed
//btn.normallyClosed(); // button opens circuit when pressed
btn.buttonCold(); // button shorts to sink
//btn.buttonHot(); // button shorts to voltage
bool isButtonPressed ( void ); // is the button in the opposite of normal state ?
bool buttonMoved ( void ); // did the button change ?
}
#define skipCount 2
#define sampleCount 5
void loop()
{
btn.loop();
int sensorValue = 0; // The sensor value
sensorValue = analogRead(A0);
// only while the button is pushed
if (btn.isButtonPressed()) {
// read the sensor X times and average the total, skipping the 1st Y readings
for (int i=0; i< skipCount ; i++) analogRead(A0);
for (int i=0; i< sampleCount ; i++)
{
sensorValue += analogRead(A0);
}
sensorValue /= sampleCount + 1;
//detection concentartion scope is between 0.04 to 4 mg/L
float mappedValue = map(sensorValue, 120, 1023, (0.04*100.00),(4.00*100.00))/100.00;
lcd.clear();
lcd.print("Alcool: ");
if (mappedValue >= 0.04)
{
lcd.print(mappedValue);
}
else
{
lcd.print("0.00");
}
lcd.print("mg/L");
//averaged raw value
lcd.print(sensorValue);
delay(2000);
}
}
ERROR: ‘class button’ has no member named setup :~
Gracias de antemano