Browse Source

nextio

main
gsd 8 months ago
parent
commit
e34c38f10b
  1. BIN
      .DS_Store
  2. 4
      pipboyIO/next/serialAX.py
  3. 5
      pipboyIO/readme

BIN
.DS_Store

Binary file not shown.

4
pipboyIO/next/serialAX.py

@ -2,6 +2,7 @@ import asyncio
import serial_asyncio import serial_asyncio
import os, subprocess import os, subprocess
import argparse import argparse
import traceback
#5 - 101 - a d #5 - 101 - a d
#4 - xxx #4 - xxx
@ -117,10 +118,12 @@ class Listener(asyncio.Protocol):
self.buffer = lines[-1] self.buffer = lines[-1]
for line in lines[:-1]: for line in lines[:-1]:
print(line)
try: try:
pin, value = line.split("*") pin, value = line.split("*")
pin = int(pin) pin = int(pin)
value = int(value) value = int(value)
print(pin, value)
if pin not in self.store: if pin not in self.store:
self.store[pin] = Pin(pin, value) self.store[pin] = Pin(pin, value)
@ -129,6 +132,7 @@ class Listener(asyncio.Protocol):
self.useX(self.store[pin]()) self.useX(self.store[pin]())
except: except:
traceback.print_exc()
print("Cannot parse") print("Cannot parse")
def useX(self, pin): def useX(self, pin):

5
pipboyIO/readme

@ -1,4 +1,9 @@
sudo apt install xdotool sudo apt install xdotool
sudo apt install python3-pip
#usermode
python3 -m pip install --user --break-system-packages pyserial-asyncio
export DISPLAY=:0 export DISPLAY=:0
xdotool key Return xdotool key Return
... ...

Loading…
Cancel
Save