Coder Social home page Coder Social logo

capacitive-sensor-serial-client's Introduction

Capacitive Sensor Serial Client

I'm using this in a two-MCU system. One device is a control box using an ESP32. A separate "button" is a capacitive sensor that's AVR-based (a Pro Micro 16 / atmega32u4 board).

This is the code that runs on the capacitive sensor/button. It sends data using one of its pins back to the ESP32 where processing is done, and the control box does its stuff.

The AVR side relies on a couple of my libs:

  • MagicSerialChunk: https://github.com/jaggzh/MagicSerialChunk -- Takes ->add() calls and sends them over serial, with leading and trailing magic sequences for some simple (but not 100% reliable) data integrity checking. (The magic sequences have to be correct on the client and the server, as does the bundle/chunk length or that chunk is ignored).
  • PrintHero: https://github.com/jaggzh/PrintHero -- Some convenience defines for printing/serial printing with less typing. (like sp() dbsp() (for debug), etc.)

And a couple of libs from Arduino IDE's library:

  • CapacitiveSensor: Simple capacitive sensor with one pin charging up the other, through a resistor, along with some foil/copper-tape/plate as the cap sensor plate on the receiving pin. See their docs for it: https://playground.arduino.cc/Main/CapacitiveSensor/
  • TXOnlySerial: (fork at https://github.com/jaggzh/TXOnlySerial) -- This just has the RX code stripped from the Arduino software serial lib, so you don't need both pins. Since we're only sending from our AVR to the ESP32, this allows that. (Normal serial is fine, just give a dummy/unused pin for RX.)

capacitive-sensor-serial-client's People

Contributors

jaggzh avatar

Watchers

 avatar

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.