tlfong01 wrote: ↑Wed Nov 28, 2018 8:20 amGiving up ESP8266-12 NodeMCU Lua programming for HX711, will use Rpi3B+ MCP23017 Python instead.
So I will suspend ESP8266-12 for now, and wait for ESP8266-32 to resume my project.
In the mean time, I will fall back on Rpi3B+ MCP2307 Python.
Some 3 months ago, I wrote a python program to read DHT22, but found Rpi3B+ I2C (100kHz) too slow for DHT22 and I gave up. Now I am checking out if I2c 100kHz is good enough for HX711.
(Rpi3B+ MCP23017 DHT22 Tests) RE: RELAY MODULE KY-019 5V - tlfong01 2018-Aug-21[/i][/color]
Decoupling Loosely Coupled HX711 from ESP8266
Now that I am no longer using ESP8266 to control HX711, I need to decouple HX711 hardware from ESP8266. Luckily I have been using loosely coupled design for both sofware (mainly using functiona; programming) and hardware modules (functionally separate bread board proto board areas), decoupling modules is an easy job.
Appendix - Loose coupling - Wikipedia
In computing and systems design a loosely coupled system is one in which each of its components has, or makes use of, little or no knowledge of the definitions of other separate components.
Components in a loosely coupled system can be replaced with alternative implementations that provide the same services. Components in a loosely coupled system are less constrained to the same platform, language, operating system, or build environment.
Loose coupling is an architectural principle and design goal in service-oriented architectures;
Computer programming languages having notions of either functions as the core module or functions as objects provide excellent examples of loosely coupled programming. ...
Functional languages have ..., closure, ... See Clojure and Lisp as examples of function programming languages. Object-oriented languages like Smalltalk and Ruby have code blocks, ...
The basic idea is to objectify (encapsulate as an object) a function independent of any other enclosing concept (e.g. decoupling an object function from any direct knowledge of the enclosing object).
See First-class function for further insight into functions as objects, ...