File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (C) 2020 Pico Technology Ltd. See LICENSE file for terms.
3+ #
4+ # USBDRDAQ SCOPE BLOCK MODE EXAMPLE
5+ # This example opens a UsbDrDaq driver device, sets up the scope channel and a trigger then collects a single block of data.
6+ # This data is then plotted as mV against time in ns.
7+
8+ import ctypes
9+ import time
10+ from picosdk .usbDrDaq import usbDrDaq as drDaq
11+ import numpy as np
12+ import matplotlib .pyplot as plt
13+ from picosdk .functions import adc2mV , assert_pico_ok
14+
15+ # Create chandle and status ready for use
16+ status = {}
17+ chandle = ctypes .c_int16 ()
18+
19+ # Opens the device
20+ status ["openunit" ] = drDaq .UsbDrDaqOpenUnit (ctypes .byref (chandle ))
21+ assert_pico_ok (status ["openunit" ])
22+
23+ # Disconnect the scope
24+ # handle = chandle
25+ status ["close" ] = drDaq .UsbDrDaqCloseUnit (chandle )
26+ assert_pico_ok (status ["close" ])
27+
28+ # Display status returns
29+ print (status )
You can’t perform that action at this time.
0 commit comments