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.