-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.py
28 lines (22 loc) · 834 Bytes
/
code.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# You must add a gamepad HID device inside your boot.py file
# in order to use this example.
# See this Learn Guide for details:
# https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/hid-devices#custom-hid-devices-3096614-9
import supervisor
# Client configuration/APIs are in the config.py module
import inputs
import serial
# Do initial setup
inputs.init()
serial.init()
from report import report
# Disable auto reload
supervisor.runtime.autoreload = False
while True:
# First try to read simulated input values via commands from serial:
if not serial.read_cmd_from_serial():
# Only read & report our physical inputs if no simulated input command received
inputs.update_all()
report()