Giter VIP home page Giter VIP logo

esp32-machine-emulator's Introduction

ESP32 Machine Emulator

The purpose of this package is to enable you to test-drive (TDD) your MicroPython code in an IDE running on your computer. It seems a lot of people are test-driving python, but not many are test-driving MicroPython. That's understandable, since many MicroPython projects are simple, and emulating real hardware in a test environment is difficult.

The typical approach to emulating hardware is to replicate the hardware programming interface (the API). As of this writing, this library emulates a very small slice of the ESP32 API. I don't know if the library will mature. Hopefully I'll either flesh it out, someone else will take over, or a replacement will emerge.

If you are unfamiliar with the benefits of TDD or test-driving python, I encourage you to take some time to Google and learn. I prefer the pytest library over the unittest library that comes with python3, but you are free to test as you choose.

Getting Started

Take a look at the examples folder in the GitHub repository. Like I said, as of this writing, the library emulates a very small slice of the API, so if you don't see an example for something you want to do, the feature is not available. Feel free to contact me or fork the repo and send me a pull request for the feature.

Here is the github repo for this project: https://github.com/tflander/esp32-machine-emulator

Here is the project on PyPi: https://pypi.org/project/esp32-machine-emulator

Note that the examples are only in the GitHub repo, and are not part of the PyPi distribution.

Supported Features

  • Emulating sending a GPIO digital out signal, and verifying the signal value.
  • Extending the time library to support sleep_ns() and sleep_ms()
  • Emulating the read pulse value of an input pin, such as that received by the echo pin of an HCSR04 Ultrasonic Distance Sensor.
  • Full emulation of HCSR04 Ultrasonic Distance Sensor in examples

esp32-machine-emulator's People

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.