goocilloscope

command module
v0.0.0-...-987958a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2021 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

goocilloscope

A ocilloscope writen in GO. Supported serial input, portaudio input.

Install

go get github.com/suutaku/goosilloscope
go build

Usage

As a tool:

Usage: goocilloscope COMMAND [arg...]

A simple ocilloscope writen in Go
               
Commands:      
  source       need specific a signnal source
               
Run 'goocilloscope COMMAND --help' for more information on a command.

As a libray:

	ctx := context.Background()
	conn := connector.NewPortAudio(ctx)
	rd := myrender.NewRender(ctx, 1280, 640, conn)
	rd.Start()

Ohters

serial port default split recive bytes with :,you can set your costom data wash callback like this:

func washData(input []byte) []float32 {

	tmp := strings.Split(string(input), ":")
	res := make([]float32, 0)
	for i := 0; i < len(tmp); i++ {
		tmp64, _ := strconv.ParseFloat(string(tmp[i]), 32)
		res = append(res, float32(tmp64))
	}
	return res
}
conn := connector.NewSerial(ctx, "/dev/usb-serial", 9600)
conn.SetWashCallback(washData)

For implamemt another input source, please see:

$REPO/connector/connector.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
* Connector for emulator, by default, this connector will output a sin wave *
* Connector for emulator, by default, this connector will output a sin wave *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址