{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Getting Started with MonoDAQ\n", "\n", "We will walk you through the basic usage of python API, like how to:\n", "\n", "1. setup channels, \n", "2. fetch values, \n", "3. plot it, \n", "4. add a math channel and \n", "5. run it as a real-time scope with a rising edge trigger.\n", "\n", "## Wiring\n", "\n", "In this demo we shall activate an analog, a digital one and a PWM channel, then wire the \n", "PWM output (from pin 4) back to the digital input (pin 1)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## 1. Setup Channels\n", "\n", "First we call the `reset()` function to begin from the start, then we configure the channels, and print out the configuration. The configuration could also be stored in a 1-wire memory attached to a connector that is automatically reloaded when the connector with such a memory is detected.\n", "\n", "When directly accessing the parameters, you may want to use the Parameters view of the IDM, which will help you browse through the device data structure." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "text/html": [ "
pin | function | type | range | rate [Hz] | min | max | offset | set | value | unit |
---|---|---|---|---|---|---|---|---|---|---|
DI1 | Digital Input | TTL | 5 V | 100000 | 0 | 5 | --- | --- | 5 | V |
2 | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
V1+ | Voltage Input | Single Ended | 2V | 50000 | -0.1 | 2.0 | --- | --- | 0.0397 | V |
PWM4 | PWM | TTL | 5 V | 1200 | 0.00 | 0.83 | --- | 0.25 | --- | ms |
5 | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
6 | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
7 | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
8 | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
GND | OneWire | --- | --- | --- | --- | --- | --- | --- | --- | |
IO | --- | --- | --- | --- | --- | --- | --- | --- | --- | |
CUR+ | Off | --- | --- | --- | --- | --- | --- | --- | --- | |
CUR- | --- | --- | --- | --- | --- | --- | --- | --- | --- | |
GND | --- | --- | --- | --- | --- | --- | --- | --- | --- | |
PWR | Off | --- | --- | --- | --- | --- | --- | --- | --- |
\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"
\\n\"+\n",
" \"\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"
\\n\"+\n \"\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"
\\n\"+\n",
" \"\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"
\\n\"+\n \"\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"
\\n\"+\n",
" \"\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"
\\n\"+\n \"