Skip to content

Yielding data from an async task to a chunked response #62

Closed
@adrianblakey

Description

@adrianblakey

How do I yield data to a chunked response from a async routine?

The code reads the adc like this:

async def read_adc(pin: microcontroller.Pin):
    with analogio.AnalogIn(pin) as adc:
        while True:
            local_value = (adc.value * 3.3) / 65536
            await asyncio.sleep(0.1) 

How can the local_value be yield'ed in a chunked response?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions