Metadata-Version: 2.1
Name: beepberry-lib
Version: 0.0.2
Summary: PythonLib for BEEPBERRY
Home-page: https://github.com/Xgorobot/XGO-PythonLib
Author: jd3096
Author-email: 1091329318@qq.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.0
Description-Content-Type: text/markdown


# 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.

![](beepberry.jpg)


## Install instructions 

From pip:

```
pip install --upgrade beepberry-lib
```

## Examples

```python
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.



