GithubHelp home page GithubHelp logo

s-light / circuitpython_nonblocking_serialinput Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 115 KB

CircuitPython helper library to handle serial user input in an nonblocking way.

License: MIT License

Python 100.00%
circuitpython library circuitpython-library serial userinput

circuitpython_nonblocking_serialinput's Introduction

Introduction

Documentation Status Discord Build Status Code Style: Black

CircuitPython helper library to handle serial user input in an nonblocking way.

Dependencies

This helper library depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install nonblocking_serialinput

Or the following command to update an existing version:

circup update

Usage Example

import nonblocking_serialinput as nb_serialin
my_input = nb_serialin.NonBlockingSerialInput()
while True:
    my_input.update()
    input_string = my_input.input()
    if input_string is not None:
        my_input.print(input_string)

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

For information on building library documentation, please check out this guide.

circuitpython_nonblocking_serialinput's People

Contributors

s-light avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

circuitpython_nonblocking_serialinput's Issues

static status / input line

TODO:

  • implement status line
  • implement echo

this needs heavy control sequence usage.
and maybe a custom print function...

circup requiremetns

if you try to install this with circup

$ circup install nonblocking_serialinput 
Found device at /media/stefan/CIRCUITPY, running CircuitPython 8.0.5.
A newer version of CircuitPython (8.1.0) is available.
Get it here: https://circuitpython.org/board/adafruit_feather_esp32s3_reverse_tft
Searching for dependencies for: ['nonblocking_serialinput']
WARNING:
        circuitpython_ansi_escape_code is not a known CircuitPython library.
Ready to install: ['nonblocking_serialinput']

it fails as the required library is just named ansi_escape_code

Requesting support for 'data' serial console

Hey @s-light ! Thank you for this library. I have been using with Rpi pico and it works great. I was hoping you could add support for the second serial console that usb_cdc provides: usb_cdc.data. This allows me to send serial commands on data console, while keep the default console for debugging. Currently I am using this as a workaround:

import usb_cdc
import nonblocking_serialinput as nb_serialin

my_input = nb_serialin.NonBlockingSerialInput(serial=usb_cdc.data)

But the above requires me to import usb_cdc. If this is the way you envisioned then we can close the issue request, but I feel the user shouldn't have to re-import usb_cdc

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.