+/rtos

git clone https://git.julia.blue/+/rtos

Vivek Malneediuntested remote mouse code6e9847b

master
360 B21 linesraw
1#!/usr/bin/python
2
3import sys
4import serial
5import select
6import curses
7
8port = "/dev/ttyACM0"
9if len(sys.argv) > 1:
10    port = sys.argv[2]
11
12screen = curses.initscr()
13screen.refresh()
14
15with serial.Serial(port, 9600) as ser:
16    while True:
17        a = screen.getkey()
18        ser.write(a.encode('utf-8'))
19        if a == 'q':
20            break
21curses.endwin()