Code Monkey home page Code Monkey logo

esp32_tone's Introduction

esp32_tone

This library adds the Arduino tone() and noTone() functions for the ESP32. The library is built that You can use Your existing Arduino code with the ESP32 but also adds some other handy functions.

Setup

  1. Download, unpack and copy this library into the 'libraries' folder in your Arduino sketchbook folder. If the 'libraries' folder doesn't exist, create a new one.

  2. Connect a piezo speaker to pin 15(or any other pin) of Your ESP32 and Ground

  3. Open the example sketch Arduino-compatibility-example and upload it to Your ESP32.

Functions

Arduino-compatible Functions:

This library contains Arduino equivalent functions that You can use with Your ESP32 as they don't work on the ESP32. These are:

tone(int pin, unsigned int frequency)
tone(int pin, unsigned int frequency, unsigned long duration)
noTone(int pin)

They work just as the Arduino functions tone and noTone. For them to work You have to call setCompatibleMode(true) or setCompatibleMode() first (e.g. in setup()).

Otherwise the functions won't do anything!

Other handy functions:

There is currently one enhanced function:

beepForever(int pin, unsigned int frequency, unsigned long toneOnTime, unsigned long toneOggTime, unsigned int repeatTone, unsigned long toneDelay)

esp32_tone's People

Contributors

cedricwritescode avatar

Forkers

pennalarto

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.