https://github.com/marcodeltutto/analogdiscoverypro
https://github.com/marcodeltutto/analogdiscoverypro
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcodeltutto/analogdiscoverypro
- Owner: marcodeltutto
- Created: 2023-07-28T11:23:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T20:04:09.000Z (almost 2 years ago)
- Last Synced: 2025-03-23T02:28:17.239Z (about 1 year ago)
- Language: Python
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## API for Digilent Analog Discover Pro
- `main.py` is the main API
- `adpro.py` is the digitizer class
- `WF_SDK` contains Digilent's helper functions to interact with the digitizer
### Instructions
- From the PrM server, log in to the digitizer via `ssh -L 8000:localhost:8000 digilent@10.226.35.155`
- Clone this repo, if not done already
- Enter and run the API: `sudo /home/digilent/.local/bin/uvicorn main:app --reload`
On the PrM server, you can control the digitizer via:
- `localhost:8000/lamp_control/on`: turns the flash lamp on
- `localhost:8000/lamp_control/off`: turns the flash lamp off
- `localhost:8000/lamp_frequency/10`: sets the lamp frequency to 10 Hz
- `localhost:8000/digitizer/start_capture`: starts the data acquisition
- `localhost:8000/digitizer/check_capture`: checks if the acquisition if over
- `localhost:8000/digitizer/get_data`: returns the collected data
- For more commands, see `main.py`.
### Run Manually
- From the PrM server, log in to the digitizer via `ssh -L 8000:localhost:8000 digilent@10.226.35.155`
- Clone this repo, if not done already
- Run `python`, then:
```python
from adpro import ADPro
# Instantiate the digitizer class
digitizer = ADPro()
# Turn on the flash lamp (uses the waveform generator)
digitizer.lamp_on()
# Start a digitizer data acquisitio
digitizer.start_capture()
# Check for the acquisition to be completed
while not digitizer.check_capture():
time.sleep(1)
# Turn off the flash lamp
digitizer.lamp_off()
# Retrieve the digitizer data
data = digitizer.get_data()
print(data)
# Close the digitizer
digitizer.close()
```
Check: [Getting Started with the WaveForms SDK](https://digilent.com/reference/test-and-measurement/guides/waveforms-sdk-getting-started) for more details.