No project description provided
Project description
cocube
Table of Contents
Installation
pip install cocube
Usage
Save this project(same as Snap!) to your MicroBlocks device.
# pip install -U cocube
from cocube import CoCube
client = CoCube()
found_devices = client.discover(timeout=5)
print("found devices:", found_devices)
client.connect("MicroBlocks QCQ", timeout=3)
client.display_character("c")
while True:
position_x = client.position_x
print(position_x)
ref: Snap! 中的 CoCube 库
Connect multiple devices
from cocube import CoCube
client = CoCube()
found_devices = client.discover(timeout=5)
print("found devices:", found_devices)
# connect all discovered devices
devices = [CoCube(i) for i in found_devices]
for index, device in enumerate(devices):
device.display_character(index)
demo
ref: notebooks
License
cocube
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cocube-0.0.2.tar.gz
(5.0 kB
view hashes)
Built Distribution
cocube-0.0.2-py3-none-any.whl
(3.4 kB
view hashes)