I am not much of a programmer I have been self taught from building sketches and some online tutorials as well as taking apart others code and seeing how it works but some times I can't see the obvious. So I would appreciate any help below is the error I keep getting and the code.
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"
4-20_w_display_cleanup:60:3: error: 'sevseg' does not name a type
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
^~~~~~
4-20_w_display_cleanup:65:1: error: 'sevseg' does not name a type
sevseg.begin(displayType, numberOfDigits, digit1, digit2, digit3, digit4, segA, segB, segC, segD, segE, segF, segG, segDP);
^~~~~~
4-20_w_display_cleanup:66:2: error: 'sevseg' does not name a type
sevseg.setBrightness(100); // brightness
^~~~~~
4-20_w_display_cleanup:68:3: error: 'Serial' does not name a type
Serial.begin (9600);
^~~~~~
4-20_w_display_cleanup:70:1: error: expected declaration before '}' token
}
^
Multiple libraries were found for "SevSeg.h"
Used: C:\Users\RMW\Documents\Arduino\libraries\SevSeg
Not used: C:\Users\RMW\Documents\Arduino\libraries\SevSegShift
exit status 1
'sevseg' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include <SevSeg.h>
SevSeg sevseg;
/*
Showing number 0-9 on a Common Anode 7-segment LED display
Displays the numbers 0-9 on the display, with one second inbetween.
A
F | | B
G |
---|
E |
D
This example code is in the public domain.
the segment you want to show has to be HIGH
the digit you want to display has to be LOW
*/
//Connection of pressure sensor
int transducer= A0;
const int pmax_current = 20 ;
const int pmin_current = 4;
const int pmax = 16 ;
const int pmin = 0;
const int sensorhigh=1023;
const int sensorlow=0;
unsigned PSI;
//unsigned inches;
//unsigned gallons;
//inserted code for sevseg library
int displayType = COMMON_CATHODE;
//pins for common ground
int digit1 = 13; //Pin 1
int digit2 = 12; //Pin 10
int digit3 = 11; //Pin 4
int digit4 = 10; //Pin 6
//anode pins representin' the seven segments and decimal point
int segA = 2; //Pin 12
int segB = 3; //Pin 11
int segC = 4; //Pin 3
int segD = 5; //Pin 8
int segE = 6; //Pin 2
int segF = 7; //Pin 9
int segG = 8; //Pin 7
int segDP= 9; //Pin 5
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
updateWithDelays, leadingZeros, disableDecPoint);
int numberOfDigits = 4; // becaue i'm using 4 digit display
sevseg.begin(displayType, numberOfDigits, digit1, digit2, digit3, digit4, segA, segB, segC, segD, segE, segF, segG, segDP);
sevseg.setBrightness(100); // brightness
Serial.begin (9600);
}
// the loop routine runs over and over again forever:
void loop() {
// #1. Capture signal and data conversion from sensor
int tranducer =analogRead (A0);
// #2 do the conversions
float inches = (tranducer/12.99); //12.99 is 1023 devided by 78.74(2M) inche span of tranducer
int gallons = (inches*17.61); //17.61 gallons per inch in a 72" diameter tank
//#3 make into a display
char gallonsDisplay [4] = itoa((int)gallons);// maybe wrong spot?
Serial.print("tranducer");
Serial.print(tranducer);
Serial.print("PSI");
Serial.print(PSI);
Serial.print("inches");
Serial.print(inches);
Serial.print("Gallons");
Serial.print(gallons);
sevseg.DisplayString(gallonsDisplay, 0); //(numberToDisplay, decimal point location)
delay(10);
}