https://github.com/borud/mcc-usb-1808
Go library for using the MCC USB-1808X High Speed, High Precision Simultaneous USB DAQ Deviec
https://github.com/borud/mcc-usb-1808
Last synced: 16 days ago
JSON representation
Go library for using the MCC USB-1808X High Speed, High Precision Simultaneous USB DAQ Deviec
- Host: GitHub
- URL: https://github.com/borud/mcc-usb-1808
- Owner: borud
- License: apache-2.0
- Created: 2026-05-10T10:35:38.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-17T16:43:36.000Z (26 days ago)
- Last Synced: 2026-05-17T18:48:49.913Z (26 days ago)
- Language: Go
- Size: 1.66 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mcc-usb-1808

[](https://pkg.go.dev/github.com/borud/mcc-usb-1808/v4)
This library helps you write applications that interface with the Measurement [Computing Corporation USB 1808 and 1808X](https://digilent.com/shop/mcc-usb-1808x-high-speed-high-precision-simultaneous-usb-daq-device/) DAQs.
## Prerequisites
- Go 1.24+
- libusb 1.0 (`brew install libusb` on macOS, `apt install libusb-1.0-0-dev` on Debian/Ubuntu)
## Installation
```sh
go get github.com/borud/mcc-usb-1808/v4
```
## Quick Start
```go
package main
import (
"fmt"
"log"
"github.com/borud/mcc-usb-1808/v4/device"
)
func main() {
dev, err := device.Open()
if err != nil {
log.Fatal(err)
}
defer dev.Close()
if err := dev.Init(); err != nil {
log.Fatal(err)
}
// Scan 4 analog channels at 10 kHz.
cfg := device.ScanConfig{
Channels: []device.ChannelConfig{
{Index: 0, Type: device.ChannelTypeAnalog, Range: device.BP10V, Mode: device.Differential},
{Index: 1, Type: device.ChannelTypeAnalog, Range: device.BP10V, Mode: device.Differential},
{Index: 2, Type: device.ChannelTypeAnalog, Range: device.BP10V, Mode: device.Differential},
{Index: 3, Type: device.ChannelTypeAnalog, Range: device.BP10V, Mode: device.Differential},
},
Rate: 10000,
Count: 100,
}
h, err := dev.CreateScan(cfg)
if err != nil {
log.Fatal(err)
}
if err := h.Start(); err != nil {
log.Fatal(err)
}
for chunk := range h.Chunks() {
fmt.Printf("received %d bytes (%d frames starting at %d)\n",
len(chunk.Data), chunk.FrameCount, chunk.FrameStart)
}
h.Stop()
}
```
## CLI Tool
A command-line tool is included for quick testing. Install it with:
```sh
go install github.com/borud/mcc-usb-1808/v4/cmd/daq@latest
```
Example usage:
```sh
daq info # Device info
daq blink --count 5 # Blink LED
daq capture --channels analog --rate 10k # Capture all 8 analog channels
daq capture --channels ain0-ain3:bp10v:diff,dio # Mixed channel spec
daq bench --channels analog --rate 200k --duration 10 # Benchmark throughput
```
## Documentation
See the [docs/](docs/README.md) directory for the full manual:
- [Getting Started](docs/getting-started.md)
- [Analog Input](docs/analog-input.md)
- [Calibration](docs/calibration.md)
- [Capture](docs/capture.md)
- [CLI Tool](docs/cli.md)
- [High-Rate Capture](docs/high-rate-capture.md)
- [Errors](docs/errors.md)
## If you use this
If you use this it would be really nice if you dropped me a line to let me know, or sent a PR so I can include a link to your application below.