Error Problem exit status 1 'PIN_FLOAT' was not declared in this scope

I can’t see what the problem is here.

Would anybody have a minute to look for my problem?

TIA

David

/*  This is a program to use the MCP3424 A/D converter along with a Nano and OLED
    to provide a microOhmmeter function.
    This unit automatically conducts four ranges on the A/D converter and selects the proper one.
    Start date is 04/18/2019
    Complete date 04/20/2019
    Upgraded to PCB layout, complete rework of sketch program file
    Upgraded date is 07/01/2020
    Upgraded to measure test current with 0.1 Ohm resistor
    Upgraded date is 07/03/2020
    Deleted R10, replaced R8, Changed calibration number. Original R8 was drifting in value
    Minor tweeks and a warning note
    ref Gainx1, max input voltage is 2.5 VDC for full scale ***
    ref Gainx8, max input voltage is 0.25 VDC for full scale **
 ** ref SRxxB is bit resolution, ranging from 12 to 18 bits  ***
 ** MCP 3421 has one channel input
 ** MCP 3422 has two channel inputs
 ** MCP 3424 has four channel inputs, from CH1 to Ch4
 * ********************************************************************************************************************
    WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
    DO NOT DO RESISTOR TESTS WITH ONLY THE USB POWER TO THE METER!!
    THAT RESISTOR UNDER TEST REVERSES BIASES THE ARDUINO NANO 5 VOLT REGULATOR
    AND WILL BLOW THE REGULATOR.  A 6.6 VOLT POWER SUPPLY MUST BE CONNECTED
    TO THE METER ANY TIME THE USB PC PORT IS PLUGGED INTO THE ARDUINO NANO
    WHEN CONNECTING A TEST RESISTOR TO THE MICRO OHM METER.
 *  ********************************************************************************************************************
*/
#include <SPI.h>
#include <Wire.h>
#include <MCP342x.h>
#define OLED_RESET 4
#include <Adafruit_SH1106.h>
Adafruit_SH1106 display(OLED_RESET);
MCP342x adc(PIN_FLOAT, PIN_FLOAT);
const int V_Cal = 1166;                      //1166 number is used to calibrate voltage
float R_Cal = 1.005;//1.005R_CAL is the calibration of the meter against a known resistor
#if (SH1106_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SH1106.h!");
#endif
float value;  //define variable
double R5_Ohm ;
float Vx_Ohm;
float Rx_Ohm;
double range1;
double range2;
double range3;
double range4;
float test_resistor;
float Ad_Cnv = 0;
int Ad_In = 0;
void setup()
{
  analogReference(INTERNAL);
  Serial.begin(9600);
  display.begin(SH1106_SWITCHCAPVCC, 0x3C);// initialize 128/64 with the I2C addr 0x3D

  display.setTextSize(3);
  display.setTextColor(WHITE);
  display.clearDisplay();

  display.setCursor(25, 0);
  display.print("uOhm");

  display.setCursor(20, 30);
  display.print("meter");
  display.display();
  delay(1000);
}
void do_R5ohm()              //measure the voltage on 5 Ohm 1% resistor for calculation
{
  adc.creg[CH4].bits = {GAINx8, SR16B, CONTINUOUS, CH4, 1 };
  ConvStatus err = adc.read(CH4, R5_Ohm);                           //Read 5 Ohm Volts
  R5_Ohm  = R5_Ohm * 10.14;        //R5_Ohm variable contains voltage drop on resistor
}
void do_range1()               //following routines runs variable settings on channel 3
{
  adc.creg[CH3].bits = {GAINx8, SR18B, CONTINUOUS, CH3, 1 };
  ConvStatus err1 = adc.read(CH3, range1);                             //Read Rx Volts
  range1 = range1 * R_Cal / R5_Ohm;
}
void do_range2()
{
  adc.creg[CH3].bits = {GAINx1, SR18B, CONTINUOUS, CH3, 1 };
  ConvStatus err2 = adc.read(CH3, range2); //Read Rx Volts             //Read Rx Volts
  range2 = range2 * R_Cal / R5_Ohm;
}
void do_range3()
{
  adc.creg[CH3].bits = {GAINx2, SR14B, CONTINUOUS, CH3, 1 };
  ConvStatus err1 = adc.read(CH3, range3);                             //Read Rx Volts
  range3 = range3 * R_Cal / R5_Ohm;
}
void do_range4()
{
  adc.creg[CH3].bits = {GAINx1, SR12B, CONTINUOUS, CH3, 1 };
  ConvStatus err1 = adc.read(CH3, range4);                             //Read Rx Volts
  range4 = range4 * R_Cal / R5_Ohm;
}
void do_battvolts()
{
  Ad_In = analogRead(7);                                        //show battery voltage
  Ad_Cnv = map(Ad_In, 0, 1023, 0, V_Cal);          //convert to actual voltage reading
  display.setCursor(50, 56);
  display.setTextSize(1);
  display.print("Batt V = ");
  display.print(Ad_Cnv / 100, 2);                            //show two decimal result
  display.setTextSize(2);
}
//*************************************************************************************
//main program starts here
void loop()
{
  display.setTextSize(2);
  display.setTextColor(WHITE);
  do_R5ohm();                                          //run voltage on 5 ohm resistor
  if (R5_Ohm < 0.1)       //if A/D result is less than 0.1, no test resistor is connected
  {
    display.clearDisplay();
    display.setCursor(0, 20);
    display.setTextSize(4);
    display.print("OPEN!");
    display.display();
  }
  else                                          //do the entire resistance check program
  {
    do_R5ohm();
    do_range1();
    do_range2();
    do_range3();
    do_range4();
    // Serial.print ("R5 ");
    // Serial.println (R5_Ohm, DEC);               //send to USB for test_resistor purposes
    test_resistor =  max(range1, range2);        //identify the maximum resistance value
    test_resistor =  max(test_resistor, range3);
    test_resistor =  max(test_resistor, range4);
    if (test_resistor > 2.2)                             //if over 2.2 ohms, show over range on MCP3424 A/D input
    {
      display.clearDisplay();                                                 //over range
      display.setCursor(0, 0);
      display.print("Over");

      display.setCursor(0, 25);
      display.print("Range");
      display.display();
    }
    else
    {
      display.clearDisplay();
      display.setCursor(80, 38);
      display.print("Ohm");                                              //show ohms value
      display.setCursor(0, 38);
      display.print(test_resistor, 4);

      display.setCursor(80, 19);
      display.print("mOhm");
      display.setCursor(0, 19);
      //  Serial.println  (test_resistor, DEC);
      if (test_resistor * 1000 > 999)    //show milliohms result for either xxxx.xx, or xxxx
      {
        display.print(test_resistor * 1000, 0);                       //show milliohms value
      }
      else
      {
        display.print(test_resistor * 1000, 2);
      }
      //  Serial.println (test_resistor);
      if (test_resistor < 0.02)               //test for maximum uOhm digit display
      {
        display.setCursor(80, 0);                              //if under 999999, display it
        display.print("uOhm");
        display.setCursor(0, 0);
        display.print(test_resistor * 1000000, 0);
        do_battvolts();
        display.display();
      }
      else
      {
        display.setCursor(0, 0);
        display.print("OverRange");
        display.display();

      }
    }
  }
}

