Code Monkey home page Code Monkey logo

scale's Introduction

Scale -- Version 3.0

A configurable dual loadcell scale utilizing the CedarGrove NAU7802 FeatherWing. Code is written in CircuitPython and tested with CircuitPython version 7.3.2.

Mass measurements from two loadcell sensors are processed by the CedarGrove NAU7802 precision ADC FeatherWing and displayed graphically on an Adafruit PyPortal, PyPortal Pynt, PyPortal Titano, or RP2040 Feather + TFT FeatherWing. Each channel's display mass values within the range of the loadcell are displayed in Grams, including negative values. Tare and alarm levels are user-specified and selectively enabled as needed.

Default operational parameters are specified in the scale_defaults.py file in the microcontroller's root directory. Scale’s graphics and touchscreen zones are display size independent. Built-in board size is automatically detected; other displays are user-specified in the scale_defaults.py file. Font sizes do not scale proportionally but adjust somewhat to display size. Tare and alarm settings are stored in the microcontroller's non-volatile memory (NVM) to be recalled upon power-up. To facilitate testing, the code will simulate a missing custom loadcell FeatherWing board.

Pyportal Scale

Touching a tare or alarm icon for one second or less (then released after the first beep) toggles the tare or alarm on/off. Touch and hold the icon until the second beep to set the tare/alarm value with the current Scale measurement. Setting the value will be confirmed with two beeps and an on-screen message; errors are three beeps with an on-screen warning message. The updated tare/alarm values and settings are then stored in NVM. Stored settings will be used the next time the Scale is powered on.

Changed tare/alarm settings will be remembered if power is removed. To clear the current settings and revert to the default tare/alarm settings (as recorded in the scale_defaults.py file), touch and hold the area at the top center of the display.

For testing and compatibility checks, the scale will function without the CedarGrove NAU7802 FeatherWing. Measured values are simulated if the Wing is not connected.

On-screen touch areas (button outlines) can be displayed by changing the debug = True to debug = False in the scale_code.py file.

Pyportal Scale Screenshot

Acknowledgements: Thank you to @siddacious and @foamyguy for educational and very helpful coding examples. Big thanks to @foamyguy for the NVM helper library.

CedarGroveStudios/Scale v3.0

scale's People

Contributors

cedargrovestudios avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scale's Issues

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.