Skip to content

feat: compatibility with Windows #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions PSL/packet_handler.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def listPorts(self):
available = []
for i in range(256):
try:
s = serial.Serial(i)
available.append(i)
portname = 'COM' + str(i)
s = serial.Serial(portname)
available.append(portname)
s.close()
except serial.SerialException:
pass
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,41 @@ For the main GUI (Control panel), you can run Experiments from the terminal.

$ Experiments


### Installing PSLab Python library without GUI

If a user wants to install the python library to have a command line interface to execute commands, he can do so by simply installing the dependencies and latest Python versions.

#### Windows

##### Dependencies

* Python 2.7 or Python 3.7 [Link to Official download page](https://www.python.org/downloads/windows/)
* Pip
* PySerial
* Numpy

##### Instructions

1. Install the latest Python version on your computer and configure `PATH` variable to have both Python installation directory and the Scripts directory to access `pip` tools.
2. Open up command prompt and execute the command `pip install pyserial && pip install numpy` to install the required dependencies.

##### Validate

1. Download the PSLab-Python library from this repository and extract it to a directory.
2. Browse in to that directory and create a new file named `test-pslab-libs.py`
3. Paste the following code into that file and save it.

```
from PSL import sciencelab
I = sciencelab.connect()
capacitance = I.get_capacitance()
print(capacitance)
```

4. Plug in the PSLab device and check if both the LEDs are turned on.
5. Now run this file by typing `python test-pslab-libs.py` on a command prompt and observe a numerical value printed on the screen along with PSLab device version and the port it is connected to.

-----------------------

#### Development Environment
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy