Overview | Info/Download | Documentation | Sample Projects 
Making a GoGo board | Board Variations | Links | FAQ

GoGo Dynamic Link Library (DLL)

The GoGo DLL provides access to GoGo board functionalities (tethered mode) from any language and software environment that supports WIN-32 DLL calls. Examples of these environments include C, C++, Visual Basic, Macromedia Director, Squeak, and Microworlds Logo.

Installation

Simply download and unzip the GoGo DLL into the windows\system32 folder.

Documentation

The following is a list of commands implemented:

*Every command returns (-1*ErrorCode) on error. See error code definition at end of page.

Setup Commands

  • connect(Comm-Port-Number)
    Opens the specified COM port.

    connect(1)  // opens COM1
     
  • close()
    Closes the COM port.
     
  • doAdd(number1, number2)
    This is used for DLL call test. It returns the sum of the two numbers.

Basic Commands

  • version()
    Returns DLL version.
     
  • ping()
    Pings the GoGo board.
    Returns GOGO_SUCCESS
     
  • beep()
    Make the GoGo board beep once.
    Returns GOGO_SUCCESS
     
  • ledOn()
    Turns on the user LED.
    Returns GOGO_SUCCESS
     
  • ledOff()
    Turns off the user LED.
    Returns GOGO_SUCCESS

Sensor Commands

  • sensor(sensor-number)
    Returns a sensor value (0-1023) of sensor-number.

    sensor(1) 
    // returns sensor1's value
     
  • sensorMax(sensor-number)
    Returns the maximum sensor value the board encountered since the last sensorMAX() operation.
     
  • sensorMin(sensor-number)
    Returns the minimum sensor value the board encountered since the last sensorMIN() operation.
     

Motor Control Commands

  • motorOn()
    Turns the active motor(s) on.
     
  • motorOff()
    Turns the active motor(s) off.
     
  • motorRd()
    Reverse direction of the active motor(s).
     
  • motorThisway()
    Set an absolute direction for active motor(s).
     
  • motorThatway()
    Set an absolute direction (reversed) for active motor(s).
     
  • motorCoast()
    Same as off but no break is applied to motor.
     
  • setMotorPower(power-level)
    Set motor power level (0-7).
     
  • talk2Motor(motor-bits)
    Set active motor(s). Each bit in the motor-bits corresponds to a motor port.

    talk2Motor(5) 
    // talks to motor 1 and 3

Error Codes

100   ERROR_NO_ERROR
101   ERROR_OPEN_COM
102   ERROR_COM_SETTINGS
103   ERROR_COM_HANDSHAKING
104   ERROR_SEND
105   ERROR_SET_READ_TIMEOUT
106   ERROR_SET_EVENT_MASK
107   ERROR_NO_INCOMING_BYTES
108   ERROR_READ
109   ERROR_HEADER_NOT_FOUND
110   INVALID_ACK_BYTE
111   ERROR_WAIT_FOR_BYTE
112   ERROR_READ_TIMEOUT
113   ERROR_COM_PURGE
114   ERROR_UPDATE_BUFFER
115   ERROR_POWER_LEVEL_OUT_OF_RANGE
210   ERROR_SENSOR_NUMBER_OUT_OF_RANGE
211   POWER_LEVEL_OUT_OF_RANGE
212   ERROR_UNEXPECTED


 

 

Download GoGo DLL

Current Version is 1.0 [Apr 4, 2004]

สัญลักษณ์แสดงหัวข้อย่อย GoGo DLL 1.0 - [74k]
สัญลักษณ์แสดงหัวข้อย่อย VC++ Source - [29k]
 
 
Contact: gogo@media.mit.edu.    

 Last updated: April 4, 2004