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" to something quicker if you want the UI or serial connection to be checked more frequently.
  1. Use the following code to send information to the computer in the loop() or setup() function:
Serial.write("<YOUR_STRING><YOUR_ENDING_CHARCTER>");
  • Your ending character should be the same on the board and computer side. Use the special_ending_character parameter in the TiKitBoard() constructor to change the default ending charcter.

Images

Image of web app.

Web app

Image of the board and all connected components for the scheduled timing prototype.

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.1.tar.gz (4.9 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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ti_kit_board_communication-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 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.1.tar.gz
Algorithm Hash digest
SHA256 747a63389014185bd94a6012dbfdfd4c8a45e07d0e43c1e93fb3f92c72106d7b
MD5 5fe82e94389307ef4f5175b88d0eb1aa
BLAKE2b-256 5813d7a1b738487d993a92f3baa4e965c7b4ee81a8e49eab0e49f8fc748bb23e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ti_kit_board_communication-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3e9123beef291c7f8cfcc56c55d82855cf834cca07e1986c8991cceaf2c3a5
MD5 2daf952689e220f88945452101163ea9
BLAKE2b-256 7a0c97174d881c0d4444bf39d790e0dc29b2a2245d800fa0a212bb3a10dac201

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