GithubHelp home page GithubHelp logo

tinkerforge's Introduction

tinkerforge

GoDoc

A go implementation of the tinkerforge protocol.

Install

go get github.com/noxer/tinkerforge

Example

The tinkerforge package can be used directly:

package main

import (
    "github.com/noxer/tinkerforge"
)
  
func main() {
    // Open a new connection to brickd (we ignore the error)
    t, _ := tinkerforge.New("localhost:4223")
    defer t.Close()

    // Call function 1 of brick(let) 123456, don't expect an answer and send three integers (again we ignore the error)
    p, _ := tinkerforge.NewPacket(123456, 1, false, int32(42), int32(43), int32(44))

    // Send the packet
    t.Send(p)
}

There are high level functions in the "ledstrip"package:

package main

import (
    "github.com/noxer/tinkerforge"
    "github.com/noxer/tinkerforge/ledstrip"
)
  
func main() {
    // Open a new connection to brickd (we ignore the error)
    t, _ := tinkerforge.New("localhost:4223")
    defer t.Close()

    // Wrap with the ledstrip controller and set the bricklet ID to 123456 (error ignored)
    l, _ := ledstrip.New(t, 123456)

    // Set the color of the first LED to red (if it appears in blue you need to set the color mapping)
    l.SetRGBValues(0, []ledstrip.Color{ledstrip.Color{255, 0, 0}})
}

tinkerforge's People

Contributors

noxer avatar stwa avatar xperimental avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

stwa xperimental

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.