stuff
This commit is contained in:
parent
796b37bff6
commit
0133760174
2 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ class button:
|
||||||
self.pi = pi
|
self.pi = pi
|
||||||
self.gpio = gpio
|
self.gpio = gpio
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
self.pi.set_glitch_filter(self.gpio, 1000)
|
||||||
async def start(self):
|
async def start(self):
|
||||||
await self.pi.set_mode(self.gpio, asyncpio.INPUT)
|
await self.pi.set_mode(self.gpio, asyncpio.INPUT)
|
||||||
await self.pi.set_pull_up_down(self.gpio, asyncpio.PUD_UP)
|
await self.pi.set_pull_up_down(self.gpio, asyncpio.PUD_UP)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ def wheel_handler(dir):
|
||||||
def button_test(*args):
|
def button_test(*args):
|
||||||
print(args)
|
print(args)
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.create_task(disp.write(1, args))
|
loop.create_task(disp.write(2, args))
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
pi = asyncpio.pi()
|
pi = asyncpio.pi()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue