コード例 #1
0
from adafruit_pybadger import PyBadger

pybadger = PyBadger()

pybadger.show_badge(name_string="Blinka",
                    hello_scale=2,
                    my_name_is_scale=2,
                    name_scale=3)

while True:
    pybadger.auto_dim_display(delay=10)
    if pybadger.button.a:
        pybadger.show_business_card(image_name="Blinka.bmp",
                                    name_string="Blinka",
                                    name_scale=2,
                                    email_string_one="blinka@",
                                    email_string_two="adafruit.com")
    elif pybadger.button.b:
        pybadger.show_qr_code(data="https://circuitpython.org")
    elif pybadger.button.start:
        pybadger.show_badge(name_string="Blinka",
                            hello_scale=2,
                            my_name_is_scale=2,
                            name_scale=3)
コード例 #2
0
ファイル: code.py プロジェクト: gmackie/pyBadge
from adafruit_pybadger import PyBadger

pybadger = PyBadger()

pybadger.auto_dim_display(delay=10, movement_threshold=20)

first_display = True

while True:
    if pybadger.button.a:
        pybadger.show_business_card(image_name="supercon.bmp",
                                    name_string="gmackie",
                                    name_scale=1,
                                    email_string_one="*****@*****.**",
                                    email_string_two="https://gmac.io/")
    elif pybadger.button.b:
        pybadger.show_qr_code(data="https://wobscale.website")
    elif pybadger.button.start or first_display:
        pybadger.show_badge(name_string="gmackie",
                            hello_scale=2,
                            my_name_is_scale=2,
                            name_scale=2)
        first_display = False
コード例 #3
0
ファイル: main.py プロジェクト: seandoyle/HackProjects
from adafruit_pybadger import PyBadger
display_name = "Your Name Here"
pybadger = PyBadger()

pybadger.show_badge(name_string=display_name,
                    hello_scale=2,
                    my_name_is_scale=2,
                    name_scale=2)

while True:
    pybadger.auto_dim_display(
        delay=10)  # Remove or comment out this line if you have the PyBadge LC
    try:
        if pybadger.button.a:
            pybadger.show_business_card(image_name="ccds_logo_160x160.bmp")
        elif pybadger.button.b:
            pybadger.show_qr_code(data="https://www.ccds.io/")
        elif pybadger.button.start:
            pybadger.show_badge(name_string=display_name,
                                hello_scale=2,
                                my_name_is_scale=2,
                                name_scale=2)
    except Exception as ex:
        print(ex)
コード例 #4
0
from adafruit_pybadger import PyBadger

pybadger = PyBadger()

while True:
    pybadger.show_badge(hello_scale=2, my_name_is_scale=2, name_scale=3)
    pybadger.auto_dim_display()

    if pybadger.button.a:
        pybadger.show_business_card(image_name="Blinka.bmp")
    elif pybadger.button.b:
        print("b B")
    elif pybadger.button.start:
        print("b start")
    elif pybadger.button.select:
        pybadger.show_qr_code()
コード例 #5
0
from adafruit_pybadger import PyBadger

pybadger = PyBadger()

pybadger.auto_dim_display(delay=30)

first_display = True

while True:
    if pybadger.button.a:
        pybadger.show_business_card(image_name="qrcode.bmp",
                                    name_string="Changeme in code.py",
                                    name_scale=1,
                                    email_string_one="*****@*****.**",
                                    email_string_two="https://hackaday.io/")
    elif pybadger.button.b:
        pybadger.show_qr_code(data="https://hackaday.io/superconference/")
    elif pybadger.button.start or first_display:
        pybadger.show_badge(name_string="SuperCon",
                            hello_scale=2,
                            my_name_is_scale=2,
                            name_scale=2)
        first_display = False
コード例 #6
0
from adafruit_pybadger import PyBadger

pybadger = PyBadger()

pybadger.show_badge(name_string="Jason", hello_scale=1, hello_font="fonts/Noto-18.bdf",my_name_is_scale=2, name_scale=3)

while True:
    pybadger.auto_dim_display(delay=10)
    if pybadger.button.a:
        pybadger.show_business_card(image_name="pics/face.bmp", name_scale=2)
    elif pybadger.button.b:
        pybadger.show_business_card(image_name="pics/vcard.bmp", name_scale=2)
    elif pybadger.button.start:
        pybadger.show_badge(name_string="Jason", hello_scale=1, hello_font="fonts/Noto-18.bdf",my_name_is_scale=2, name_scale=3)
    elif pybadger.button.up:
        pybadger.show_qr_code(data="https://www.choptanktransport.com")