And the errors in attachment.

Errors.txt (33 KB)

Hi David,

there are a lot of "was not declared in this scope"-messages.

For a real analysis I would have to download and install all the libraries that were "Included" by the #include-commands.

Some reasons that can cause such errors are:

missing closing bracket "}"

So a careful analyse of opening "{" and closing "}" curly parentheses.

Forgot to include another library that is nescessary as the base for a another library.
If you grabbed this code somewhere on the net.
My personal experience with "grabbed somewhere on the internet" code is:

high possability of non-working code. As only a few people seem to do a test on a "naked PC" just containing a standard Arduino-IDE and nothing else and then do a download and compile-test. This would make them stumble about all the extras that they have on their long evolved own programming PC that makes the program compile.

If this is your first project the size is a bit oversized as it uses so many libraries and ifdefs

Me myself I'm something behind a beginner. But not an expert about compiler-error-messages.
So maybe others can chime in.

The compiler reports at the end

exit status 1

'PIN_FLOAT' was not declared in this scope

best regards Stefan

It looks like PIN_FLOAT comes from an MCP3424 library: GitHub - bersch/MCP3424: MCP3424 library for the Arduino and is not defined in the MCP342x library you are trying to use.

Thanks for dropping in and having a go at this.

Curly braces came to mind but I can't see any missing.

The MCP3424 library looks like a problem.

The code that I copied from the originator was written "MCP3424"

But he linked the MCP342x file from Steve Marple.

Will try to install the other and see.