Diferencia entre revisiones de «APIenglish»

De Proyecto Butiá
Saltar a: navegación, buscar
(The Butiá API in Python)
Línea 17: Línea 17:
 
  'bb'
 
  'bb'
 
  robot.callModule(modulename, function, params )
 
  robot.callModule(modulename, function, params )
  robot.close()             #close communication with the bobot server
+
  robot.close()                   #close communication with the bobot server
 
  'debug'
 
  'debug'
 
  'drivers_loaded'
 
  'drivers_loaded'
 
  'find_butias'
 
  'find_butias'
  robot.getBatteryCharge()   #the battery charge, -1 if no motor connected
+
  robot.getBatteryCharge()         #the battery charge, -1 if no motor connected
 
  robot.getButton(port)
 
  robot.getButton(port)
 
  robot.getDistance(port)
 
  robot.getDistance(port)
Línea 37: Línea 37:
 
  'get_modules_list'
 
  'get_modules_list'
 
  'hotplug'
 
  'hotplug'
  robot.isPresent(modulename)
+
  robot.isPresent(modulename)       #Returns if the module is present
  robot.loopBack(data)
+
  robot.loopBack(data)             #Send a message to the board and expect to receive exactly what was sent
 
  'modeHack'
 
  'modeHack'
 
  'modules'
 
  'modules'

Revisión del 06:38 24 feb 2013

See also API in Spanish Note, the API now uses English syntax as from V?

Butiá can be used in many forms as a consumable service through the network as is the case of the bobot server directly using the bobot library or through various APIs such as C, Java, Python

The Butiá API in Python

Description of the function and various examples.


Instanciate the class:

robot = butiaAPI.robot()

'__doc__'
'__init__'
'__module__'
'bb'
robot.callModule(modulename, function, params )
robot.close()                    #close communication with the bobot server
'debug'
'drivers_loaded'
'find_butias'
robot.getBatteryCharge()         #the battery charge, -1 if no motor connected
robot.getButton(port)
robot.getDistance(port)
'getFirmwareVersion'
robot.getGray(port)
'getHack'
'getLight'
'getResistance'
'getTemperature'
'getVersion'
'getVoltage'
'get_all_drivers'
'get_butia_count'
'get_driver'
'get_modules_list'
'hotplug'
robot.isPresent(modulename)       #Returns if the module is present
robot.loopBack(data)              #Send a message to the board and expect to receive exactly what was sent
'modeHack'
'modules'
'openables'
robot.reconnect(address, port)    #connect or reconnect to the bobot at address:port
'refresh'
'set2MotorSpeed'
'setHack'
'setLed'
'setMotorSpeed'