Skip to content

A simulation of an Arduino VISA device connected to a small circuit

Notifications You must be signed in to change notification settings

davidfokkema/nsp2visasim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nsp2visasim

This package contains a simulation of an Arduino VISA device connected to a small circuit to measure the voltage versus current characteristics of a LED. It is created for a programming course in the physics and astronomy joint degree bachelor programme at the Vrije Universiteit and the University of Amsterdam. Students use the actual device and circuit while on campus but can use this simulation to finish up their work at home.

Usage

In your controller code, replace:

import pyvisa

with:

try:
    from nsp2visasim import sim_pyvisa as pyvisa
except ModuleNotFoundError:
    import pyvisa

Then, if you use Poetry, add it to your existing project with:

$ poetry add --dev nsp2visasim

If you don't use Poetry, install nsp2visasim with:

$ pip install nsp2visasim

You now appear to have an additional VISA device connected to your system. If an actual Arduino is attached, you can choose to open the simulation or the actual Arduino by selecting the correct port name. Your code should work exactly the same as before.

A session might look like this:

$ diode list
The following devices are connected to your computer:

ASRL/dev/cu.URT1::INSTR
ASRL/dev/cu.URT2::INSTR
ASRL/dev/cu.Bluetooth-Incoming-Port::INSTR
ASRL/dev/cu.usbmodem14501::INSTR
ASRL::SIMLED::INSTR

$ diode info -d SIMLED
Device identification: Simulated Arduino VISA firmware (LED experiment)

$ diode measure -d SIMLED -v 2.5 -n 10
Measured current through diode: 3.048 +- 0.030 mA @ 1.805 +- 0.011 V.

About

A simulation of an Arduino VISA device connected to a small circuit

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages