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
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)
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()
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)
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
except Exception as e: print("failed to fetch stats") print(e) pass show_badge() while True: pybadger.auto_dim_display( delay=10) # Remove or comment out this line if you have the PyBadge LC if pybadger.button.a: board.DISPLAY.brightness = 1 show_wildcat() elif pybadger.button.b: board.DISPLAY.brightness = 1 pybadger.show_qr_code( data="https://github.com/estranged42/pybadge-reinvent-2019") elif pybadger.button.start: board.DISPLAY.brightness = 1 show_badge() elif pybadger.button.right: board.DISPLAY.brightness = 1 aws_announcements() elif pybadger.button.up: update_aws_count(1) aws_announcements() elif pybadger.button.down: update_aws_count(-1) aws_announcements()
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)
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()
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")