Skip to content

ElectroBlocks/python

Repository files navigation

ElectroBlocks

ElectroBlocks is a Python library for communicating with Arduino-based educational hardware using a custom serial protocol. It simplifies control of servos, RGB LEDs, LCD screens, and more—especially in block-based coding environments like Blockly.

Features

  • Auto-detects the first available Arduino Uno or Mega over USB
  • Sends config: and control commands to the Arduino firmware
  • Waits for "System:READY" and "DONE_NEXT_COMMAND" to sync logic
  • Supports digital write, RGB LEDs, LCD printing, and servo control

Installation

pip install electroblocks

Example

from electroblocks import ElectroBlocks

eb = ElectroBlocks()
eb.config_servo(5)
eb.move_servo(5, 90)
eb.config_rgb(3, 5, 6)
eb.set_rgb(255, 128, 0)
eb.config_lcd()
eb.lcd_print(0, 0, "Hello")
eb.lcd_clear()
eb.digital_write(13, 1)
eb.close()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •