protocal

package
v0.0.0-...-0cd537b Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: MIT * * Copyright (C) 2020 jet tsang zeon-git. All Rights Reserved.

SPDX-License-Identifier: MIT * * Copyright (C) 2020 jet tsang zeon-git. All Rights Reserved.

Index

Constants

View Source
const (
	FrameHeader byte = 0x55
	// Send an instruction to all servos
	BroadcastIdent int = 0xFE // 254
)

Variables

This section is empty.

Functions

func CheckSum

func CheckSum(checksum []byte) uint8

Types

type Proto

type Proto struct {
	Network io.ReadWriter
}

func New

func New(network io.ReadWriter) *Proto

func (*Proto) ReadData

func (p *Proto) ReadData(ident int, instruction byte) ([]byte, error)

ReadData reads a slice of n bytes from the control table of the given servo ID. Use the bytesToInt function to convert the output to something more useful.

func (*Proto) WriteData

func (p *Proto) WriteData(ident int, instruction byte, data []byte) error

Jump to

Keyboard shortcuts

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