animatedledstrip

package module
v0.0.0-...-1f1eec2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

README

Build Status godoc codecov

AnimatedLEDStrip Client Library for Go

This library allows a Go client to communicate with an AnimatedLEDStrip server.

Using the Library in a Project

The library can be downloaded with:

go get github.com/AnimatedLEDStrip/client-go

Creating an ALSHttpClient

To create a HTTP client, run ALSHttpClient(ipAddress).

import als "github.com/AnimatedLEDStrip/client-go"

client := als.ALSHttpClient("10.0.0.254")

Communicating with the Server

This library follows the conventions laid out for AnimatedLEDStrip client libraries, with the following modifications:

  • Function names and struct variables are capitalized because of how Go denotes exported identifiers
  • DegreesRotation and RadiansRotation are constructors for the rotation struct, which uses the RotationType variable to track which type it is
  • AbsoluteDistance and PercentDistance are constructors for the distance struct, which uses the DistanceType variable to track which type it is
  • ColorContainer and PreparedColorContainer have a ContainerType variable that works similarly to above, though the structs are different
  • The colors parameter for an AnimationToRunParams struct only accepts ColorContainers
  • The default parameter for an AnimationParameter hasn't been figured out yet

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ALSHttpClient

func ALSHttpClient(ipAddress string) *aLSHttpClient

func AbsoluteDistance

func AbsoluteDistance(x float64, y float64, z float64) *distance

func AnimationToRunParams

func AnimationToRunParams(animation string, colors []*colorContainer, id string, section string,
	runCount int, intParams map[string]int, doubleParams map[string]float64, stringParams map[string]string,
	locationParams map[string]*location, distanceParams map[string]*distance, rotationParams map[string]*rotation,
	equationParams map[string]*equation) *animationToRunParams

func ColorContainer

func ColorContainer(colors []int) *colorContainer

func DegreesRotation

func DegreesRotation(xRotation float64, yRotation float64, zRotation float64, rotationOrder []string) *rotation

func Equation

func Equation(coefficients []float64) *equation

func Location

func Location(x float64, y float64, z float64) *location

func PercentDistance

func PercentDistance(x float64, y float64, z float64) *distance

func PreparedColorContainer

func PreparedColorContainer(colors []int, originalColors []int) *preparedColorContainer

func RadiansRotation

func RadiansRotation(xRotation float64, yRotation float64, zRotation float64, rotationOrder []string) *rotation

func RunningAnimationParams

func RunningAnimationParams(animationName string, colors []*preparedColorContainer, id string, section string,
	runCount int, intParams map[string]int, doubleParams map[string]float64, stringParams map[string]string,
	locationParams map[string]*location, distanceParams map[string]*distance, rotationParams map[string]*rotation,
	equationParams map[string]*equation, sourceParams *animationToRunParams) *runningAnimationParams

func Section

func Section(name string, pixels []int, parentSectionName string) *section

func StripInfoFromJson

func StripInfoFromJson(data string) (*stripInfo, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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