Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
kapraran committed Sep 15, 2020
1 parent a20538c commit 37e4ad6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 13 deletions.
72 changes: 62 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,79 @@
# FreqCountESP
<h1 align="center">
<br>
<img src="./assets/FreqCountESP-logo.png" alt="FreqCountESP" width="128">
<br>
FreqCountESP
<br>
</h1>

## Table of Contents
<h4 align="center">A frequency counter library for esp32</h4>

<p align="center">
<a href="https://img.shields.io/github/v/release/kapraran/FreqCountESP"><img src="https://img.shields.io/github/v/release/kapraran/FreqCountESP"></a>
<a href="https://img.shields.io/github/repo-size/kapraran/FreqCountESP">
<img src="https://img.shields.io/github/repo-size/kapraran/FreqCountESP"
alt="Gitter">
</a>
</p>

### Table of Contents

- [About](#about)
- [Getting Started](#getting_started)
- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

## About <a name="about"></a>

Write about 1-2 paragraphs describing the purpose of your project.
A frequency counter library for esp32. It counts the numbers of pulses on a specified pin during a fixed time frame using native interrupts and timers. It only supports one instance per sketch for now.

## Installation <a name="installation"></a>

## Getting Started <a name="getting_started"></a>
To use this library you have to import it into Arduino IDE as follows:
1. Download or clone this repository as a zip file.
2. Go to "Sketch" > "Include Library" > "Add .ZIP library..." and select the zip file to import it.

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [deployment](#deployment) for notes on how to deploy the project on a live system.
## Usage <a name="usage"></a>

### Installing
#### Include the library in the sketch

Use the arduino library manager or download the latest realease and import it as a zip.
```C++
#include "FreqCountESP.h"
```

## Usage <a name="usage"></a>
#### Initialize the instance

Set which pin to use and the length of the time frame in milliseconds.

```C++
void setup()
{
int inputPin = 14;
int timerMs = 1000;
FreqCountESP.begin(inputPin, timerMs);
}
```

#### Read the frequency

Wait for a new value to become available and read it by calling the `read()` method.

```C++
void loop()
{
if (FreqCountESP.available())
{
uint32_t frequency = FreqCountESP.read();
// Do something with the frequency...
}
}
```

## Credits <a name="credits"></a>

Add notes about how to use the system.
* [FreqCount library for Arduino & Teensy boards](https://www.pjrc.com/teensy/td_libs_FreqCount.html)
* [Frequency Icon](https://www.flaticon.com/free-icon/pulse_597841?term=frequency&page=1&position=2)

## License <a name="license"></a>

Expand Down
Binary file added assets/FreqCountESP-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions examples/FreqCountLcd/FreqCountLcd.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include "FreqCountESP.h"
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27);
LiquidCrystal_I2C lcd(0x27);

int inputPin = 14;
int timerMs = 1000;

void setup()
{
FreqCountESP.begin(inputPin, timerMs);

// setup lcd
lcd.begin(16,2);
lcd.begin(16, 2);
lcd.clear();
lcd.home();
}
Expand Down

0 comments on commit 37e4ad6

Please sign in to comment.