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
- TiKit Board Information
- The MSP-EXP430FR5994 board found in the TiKits will be referred to as "TiKit Board."
- PyPI Page
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
- Install the Python library:
pip install ti_kit_board_communication
- Import the Python library in your code:
from ti_kit_board_communication.main import TiKitBoard
- 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:
- Created the
TiKitBoardobject using:
st.session_state.board = TiKitBoard(port="/dev/cu.usbmodem1103")
st.session_state.board.connect_with_retries()
- 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")
- Saved the time remaining on the timer using:
board.write_key_to_storage("timer_length", int(value))
- 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.
- Use the following code to send information to the computer in the
loop()orsetup()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_characterparameter in theTiKitBoard()constructor to change the default ending charcter.
Images
Web app
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747a63389014185bd94a6012dbfdfd4c8a45e07d0e43c1e93fb3f92c72106d7b
|
|
| MD5 |
5fe82e94389307ef4f5175b88d0eb1aa
|
|
| BLAKE2b-256 |
5813d7a1b738487d993a92f3baa4e965c7b4ee81a8e49eab0e49f8fc748bb23e
|
File details
Details for the file ti_kit_board_communication-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ti_kit_board_communication-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.2 cpython/3.13.0 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d3e9123beef291c7f8cfcc56c55d82855cf834cca07e1986c8991cceaf2c3a5
|
|
| MD5 |
2daf952689e220f88945452101163ea9
|
|
| BLAKE2b-256 |
7a0c97174d881c0d4444bf39d790e0dc29b2a2245d800fa0a212bb3a10dac201
|