Undefined reference to setup and loop

Hey all, I am new to arduino and very frustrated and stuck. I simply need this code to read the capitance value C and inductance value L, it does this by using the formulas in the code. I am getting weird syntax if anyone could help, I would greatly appreciate it! Note- i'm not too concerned with LCD stuff yet that code can be ignored for now.
My code:

#include <avr/interrupt.h>
#include <binary.h>
#include <HardwareSerial.h>
#include <pins_arduino.h>

#include <Arduino.h>
#include <wiring_private.h>
#include <math.h>
#include <Arduino.h>
#include <EEPROM.h>
#include <LiquidCrystal.h>

//#include <FreqCounter/FreqCounter.h>


float pinD3;
const int pinRS = 3;
const int pinEn = 4;
const int pinD4 = 13;
const int pinD5 = 5;
const int pinD6 = 7;
const int pinD7 = 9;
const int pinBACKLIGHT = 10;

const int pinLCMode = 2;

float F0 = 493827;//348000 was refrence mine is 493827
const float Cth = 470 * 1e-12; //theoretical 1000pF I have 470pF
const float Lth = 221 * 1e-6; //theoretical 221uH

boolean backLightOn = false;
boolean dispFreq = false;
float l0 = Lth;
float c0 = Cth;
float fin = 3;
float freq = 0;




LiquidCrystal lcd(pinRS, pinEn, pinD4, pinD5, pinD6, pinD7);

void Setup()
{
  pinMode(fin, INPUT); //fin is digital pin 3
}

void Loop()
{
 freq = digitalRead(fin); //freq = fin pinD3
    dispFreq;
    float f = (float) freq;
    float v = 0;

}
 
float calcV(float f, float VRef) {
    float v = 0;

    v = ((F0 * F0) / (f * f) - 1.0) * VRef;

    return v;

   

}



     float calcC(float f, float c0) {
     
           float C = calcV(f, c0);
            return C;
     }
            
             float calcL(float f, float lo){
      
           float L = calcV(f, l0);
            return L;
}

my syntax errors:

C:\Users\nickm\AppData\Local\Temp\cc85Ni1m.ltrans0.ltrans.o: In function main': C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to setup'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Uno.

They're called setup and loop, not Setup or Loop.

This won't give an error, but it won't do anything useful either.
You need a pair of ( )

No, you're giving weird semantics.

they should be all lower case: setup, loop

Your formatting and excess white space makes the code hard to read.

What's wrong with the formatting? I agree that the extra line spacing is a bit unorthodox but it has nothing to do with the question.

OP: Proper coding style says that all functions are named using lower-case or camelCase. A blank line between functions is OK.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.