## Package for Bitblock-Mini
### example
```
tests 폴더 내부의 파일을
python3 test_led.py 로 실행
pip3로 설치해야함...
```
#### 콘트롤 모드
```
#-*-coding:utf-8-*-
from pybbmini import *
# 연결
board = BBBoard('COM18', 57600)
# ------------------------------------------
# DISPLAY
# ------------------------------------------
board.display.show(Symbol.NUM_5)
board.display.show(Symbol.CHAR_H)
symbol = '11011:11011:11011:11011:11111'
board.display.symbol(symbol)
symbol = Symbol("01010:"
"01010:"
"01010:"
"11111:"
"11111")
board.display.show(symbol)
board.display.color(Color.RED)
delay(1000)
board.display.color(Color.GREEN)
delay(1000)
board.display.color(Color.BLUE)
delay(1000)
board.display.clear()
# ------------------------------------------
# BUTTON
# ------------------------------------------
print(board.buttonA.isPressed())
print(board.buttonB.isPressed())
print(board.buttonAB.isPressed())
# ------------------------------------------
# BUZZER
# ------------------------------------------
board.buzzer.melody()
board.buzzer.tone(Note.C4, 2000)
tune = ["C4:4", "D4:4", "E4:4", "C4:4", "C4:4", "D4:4", "E4:4", "C4:4", "E4:4", "F4:4", "G4:8", "E4:4", "F4:4", "G4:8"]
board.buzzer.play(tune)
# ------------------------------------------
# TOUCH
# ------------------------------------------
board.touch0.isTouched()
board.touch1.isTouched()
board.touch2.isTouched()
# ------------------------------------------
# DigitalWrite
# ------------------------------------------
board.digitalWrite(Pin.P3, 1)
board.digitalWrite(Pin.P3, 0)
# ------------------------------------------
# DigitalRead
# ------------------------------------------
val = board.digitalRead(Pin.P0, PinMode.INPUT_PULLUP)
print(val)
# ------------------------------------------
# AnalogWrite
# ------------------------------------------
board.analogWrite(Pin.P3, 0)
# ------------------------------------------
# AnalogRead
# ------------------------------------------
val = board.analogRead(Pin.P4)
print(val)
# ------------------------------------------
# Servo
# ------------------------------------------
servo = Servo()
servo.attach(board, Pin.P3)
servo.move(100)
# ------------------------------------------
# Ultrasonic 미실장
# ------------------------------------------
us = Ultrasonic()
us.attach(board, Pin.P3, Pin.P0)
print(us.distance())
# ------------------------------------------
# Board Close
# ------------------------------------------
board.close()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/devdio/bbmini-python.git",
"name": "pybbmini",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "Bitblock32,bbmini,Bitblock,Bitblock-Mini",
"author": "devdio",
"author_email": "kei.devdio@gmail.com",
"download_url": "",
"platform": null,
"description": "## Package for Bitblock-Mini\r\n\r\n### example\r\n```\r\ntests \ud3f4\ub354 \ub0b4\ubd80\uc758 \ud30c\uc77c\uc744\r\npython3 test_led.py \ub85c \uc2e4\ud589\r\n\r\npip3\ub85c \uc124\uce58\ud574\uc57c\ud568...\r\n```\r\n\r\n\r\n#### \ucf58\ud2b8\ub864 \ubaa8\ub4dc\r\n\r\n```\r\n#-*-coding:utf-8-*-\r\nfrom pybbmini import *\r\n\r\n# \uc5f0\uacb0 \r\nboard = BBBoard('COM18', 57600)\r\n\r\n# ------------------------------------------\r\n# DISPLAY\r\n# ------------------------------------------\r\nboard.display.show(Symbol.NUM_5)\r\n\r\nboard.display.show(Symbol.CHAR_H)\r\n\r\nsymbol = '11011:11011:11011:11011:11111'\r\nboard.display.symbol(symbol)\r\n\r\nsymbol = Symbol(\"01010:\"\r\n \"01010:\"\r\n \"01010:\"\r\n \"11111:\"\r\n \"11111\")\r\nboard.display.show(symbol)\r\n\r\nboard.display.color(Color.RED)\r\ndelay(1000)\r\n\r\nboard.display.color(Color.GREEN)\r\ndelay(1000)\r\n\r\nboard.display.color(Color.BLUE)\r\ndelay(1000)\r\n\r\nboard.display.clear()\r\n\r\n# ------------------------------------------\r\n# BUTTON\r\n# ------------------------------------------\r\nprint(board.buttonA.isPressed())\r\nprint(board.buttonB.isPressed())\r\nprint(board.buttonAB.isPressed())\r\n\r\n# ------------------------------------------\r\n# BUZZER\r\n# ------------------------------------------\r\nboard.buzzer.melody()\r\nboard.buzzer.tone(Note.C4, 2000)\r\n\r\ntune = [\"C4:4\", \"D4:4\", \"E4:4\", \"C4:4\", \"C4:4\", \"D4:4\", \"E4:4\", \"C4:4\", \"E4:4\", \"F4:4\", \"G4:8\", \"E4:4\", \"F4:4\", \"G4:8\"]\r\nboard.buzzer.play(tune)\r\n\r\n# ------------------------------------------\r\n# TOUCH\r\n# ------------------------------------------\r\nboard.touch0.isTouched()\r\nboard.touch1.isTouched()\r\nboard.touch2.isTouched()\r\n\r\n# ------------------------------------------\r\n# DigitalWrite\r\n# ------------------------------------------\r\nboard.digitalWrite(Pin.P3, 1)\r\nboard.digitalWrite(Pin.P3, 0)\r\n\r\n# ------------------------------------------\r\n# DigitalRead\r\n# ------------------------------------------\r\nval = board.digitalRead(Pin.P0, PinMode.INPUT_PULLUP)\r\nprint(val)\r\n\r\n# ------------------------------------------\r\n# AnalogWrite\r\n# ------------------------------------------\r\nboard.analogWrite(Pin.P3, 0)\r\n\r\n# ------------------------------------------\r\n# AnalogRead\r\n# ------------------------------------------\r\nval = board.analogRead(Pin.P4)\r\nprint(val)\r\n\r\n\r\n# ------------------------------------------\r\n# Servo\r\n# ------------------------------------------ \r\nservo = Servo()\r\nservo.attach(board, Pin.P3)\r\nservo.move(100)\r\n\r\n# ------------------------------------------\r\n# Ultrasonic \ubbf8\uc2e4\uc7a5\r\n# ------------------------------------------ \r\nus = Ultrasonic()\r\nus.attach(board, Pin.P3, Pin.P0)\r\nprint(us.distance())\r\n\r\n\r\n# ------------------------------------------\r\n# Board Close\r\n# ------------------------------------------\r\n board.close()\r\n\r\n\r\n```\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python Library For Bitblock-Mini",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/devdio/bbmini-python.git"
},
"split_keywords": [
"bitblock32",
"bbmini",
"bitblock",
"bitblock-mini"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7d7c70fa826e58a5fbc272eba2b996de38bcd898bf4ed699f0912ec2bb6a0a11",
"md5": "3675fb8883a7a42f788e7b0391fff3e7",
"sha256": "02b4518b39b23d1fd63ea26d11390b10500919541f001b8333ddd8fe7101ada3"
},
"downloads": -1,
"filename": "pybbmini-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3675fb8883a7a42f788e7b0391fff3e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14133,
"upload_time": "2023-08-02T01:22:17",
"upload_time_iso_8601": "2023-08-02T01:22:17.798400Z",
"url": "https://files.pythonhosted.org/packages/7d/7c/70fa826e58a5fbc272eba2b996de38bcd898bf4ed699f0912ec2bb6a0a11/pybbmini-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-02 01:22:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "devdio",
"github_project": "bbmini-python",
"github_not_found": true,
"lcname": "pybbmini"
}