Coder Social home page Coder Social logo

Comments (3)

arkhipenko avatar arkhipenko commented on May 13, 2024 1

You guys are go-o-o-d! It works like a charm. Thank you. 32 is a decent number of buttons for what I need to do. Thanks for the VPIN_MAX_NUM tip.
I can't believe I didn't just test the "write V*" option prior to creating this issue! Could have discovered this by myself.

from lib-python.

arkhipenko avatar arkhipenko commented on May 13, 2024

Right now I am "solving" this like illustrated below, but it is not elegant.

@blynk.handle_event('write V1')
def write_virtual_pin_handler1(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V2')
def write_virtual_pin_handler2(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V3')
def write_virtual_pin_handler3(pin, value):
    virtual_pin_handler_all(pin, value)
    
@blynk.handle_event('write V4')
def write_virtual_pin_handler4(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V5')
def write_virtual_pin_handler5(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V6')
def write_virtual_pin_handler6(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V7')
def write_virtual_pin_handler7(pin, value):
    virtual_pin_handler_all(pin, value)

@blynk.handle_event('write V8')
def write_virtual_pin_handler9(pin, value):
    virtual_pin_handler_all(pin, value)


    
def virtual_pin_handler_all(pin, value):
    global logger
    ...

from lib-python.

antohaUa avatar antohaUa commented on May 13, 2024

Hi Anatoli!
We have global capture for multiple pins
Please see example: https://github.com/blynkkk/lib-python/blob/master/examples/07_tweet_and_logging.py

@blynk.handle_event('write V*')
will capture write events from virtual pins 0-32, but if needed you can change hardcoded MAX allowed value inside lib VPIN_MAX_NUM

Hope this is what you are looking for. If no - just ping me additionally )).

from lib-python.

Related Issues (20)

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.