You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,31 +15,33 @@ Common platforms are support installation from PyPI using:
15
15
16
16
`pip install twinleaf`
17
17
18
-
19
-
## Use
18
+
## Programming
20
19
21
20
Examples of basic usage can be found in the `examples` directory.
22
21
23
-
A console script `itl` is installed to provide an interactive tool for configuring devices. We strongly
24
-
22
+
A console script `itl` is installed to provide an interactive tool for configuring devices as well.
25
23
26
24
## Programming
27
25
28
26
The `twinleaf` module performs metaprogramming to construct an object that has methods that match the RPC calls available on the device. To interact with a Twinleaf CSB current supply, for example:
29
27
30
28
```python
31
29
import twinleaf
32
-
csb = twinleaf.Device('COM1')
30
+
csb = twinleaf.Device('serial://COM1')
33
31
csb.settings.coil.x.current(0.25) # mA
34
32
```
35
33
36
34
To receive data streams from a sensor such as the [Twinleaf VMR vector magnetometer](http://www.twinleaf.com/vector/VMR), use the named streams:
37
35
38
36
```python
39
37
import twinleaf
40
-
vmr = twinleaf.Device()
38
+
vmr = twinleaf.Device('serial://COM1')
41
39
print(vmr.samples.vector(10))
42
40
```
41
+
To find possible tio ports to use run `tio-proxy --enum`. Windows will often output some COMx port such as `serial://COM3`, while Mac OS will output some cu.XXXXX or tty.XXXXX name such as `serial:///dev/cu.usbserialXXXXXX` or `serial:///dev/tty.usbmodemXXXXXX`.
42
+
43
+
If `tio-proxy --enum` does not work try looking at serial ports in the respective OS device manager for active serial ports.
0 commit comments