Thanks Paul
What I did wrong ?
the errors
voltometr_min_max_6:11: error: conflicting declaration 'int maxVal'
int maxVal = -1000;
^
C:\Users\OWNER\Desktop\bibloteka\voltometr_min_max_6\voltometr_min_max_6.ino:8:7: note: previous declaration as 'float maxVal'
float maxVal = 0;
^
voltometr_min_max_6:12: error: conflicting declaration 'int minVal'
int minVal = +1000;
^
C:\Users\OWNER\Desktop\bibloteka\voltometr_min_max_6\voltometr_min_max_6.ino:9:7: note: previous declaration as 'float minVal'
float minVal = 10;
^
C:\Users\OWNER\Desktop\bibloteka\voltometr_min_max_6\voltometr_min_max_6.ino: In function 'void loop()':
voltometr_min_max_6:23: error: 'calibratePin' was not declared in this scope
int currState = digitalRead(calibratePin);
^
voltometr_min_max_6:27: error: expected ')' before '{' token
{
^
voltometr_min_max_6:31: error: expected primary-expression before '}' token
}
^
voltometr_min_max_6:34: error: 'somePin' was not declared in this scope
int theVal = analogRead(somePin);
^
voltometr_min_max_6:46: error: 'vin' was not declared in this scope
lcd.print(vin, 2); // the extra parameter 2 indicates the decimals
^
voltometr_min_max_6:54: error: expected '}' at end of input
}
^
Multiple libraries were found for "LiquidCrystal.h"
Used: C:\Users\OWNER\Desktop\183\arduino-1.8.3\libraries\LiquidCrystal
Not used: C:\Users\OWNER\Documents\Arduino\libraries\Newliquidcrystal_1.3.5
Using library LiquidCrystal at version 1.0.5 in folder: C:\Users\OWNER\Desktop\183\arduino-1.8.3\libraries\LiquidCrystal
exit status 1
conflicting declaration 'int maxVal'
#include <LiquidCrystal.h>
//LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int analogInput = 0;
const int potPin = A0; //Potentiometer input pin
const int ResetPin = 8; // resets Tmin and Tmax both to current temperature T
float maxVal = 0;
float minVal = 10;
bool calibrating = true;
int maxVal = -1000;
int minVal = +1000;
int prevState = HIGH;
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
{
int currState = digitalRead(calibratePin);
if(currState != prevState)
{
if((currState == LOW)
{
// The properly wired switch became pressed
calibrating = !calibrating;
}
}
prevState = currState;
int theVal = analogRead(somePin);
if(calibrating)
{
if(theVal > maxVal)
maxVal = minVal;
if(theVal < minVal)
minVal = theVal;
}
// DISPLAY
lcd.setCursor(0, 0);
lcd.print(vin, 2); // the extra parameter 2 indicates the decimals
lcd.print(" ");
lcd.print(minVal, 1);
lcd.print("-");
lcd.print(maxVal, 1);
lcd.setCursor(0, 1);
lcd.print(maxVal - vin);
delay(400);
}