Edit

Share via


GoPiGo Class

Definition

A GoPiGo3 class for a GoPiGo3 Dexter Industries robot kit

public class GoPiGo : IDisposable
type GoPiGo = class
    interface IDisposable
Public Class GoPiGo
Implements IDisposable
Inheritance
GoPiGo
Implements

Constructors

GoPiGo(SpiDevice, Byte, Boolean, Boolean)

Create a GoPiGo class

Fields

GroveSensor

The 2 Grove Sensor

Properties

EncoderTicksPerRotation

Set or get a specific ticks per rotation for the encoder

GoPiGo3Info

The GoPiGo3 information including hardware, firmware, ID and Manufacturer

GoPiGoVoltage

Get the real 5V and Battery/VCC voltages

GroveSensor

The 2 Grove Sensor

MotorGearRatio

Set or get a specific gear ratio for the encoder

MotorTicksPerDegree

Return the number of ticks per degree

SpiAddress

Get the SPI address of GoPiGo3. By default, it is 8

Methods

Dispose()

Reset everything

GetBoard()

Read the 20 characters of GoPiGo3 board name

GetFirmwareVersion()

Read the firmware version

GetGroveAnalog(GrovePort)

Get a grove input pin 12-bit raw ADC reading

GetGrovePwmFrequency(GrovePort, UInt32)

Set grove PWM frequency

GetGroveState(GrovePort)

Get a grove input pin state

GetGroveValue(GrovePort)

Get a grove port value

GetGroveVoltage(GrovePort)

Get a grove input pin analog voltage

GetHardwareVersion()

Read the hardware version

GetId()

Read the 128 bit GoPiGo3 hardware serial number

GetIdHex()

Read the 128 bit GoPiGo3 hardware serial number

GetManufacturer()

Read the 20 characters of GoPiGo3 manufacturer name

GetMotorEncoder(MotorPort)

Read a motor encoder in degrees

GetMotorStatus(MotorPort)

Read a motor status

GetVoltage5V()

Get the 5v circuit voltage

GetVoltageBatteryVcc()

Get the battery voltage

GroveI2cStart(GrovePort, Byte, Byte[], Byte)

Start an I2C transaction

GroveI2cTransfer(GrovePort, Byte, Byte[], Byte)

Conduct an I2C transaction

OffsetMotorEncoder(MotorPort, Int32)

Offset a motor encoder

SetGroveMode(GrovePort, GroveInputOutput)

Set grove analog digital pin mode as input or output

SetGrovePwmDuty(GrovePort, Double)

Set grove output pin PWM

SetGroveState(GrovePort, Boolean)

Set grove output pin low or high

SetGroveType(GrovePort, GroveSensorType)

Set grove type

SetLed(Byte, Color)

Set the led color

SetMotorDps(MotorPort, Int32)

Set the motor target speed in degrees per second

SetMotorLimits(MotorPort, Byte, Int32)

Set the motor speed limit

SetMotorPosition(MotorPort, Int32)

Set the motor target position in degrees

SetMotorPositionKD(MotorPort, Byte)

Set the motor target position KD constant If you set KP higher, the motor will be more responsive to errors in position, at the cost of perhaps overshooting and oscillating. KD slows down the motor as it approaches the target, and helps to prevent overshoot. In general, if you increase kp, you should also increase KD to keep the motor from overshooting and oscillating. See as well https://en.wikipedia.org/wiki/PID_controller

SetMotorPositionKP(MotorPort, Byte)

Set the motor target position KP constant If you set KP higher, the motor will be more responsive to errors in position, at the cost of perhaps overshooting and oscillating. KD slows down the motor as it approaches the target, and helps to prevent overshoot. In general, if you increase KP, you should also increase KD to keep the motor from overshooting and oscillating. See as well https://en.wikipedia.org/wiki/PID_controller

SetMotorPower(MotorPort, Int32)

Set the motor power in percent

SetServo(ServoPort, Int32)

Move the servo motor with a specific pulse in microseconds

SpiRead16(SpiMessageType)

Read a 16 bit value over SPI

SpiRead32(SpiMessageType)

Read a 32 bit value over SPI

SpiRead8(SpiMessageType)

Read a 8 bit value over SPI

SpiWrite16(SpiMessageType, Int16)

Send a 16 bit value over SPI

SpiWrite24(SpiMessageType, Int32)

Send a 24 bit value over SPI

SpiWrite32(SpiMessageType, Int32)

Send a 32 bit value over SPI

SpiWrite8(SpiMessageType, Byte)

Send a 8 bit value over SPI

Applies to