Skip to main content

PythonLib for BEEPBERRY

Project description

BEEPBERRY PYTHON-LIB

This is a Python library for BeepBerry. Currently, it includes functionalities for key, RGB light, and screen, encompassing three types of hardware. It can be easily installed via pip and simplifies the process of driving these hardware components.

Install instructions

From pip:

pip install --upgrade beepberry-lib

Examples

import beepberry

#rgb
import time
bb=beepberry.BEEPBERRY()
bb.rgb(0,0,100)   #r,g,b   form 0 to 255 
time.sleep(1)
bb.rgb_off()

#button  See: https://gpiozero.readthedocs.io/en/stable/recipes.html#button 
#button.is_pressed  button.wait_for_press() button.when_presse  button.when_released
from gpiozero import Button
from signal import pause

def say_hello():
    print("Hello!")

def say_goodbye():
    print("Goodbye!")

button = bb.button

button.when_pressed = say_hello
button.when_released = say_goodbye

pause()

#scr
from PIL import Image, ImageDraw, ImageFont
bb=beepberry.BEEPBERRY()
scr=bb.lcd

font = ImageFont.truetype("yahei.ttf", 24)  # load font

scr.text(xy=(10,10),text='beepberry',fill='red',font=font)
bb.show() 

bb.show_pic('test.jpg')   #show pics directly

#battery
vbat=bb.battery()

KEYMAP

 *                  BBQ20KBD PMOD KEYBOARD LAYOUT
 *
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |      |          |BR     ↑TPY-       |           |       |
 *  | Ctrl |   PgDn   |←TPX- BL(HOME)TPX+→|   PgUp    | MENU  |
 *  |      |          |       ↓TPY+       |           |       |
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |                                                         |
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |#     |1    |2   |3   |(   |   )|_   |    -|    +|      @|
 *  |  Q   |  W  | E  | R  | T  |  Y |  U |  I  |  O  |   P   |
 *  |      |     |PgDn|PgUp|   \|UP  |^   |=    |{    |}      |
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |*     |4    |5   |6   |/   |   :|;   |    '|    "|    ESC|
 *  |  A   |  S  | D  | F  | G  |  H |  J |  K  |  L  |  BKSP |
 *  |     ?|     |   [|   ]|LEFT|HOME|RGHT|V+   |V-   |DLT    |
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |      |7    |8   |9   |?   |   !|,   |    .|    `|       |
 *  |LFTALT|  Z  | X  | C  | V  |  B |  N |  M  |  $  | ENTER |
 *  |      |   K+|  K-|   °|   <|DOWN|>   |MENU |Vx   |       |
 *  +------+-----+----+----+----+----+----+-----+-----+-------+
 *  |            |0   |TAB                |     |             |
 *  | LEFT_SHIFT | ~  |       SPACE       |RTALT| RIGHT_SHIFT |
 *  |            |  Kx|                  &|     |             |
 *  +------------+----+-------------------+-----+-------------+

Change Log

[0.0.2] - 2023-08-13

  • Add battery.

[0.0.1] - 2023-08-09

  • First commit.

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

beepberry-lib-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

beepberry_lib-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file beepberry-lib-0.0.2.tar.gz.

File metadata

  • Download URL: beepberry-lib-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for beepberry-lib-0.0.2.tar.gz
Algorithm Hash digest
SHA256 26869bacc58e87ade7bf7dc1966e63b88d81b48e24ae631261b30dd455577f43
MD5 85f54cb65449d23261ef5e6afb266ab1
BLAKE2b-256 49a454d02a025459685f0ec874e27393ea7fe53edf7d7f420281051d51a1b80b

See more details on using hashes here.

File details

Details for the file beepberry_lib-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for beepberry_lib-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9ed3c2f91dcc087d49356ebed5e3645a77ee7b91ce0d988b3a084cbe30281e99
MD5 5dc14a74a1f8eb0f841f92f1a5bc72d2
BLAKE2b-256 4fafabc1d4a21fa58697716d9bf95532e40c39cf680c44113862f0096881b7cb

See more details on using hashes here.

Supported by

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