2

I am trying to create an asyncio wrapper around gpiozero's Button.wait_for_press method. This works most of the time but gives Segmentation fault randomly.

import asyncio
from gpiozero import Button


def get_gd_input():
    Button(5).wait_for_press()


async def get_input():
    INPUT = ""

    get_gd_input()
    INPUT = "G"

    print(INPUT)


asyncio.run(get_input())

Is something wrong in the above code?

Pankaj Jangid
  • 524
  • 3
  • 18

0 Answers0