Newbie to programming.Trying a frequency counter project as seen in a YouTube video.The program won't compile giving me the error message :Freqcount.h File not found , but I can see the file in the Arduino directory.Using a Nano board and other sketches does compile and download .What could be wrong.The IDE is updated.
Thank you
Post the code.
Post the complete error message.
In code tags.
Hello Chris1960
Chris1960:
error message :Freqcount.h File not found , but I can see the file in the Arduino directory.
How have you install the library Freqcoun ?
Regards,
bidouilleelec
Yes ,I have installed the Freqcount library.
Here is the code
/*
- Arduino Macro Frequency Counter
- learnelectronics
- 27 AUG 2017
- learnelectronics - YouTube
- arduino0169@gmail.com
- NOTES: Signal must be logic level
- Input pin is D5
- No analogWrite() on 3, 9, 10, 11
*/
#include <Wire.h> //I2C library for the OLED
#include <Adafruit_SSD1306.h> //OLED driver
#include <FreqCount.h> //FreqCount library for you know...counting frequencies
//find it here: GitHub - PaulStoffregen/FreqCount: Measures the frequency of a signal by counting the number of pulses during a fixed time.
#define OLED_RESET 4 //it's a thing
Adafruit_SSD1306 display(OLED_RESET); //create instance of the SSD1306 called display
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //begin the OLED @ hex addy )x3C
display.display(); //show the buffer
delay(2000); //bask in the glory of LadyAda
display.clearDisplay(); //enough basking
FreqCount.begin(1000); //start counting 1,2,3,4...
}
void loop() {
if (FreqCount.available()) { //if the code if working
float count = FreqCount.read(); //create float var called count and populate it with current frequency count
float period = (1/count); //create float var called period and populate it with the inverse of the frequency
display.clearDisplay(); //always clear the display first
display.setTextSize(1); //smallest text size
display.setTextColor(WHITE); //my only choice, really
display.setCursor(0,0); //cursor to upper left
display.println("Arduino Freq. Counter"); //print heading to buffer
display.println("------- ----- -------"); //print some pretty line to buffer
display.println(""); //skip a line
display.print("Freq: "); //print the name of the function to buffer
display.print(count); //print the actual counted frequency to buffer
display.println("Hz"); //print units to buffer & drop down 1 line
display.print("Period: "); //print the name of the fuction to buffer
display.print(period*1000); //print the period of signal in milliseconds to buffer
display.print("mS"); //print the units to buffer
display.display(); //SHOW ME THE BUFFER!!!!
}
} //That is all, carry on.
Chris1960:
Yes ,I have installed the Freqcount library.
You misunderstand. You were asked, "HOW have you installed" the library, not "have you installed".
I downloaded it from Github then copied and paste it in the Arduino folder.
Did you mean the Arduino/libraries folder, in a new folder called "FreqCount"?
Please remember to use code tags when posting code.
Thank you for your reply.
I found that the library needed to be installed.
I've done that and now I get the error Adafruit_SSD1306 does not name a type
Can you assist please?
Can you post your code, in code tags, and all of your error messages?
Chris1960:
I get the error Adafruit_SSD1306 does not name a type
Can you assist please?
HOW have you install the library Adafruit_SSD1306 ?
Regards,
bidouillelec
Your compiles here with Adafruit_GFX and Adafruit_SSD1306 installed.
Regards,
bidouilleelec
bidouilleelec:
HOW have you install the library Adafruit_SSD1306 ?Regards,
bidouillelec
I cannot quite remember how I installed this library.
Can you tell me the proper procedure please.
Please accept my apologies for reading your reply incorrectly.
Thank you
Chris1960:
I cannot quite remember how I installed this library.
Can you tell me the proper procedure please.
Please accept my apologies for reading your reply incorrectly.
Thank you
Libraries have different installation procedures. You should check the instructions that came with the library.
Where do I find the instructions please.
I have told you which one
Chris1960:
Where do I find the instructions please.
I have told you which one
That is quite a large website
Hello Chris1960,
Chris1960:
I cannot quite remember how I installed this library.
Can you tell me the proper procedure please.
Please accept my apologies for reading your reply incorrectly.
Thank you
Apologies accepted
The way I installed Adafruit_GFX and Adafruit_SSD1306 :
In menu Tools>Manage Librairies....
In field "Filter your search" I wrote SDD1306
then chose Adafruit SSD1306 by Adafruit
then click on Install
Same way for Adafruit_GFX
Filter with GFX
......
It worked for me.
Regards,
bidouillelec
bidouilleelec:
Your compiles here with Adafruit_GFX and Adafruit_SSD1306 installed.Regards,
bidouilleelec
I don't understand what you are saying here
Chris1960:
I don't understand what you are saying here
Your code compiles here on my PC with Adafruit_GFX and Adafruit_SSD1306 newly installed.
Regards,
bidouilleelec