Skip to main content

This project creates a web app using the streamlit Python library to interact with the TiKit board visually.

Project description

Scheduled Timing Prototype Web App for ENGR 13100 @ Purdue

Important Links & Info

This project creates a web app using the streamlit Python library to interact with the TiKit board visually.

The goal of this project was to create a web app for users to interact with the TiKit Board. The web app, built with the streamlit Python library, allows users to turn the TiKit Board's built-in LED on and off. Users can also set timers with a maximum time limit of one day. The timer is displayed on the four-digit display. After the timers have completed, a sound will play, and the TiKit Board's built-in LED will turn on.

The pyserial Python library was used to establish a connection between the TiKit Board and the connected computer. This project works by sending and receiving messages over the established serial port connection.

How to install this library

  1. Install the Python library:
  • pip install ti_kit_board_communication
  1. Import the Python library in your code:
  • from ti_kit_board_communication.main import TiKitBoard
  1. Read the project docs here:

Example Usage: Scehduled Timing Prototype

Check out example/ui.py in this Github repo to see some example usage.

Goal:

The goal of the scheduled timing prototype was to create a timer-based intelligent lighting system that combines sunlight sensing with automated LED supplementation. The web app and TiKit Board are shown below.

Key points:

  1. Created the TiKitBoard object using:
st.session_state.board = TiKitBoard(port="/dev/cu.usbmodem1103")
st.session_state.board.connect_with_retries()
  1. Turned the board's LED on and off using:
if st.session_state.light_state:
    board.send_message(b"light_on")
else:
    board.send_message(b"light_off")
  1. Saved the time remaining on the timer using:
board.write_key_to_storage("timer_length", int(value))
  1. Updated the UI and checked the serial connection every second using:
@st.fragment(run_every="1s")
  • Change "1s" if you want the UI or serial connection to be checked more frequently

Images

Logo

Web app

Logo

TiKit Board

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

ti_kit_board_communication-1.0.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ti_kit_board_communication-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file ti_kit_board_communication-1.0.0.tar.gz.

File metadata

  • Download URL: ti_kit_board_communication-1.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.13.0 HTTPX/0.28.1

File hashes

Hashes for ti_kit_board_communication-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0eaeca0519fea1a17e5b3aece3e50e4b8f50c5e465f5db5cdbd4db03ee482ec4
MD5 f2e39357c206132989cee367478db6cb
BLAKE2b-256 87034b22a4d3e8f938c0fc9c59645d9af14729ab4da39197241de82fd698b8ff

See more details on using hashes here.

File details

Details for the file ti_kit_board_communication-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ti_kit_board_communication-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e68b158a4fa3e6a61e0a6dbaaa8bf43842f1d8f212545b78c0c345872809bc0
MD5 994054a0baa12345a6d5cb694d3cc373
BLAKE2b-256 067dc0c33ef1b8bdb1832b0dbec186a565228a862735b61f8827345415c23e9a

See more details on using hashes here.

Supported by

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