Code Monkey home page Code Monkey logo

a21's Introduction

a21 — Arduino bits

pins.hpp

Wrappers for Arduino pins that can be passed to templates. Flixibility of simple pin numbers with speed of direct port writes.

debouncer.hpp

A class helping with debouncing logic, handy when you handle a pushbutton or a switch.

dht22.hpp

Compact driver for DHT22 (AM2302) temperature sensor: does not require floating point numbers.

ec11.hpp

This is a little library that helps to work with EC-11 style of rotary encoders on Arduino. The dependancy on Arduino functions is very small, so it can be easily ported to other platforms. See ec11.hpp for the docs and examples folder for a little demo.

What exactly is EC-11?

It's a family of devices that look like potentiometers and allow your microcontroller to receive rotary input. They work as push button too. These are very cheap and available everywhere, but can provide very handy interface for your microcontroller projects.

Here is one of mine:

EC-11 Species Photo

And this is its pinout:

EC-11 Pinout Diagram

Two pins are for the internal push button (D and E); the other two (A and B) provide rotation signal relative to the third pin (C), which is normally connected to the ground. The output pins A and B should be pulled high which can be done using internal pull up resitors of Arduino.

Note that rotary encoders can have more outputs and different purposes, but we assume only two outputs here and a simple case of manual control.

Also note that when the encoder is rotated, then lines A and B are mechanical connected to pin C (ground) in certain order, which allows to detemine the direction of rotation. This mechanical switching generates noise. It can be filtered out, but for simple projects the noise can be ignored.

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.