Skip to main content

HydraKit — biblioteca Python

Biblioteca Python para controlar o firmware HydraKit por USB serial em Arduino Uno R3 / ATmega328P.

1. Requisitos

  • Python 3.9 ou superior
  • Arduino Uno R3 / Nano ATmega328P com o firmware compatível gravado
  • Firmware respondendo OK,MAKERKIT,1.0.0 ao comando HELLO
  • Cabo USB com transmissão de dados

2. Instalar em modo de desenvolvimento

Abra o terminal do VS Code na pasta extraída, onde está pyproject.toml, e execute:

python -m pip install -e .

Se o comando python não funcionar, use o caminho completo do Python instalado, por exemplo:

& "$env:LOCALAPPDATA\Programs\Python\Python311\python.exe" -m pip install -e .

A biblioteca instala pyserial como dependência.

3. Exemplo: piscar D13

Execute:

python examples/blink_d13.py

O programa detecta a porta serial, valida a placa com HELLO e pisca D13. Pressione Ctrl+C para interromper.

4. Exemplo mínimo

from hydrakit import HydraKit

with HydraKit() as board:
    print(board.port)
    board.pin_mode(13, "OUTPUT")
    board.digital_write(13, 1)
    board.digital_write(13, 0)

5. Comandos disponíveis

  • board.connect() — conectar à placa
  • board.close() — fechar conexão
  • board.ping() — testar comunicação
  • board.capabilities() — ler capacidades do firmware
  • board.pin_mode(pin, "OUTPUT" | "INPUT" | "PULLUP")
  • board.digital_write(pin, 0 ou 1)
  • board.digital_read(pin)
  • board.analog_read(0) ou board.analog_read("A0")
  • board.pwm(pin, duty) — PWM em D3, D5, D6, D9, D10, D11
  • board.tone(pin, frequency)
  • board.no_tone(pin)
  • board.read_all() — leituras digitais e analógicas em dicionário

6. Notas importantes

  • O firmware atual usa o identificador OK,MAKERKIT,1.0.0 apesar de o projeto se chamar HydraKit. A biblioteca espera exatamente essa resposta.
  • D0 e D1 ficam reservados para comunicação serial.
  • No firmware atual, DWRITE exige que o pino tenha sido configurado antes com pin_mode(pin, "OUTPUT").
  • READALL lê os pinos mesmo que não estejam configurados como entrada; confira o modo elétrico antes de conectar circuitos.
  • A abertura da porta pode reiniciar o Uno. A biblioteca espera 2 segundos antes de testar HELLO.
  • Se aparecer erro de acesso à porta, feche o Monitor Serial da Arduino IDE e outros programas que possam estar usando a COM.
  • Não conecte 12 V diretamente aos pinos do Arduino. Use drivers adequados para relés, motores e outras cargas.

Metadata

Release files for hydrakit 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydrakit 1.0.0
File Size Uploaded Provenance Actions
hydrakit-1.0.0.tar.gz 5.2 kB Without provenance Details for hydrakit-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hydrakit 1.0.0
File Interpreter ABI Platform Actions
hydrakit-1.0.0-py3-none-any.whl Python 3 none any Details for hydrakit-1.0.0-py3-none-any.whl

Total release size: 10.9 kB

Release files / hydrakit-1.0.0.tar.gz

Download URL hydrakit-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e2fb9a0c9f3a4b75fc2e76a4bb45dcacb50ab863f07deb669d659ed4bd4ba5a3
BLAKE2b-256 checksum
How to use checksums
fc371f42785a3916db3d67a876ba9fff95d7e90c608d7a60f8a1d332f7afa274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / hydrakit-1.0.0-py3-none-any.whl

Download URL hydrakit-1.0.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca3c88cb56591332d06aeedc6f7b4d6a1f4e89eba154d8bd3bd2ab2856de8e29
BLAKE2b-256 checksum
How to use checksums
036d6b4171617e337477751364a339e52306d9f0f83fa505d497e42daa8fb1d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for hydrakit 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page