Skip to main content

帮助您将小猫板接入您的Python程序

Project description

CatBit包可以帮助您将小猫板接入您的Python程序

示例:

from catbit import CatBit
async def main():
    cb = CatBit()
    def key_handler(keys):
        print('按键状态:', keys)
    cb.setKeyEvent(key_handler)
    await cb.connect()
if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("程序已终止")

运行结果

> python test.py
正在搜索设备...
发现小猫板: CODEMAO_catbit_####
设备地址: C0:##:##:##:##:CE
准备连接...
连接成功!
正在监听设备数据...
按键状态: {'up': False, 'down': False, 'left': False, 'right': False, 'p0': False, 'p1': False, 'p2': True, 'p3': False, 'p4': False}
......

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catbit-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catbit-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file catbit-0.0.1.tar.gz.

File metadata

  • Download URL: catbit-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for catbit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3b5bbf38c6e84b5381d793cc487d8a7eeb7e314f25862c6811835e8ebc1315ab
MD5 ba8b0c8844105290d94a7d2ebb8d87d1
BLAKE2b-256 91e210200c71e47d934ee142b38c226385a1da925f3d33af7b5b17110b0edbbf

See more details on using hashes here.

File details

Details for the file catbit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: catbit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for catbit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cea838e01bfd8c13733bbc333205577d266820b57df502f7af0ae36548e0ba6e
MD5 527b77fd92d7e2ae23f0d1b7c1b30ca2
BLAKE2b-256 5e8ccedfb25c23ec389ec671888b82120d9222cc32237518ed7de4a204feecdf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page