Coder Social home page Coder Social logo

foxbuildbell's Introduction

foxbuildbell

Purpose

This is the code for programming the esp8266s used in the button & bell at Fox.Build.

Both the "button" and the "bell" send regular (10s intervals) heartbeat messages to the MQTT server on the /fox/build/heartbeat topic (payload is the nth heartbeat sent since boot).

If the "button" is pushed then a MQTT message is sent out to the topic /fox/build/bell; code prevents mashing down and holding the button continuously by only allowing a retrigger every 5s (default).

If the "bell" receives a 1 on the /fox/build/bell topic, then it pulls pin 5 HIGH for 250ms (default).

Hardware

The "button" is wired to pin 2 of the esp8266 (and uses the internal pullup resistor). The "bell" relay is wired to pin 5 of it's respective esp8266 (goes HIGH on receiving a message).

How to Flash

If you are programming the bell leave //#define ISBUTTON commented out
If you are programming the button uncomment #define ISBUTTON

MQTT messages system responds to:

/fox/build/bell/ring 1 ### ring bell
/fox/build/bell/duration <ms> ### set duration in ms
/fox/build/button/retrigger <ms> ### time before next retrigger

MQTT message system generates:

/fox/build "The button is now online"
/fox/build "The bell is now online"
/fox/build/heartbeat "button #<N>" ### is the n-th heartbeat since the button came online
/fox/build/heartbeat "bell #<N>" ### same for the bell

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.