Giter VIP home page Giter VIP logo

pslab-python's Introduction

PSLab Python Library

The Python library for the Pocket Science Lab from FOSSASIA.

Build Status Gitter Codacy Badge Mailing List Twitter Follow

This repository hosts the python library for communicating with the Pocket Science Lab open hardware platform (PSLab). This can be installed on a Linux or Windows system. Using this library you can communicate with the PSLab using simple Python code. The Python library is also used in the PSLab desktop application as a backend component. The goal of PSLab is to create an Open Source hardware device (open on all layers) and software applications that can be used for experiments by teachers, students and scientists. Our tiny pocket lab provides an array of instruments for doing science and engineering experiments. It provides functions of numerous measurement tools including an oscilloscope, a waveform generator, a frequency counter, a programmable voltage, current source and even a component to control robots with up to four servos. The website is at: https://pslab.io

Buy

Communication

Installation

To install PSLab on Debian based GNU/Linux system, the following dependencies must be installed.

Dependencies

  • Python 3.6 or higher Link to Official download page
  • Pip   Support package installer
  • NumPy   For numerical calculations
  • PySerial   For device connection
  • iPython-qtconsole   Optional

Note: If you are only interested in using PSLab as an acquisition device without a display/GUI, only one repository pslab-python needs to be installed. If you like a GUI, install the pslab-desktop app and follow the instructions of the Readme in that repo.

How To Install on Linux

As root (or with sudo):

# pip install git+https://github.com/fossasia/pslab-python@master

Done!

How to Install on Windows

Step 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. In Windows, Python is installed in C: drive by default. We can set $PATH by opening the Environment variables dialog box by following the steps below:

  1. [Right click on My Computer]
  2. Select "Properties"
  3. Open "System Properties"
  4. Click "Advanced" tab
  5. Click "Environment Variables" button
  6. Look for "PATH" in "System Variables" section and click on it and press "Edit" button
  7. To the end of "Variable value" text box, append "C:\Python34\;C:\Python34\Scripts\;" (without quotes and 34 may differ depending on the python version installed. It could be 35, 37 ...)
  8. Click "OK" twice to save and move out from path windows

Step 2: Open up command prompt and execute the following commands to install the required dependencies.

$ pip install pyserial
$ pip install numpy

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)
  1. Plug in the PSLab device and check if both the LEDs are turned on.
  2. 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.

How to Setup the Development Environment

To set up the development environment, install the packages mentioned in dependencies. For building GUI's you can use Qt Designer or create a frontend using any other compatible technology. The PSLab desktop app is using Electron for example.

How to Build the Documentation Website

First install sphinx by running following command

pip install -U Sphinx

Then go to pslab/docs and run the following command

$ make html

License

The library is free and open source software licensed under the GPL v3. The copyright is owned by FOSSASIA.

pslab-python's People

Contributors

wavicles avatar bessman avatar jithinbp avatar mariobehling avatar cloudypadmal avatar viveksb007 avatar hpdang avatar bhadreshpsavani avatar pipe-runner avatar cweitat avatar fragm3 avatar akarshan96 avatar cclauss avatar orangecms avatar cynddl avatar neel1998 avatar shivam7-1 avatar igorwilbert avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.