Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/koeng101/irobotroot

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/koeng101/irobotroot

  • v0.0.0-20240901055905-24690b92c697
  • Source
  • Go
  • Socket score

Version published
Created
Source

irobotroot

GoDoc Go Report Card

irobotroot is a Go package that provides an interface for interacting with iRobot's Root robot using Bluetooth Low Energy (BLE). This package implements the Root Robot Bluetooth Low Energy Protocol, allowing developers to communicate with Root robots using any BLE-capable hardware.

Everything here is based off of the iRobot Root BLE documentation.

Features

  • Full implementation of the Root Robot BLE Protocol
  • Event-driven system for handling robot events and sensor data
  • Concurrent processing of various robot subsystems
  • Support for all Root robot devices (motors, sensors, lights, etc.)

Installation

To install the package, use go get:

go get github.com/koeng101/irobotroot

Usage

Here's a basic example of how to use the package:

package main

import (
    "fmt"
    "github.com/koeng101/irobotroot"
)

func main() {
    // Connect to the Root robot
    robot, err := irobotroot.ConnectToRootRobot()
    if err != nil {
        fmt.Println("Error connecting to Root robot:", err)
        return
    }
    defer robot.Disconnect()
    
    // Start the event listener
    robot.StartEventListener(100)
    defer robot.StopEventListener()
    
    // Drive forward for 100mm
    packet, err := robot.DriveDistance(100)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    
    // Print the response packet
    fmt.Printf("Response: %+v\n", packet)
}

This example demonstrates how to:

  1. Connect to a Root robot using ConnectToRootRobot()
  2. Start the event listener
  3. Send a command to the robot (in this case, to drive forward)
  4. Handle the response
  5. Properly disconnect and stop the event listener when done

For more detailed usage examples and API documentation, please refer to the GoDoc.

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc