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: 0

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