예제 #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
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)
예제 #3
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
예제 #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
                   broker='io.adafruit.com',
                   username=secrets['aio_username'],
                   password=secrets['aio_key'],
                   network_manager=wifi)

mqtt_client.on_connect = connected
mqtt_client.on_disconnect = disconnected
mqtt_client.on_message = message

# Connect the client to the MQTT broker.
print('Connecting to MQTT BROKER...')
mqtt_client.connect()

while True:
    # Poll the message queue forever (BLOCKING!!)
    mqtt_client.loop_forever()

    #pybadger.auto_dim_display(delay=10) # Remove or comment out this line if you have the PyBadge LC
    if pybadger.button.a:
        pybadger.show_business_card(image_name="Blinka.bmp",
                                    name_string="Ayan Pahwa",
                                    name_scale=2,
                                    email_string_one="iayanpahwa",
                                    email_string_two="@gmail.com")
    elif pybadger.button.b:
        pybadger.show_qr_code(data="https://codeNsolder.com")
    elif pybadger.button.start:
        pybadger.show_badge(name_string="AYAN",
                            hello_scale=2,
                            my_name_is_scale=2,
                            name_scale=3)
예제 #7
0
파일: code.py 프로젝트: mlibby/pybadge
def show_badge():
    badge.show_badge(
        hello_font="Aller-14.bdf",
        hello_scale=1,
        my_name_is_font='Aller-14.bdf',
        my_name_is_scale=1,
        name_string="Mikey",
        name_scale=1,
        name_font="Warehouse-40.bdf",
    )


show_badge()

while True:
    badge.auto_dim_display(delay=30)
    if badge.button.a:
        badge.show_business_card(
            image_name="m_libby.bmp",
            name_string="Michael C. Libby",
            name_scale=1,
            name_font="Aller-14.bdf",
            email_string_one="m@",
            email_string_two="mlibby.com",
        )
    elif badge.button.b:
        badge.show_qr_code(data="https://mlibby.com")
    elif badge.button.start:
        show_badge()
예제 #8
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")