Skip to content

Commit 0305518

Browse files
authored
Merge pull request #78 from PayalLakra/main
Updated Documentation of Chords-Python
2 parents 6adb797 + 072fa8c commit 0305518

File tree

1 file changed

+96
-36
lines changed

1 file changed

+96
-36
lines changed

software/chords/chords-python/index.rst

Lines changed: 96 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -62,60 +62,55 @@ Go to tools, select your board, and the correct COM port. Now, hit the upload bu
6262
Opening Chords-Python
6363
*********************
6464

65-
Follow these steps to set up and install Chords-Python:
65+
There are two ways to use Chords-Python:
6666

67-
1. Ensure you have latest version of Python installed.
68-
2. **Download the GitHub repository**:
67+
**A. Using the `chordspy` Python Package (Recommended)**
6968

70-
- You can download the Chords-Python repository from GitHub by visiting the following link: `Chords-Python <https://github.com/upsidedownlabs/Chords-Python/>`_.
71-
- Or, You can clone the repository using Git by running the following command:
69+
**B. Running Scripts Manually from the Repository**
7270

73-
.. code-block:: console
74-
75-
git clone https://github.com/upsidedownlabs/Chords-Python.git
71+
A. Using the chordspy Package
72+
=============================
7673

77-
3. **Create a Virtual Environment**:
78-
79-
A virtual environment allows you to manage dependencies for your project in isolation.
74+
This is the smoothest way to get started. Follow the steps below:
8075

81-
- Open a terminal or command prompt.
82-
- Navigate to the directory where you have cloned the repository.
83-
- Run the following command to create a virtual environment:
76+
1. **Install Python**
77+
Make sure latest version of Python is installed.
8478

85-
.. code-block:: console
86-
87-
python -m venv venv
79+
2. **Create and Activate a Virtual Environment**:
80+
81+
- **On Windows**:
8882

89-
- To activate the virtual environment:
90-
- **On Windows**:
9183
.. code-block:: console
9284
93-
.\venv\Scripts\activate
85+
python -m venv .venv
9486
95-
- **On macOS/Linux**:
96-
.. code-block:: python
97-
98-
source venv/bin/activate
87+
.. code-block:: console
9988
100-
4. **Install the Required Python Libraries**:
89+
.venv\Scripts\activate
10190
102-
Once the virtual environment is activated, you need to install the required libraries for the project.
91+
- **On macOS/Linux**:
10392

104-
- In the terminal or command prompt, run the following command to install the dependencies needed to run the python script listed in the `requirements.txt` file:
93+
.. code-block:: console
94+
95+
python3 -m venv .venv
96+
97+
.. code-block:: console
98+
99+
source .venv/bin/activate
100+
101+
3. **Install the Package**:
105102

106103
.. code-block:: console
107-
108-
pip install -r requirements.txt
109104
110-
- This will install all the necessary Python libraries and dependencies for Chords-Python.
105+
pip install chordspy
111106
112-
5. To launch the Flask server, run the following command :
107+
4. **Launch the Web Interface**:
113108

114-
.. code-block:: python
115-
116-
python app.py
109+
.. code-block:: console
117110
118-
Click on the generated link to open the web interface.
111+
chordspy
112+
113+
A web interface will open where you can connect your device and access applications.
119114

120115
.. figure:: ./media/light-interface.*
121116
:align: center
@@ -129,6 +124,67 @@ Click on the generated link to open the web interface.
129124

130125
Interface in Dark Mode
131126

127+
B. Running Scripts Manually (Alternative)
128+
=========================================
129+
130+
If you prefer running scripts directly (for development, debugging, or customization):
131+
132+
1. **Download the Repository**:
133+
134+
- You can download the Chords-Python repository from GitHub by visiting the following link: `Chords-Python <https://github.com/upsidedownlabs/Chords-Python/>`_.
135+
136+
- Or, you can clone the repository using Git by running the following command:
137+
138+
.. code-block:: console
139+
140+
git clone https://github.com/upsidedownlabs/Chords-Python.git
141+
142+
2. **Create and Activate a Virtual Environment** (if not already):
143+
144+
- **On Windows**:
145+
146+
.. code-block:: console
147+
148+
python -m venv .venv
149+
150+
.. code-block:: console
151+
152+
.venv\Scripts\activate
153+
154+
- **On macOS/Linux**:
155+
156+
.. code-block:: console
157+
158+
python3 -m venv .venv
159+
160+
.. code-block:: console
161+
162+
source .venv/bin/activate
163+
164+
3. **Install Requirements**:
165+
166+
.. code-block:: console
167+
168+
pip install -r requirements.txt
169+
170+
4. **Run the Application**:
171+
172+
Navigate to the `chordspy` folder and run:
173+
174+
.. code-block:: console
175+
176+
python -m chordspy.app # To launch the web interface
177+
python -m chordspy.connection --protocol usb # To start LSL stream via USB
178+
python -m chordspy.connection --protocol ble # To start LSL stream via BLE
179+
python -m chordspy.connection --protocol wifi # To start LSL stream via WiFi
180+
181+
To run any application, open a new terminal:
182+
183+
.. code-block:: console
184+
185+
python chordspy.gui.py # GUI Application
186+
python chordspy.ffteeg.py # EEG with FFT Analysis
187+
132188
Connection
133189
**********
134190

@@ -249,7 +305,7 @@ A GUI window will appear, displaying the real-time ECG signal along with the cal
249305
2. `EMG with Envelope`
250306
======================
251307

252-
.. youtube:: tZud2tc-TGITiDwSQEY2eY&t=23s
308+
.. youtube:: TiDwSQEY2eY
253309

254310
Overview
255311
--------
@@ -323,6 +379,8 @@ A GUI window will appear, displaying the real-time EOG signal along with the Bli
323379
4. `EEG with FFT`
324380
=================
325381

382+
.. youtube:: yVD9KmyZgxA
383+
326384
Overview
327385
--------
328386

@@ -497,6 +555,8 @@ A GUI window will appear that shows the data in real-time.
497555
8. `EOG Keystroke Emulator`
498556
===========================
499557

558+
.. youtube:: ZJmUUtHJj08
559+
500560
Overview
501561
--------
502562

0 commit comments

Comments
 (0)