| Home | Trees | Indices | Help |
|---|
|
|
Each instance of this class can be used to represent a physical Linkbot. The member functions of this class can be used to get data, set motor angles, beep the buzzer, scan for button events, and more.
The member functions of the Linkbot class which are responsible for moving the joints of the Linkbot can be categorized into two general types of functions; "blocking" functions and "non-blocking" functions. A blocking function is a function that "hangs" until the complete motion is done, whereas a "non-blocking" function returns as soon as the motion begins, but does not wait until it is done. In the Linkbot class, all functions are blocking unless the have the suffix "NB", such as "Linkbot.moveNB()".
For example, consider the following lines of code:
linkbot.move(360, 0, 0) linkbot.setBuzzerFrequency(440)
When the above lines of code are executed, the Linkbot will rotate joint 1 360 degrees. Once the joint has rotated the full revolution, the buzzer will sound. Now consider the following code:
linkbot.moveNB(360, 0, 0) linkbot.setBuzzerFrequency(440)
For these lines of code, joint 1 also moves 360 degrees. The difference is that with these lines of code, the buzzer will begin emitting a tone as soon as the joint begins turning, instead of waiting for the motion to finish. This is because the non-blocking version of move() was used, which returns immediately after the joint begins moving allowing the setBuzzerFrequency() function to execute as the joint begins moving.
The moveWait() function can be used to block until non-blocking motion functions are finished. For instance, the following two blocks of code will accomplish the same task:
linkbot.move(360, 0, 0) linkbot.setBuzzerFrequency(440) linkbot.moveNB(360, 0, 0) linkbot.moveWait() linkbot.setBuzzerFrequency(440)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| [number, number, number] |
|
||
| number |
|
||
| number |
|
||
| number |
|
||
| integer |
|
||
| [number, number, number] |
|
||
| Robot Form |
|
||
| number |
|
||
| [float, float, float] |
|
||
| [numbers] |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| bytearray |
|
||
|
|||
| bytearray |
|
||
|
|||
|
|||
|
|||
|
|||
Check to see if the Linkbot is online. Raises an exception if the Linkbot is not online. |
Connect to a bluetooth enabled Linkbot.
|
Disable the button callback. See also: enableButtonCallback() |
Drive a single joint to a position as fast as possible, using the on-board PID motor controller.
|
Non-blocking version of driveJointTo(). Please see driveJointTo() for more details. |
Drive the joints to angles as fast as possible using on-board PID controller.
|
Non-blocking version of driveTo(). See driveTo() for more details |
Enable button callbacks. This function temporarily disables the robot's default button actions. Instead, whenever a button is pressed or released, the function given as the parameter 'callbackfunc' is called. See also: disableButtonCallback()
|
Get the current accelerometer readings
|
Get the current battery voltage of the Linkbot.
|
Get the ADC (Analog-to-digital) reading from a breakout-board's ADC channel.
|
Get the voltage reading of an ADC pin. Note that the voltage is calibrated using the AVCC reference. If the reference is changed using the setBreakoutADCReference() function, the values reported by this function may no longer be accurate.
|
Read value from digital I/O pin.
|
Get the current RGB values of the rgbled
|
Get the form factor.
|
Get the current angle position of a joint.
|
Get the current joint angles.
|
Get the joint angles with a timestamp. The timestamp is the number of seconds since the robot has powered on.
|
Use an instance of a Linkbot to get instances to other Linkbots. Note that this only works for Linkbots that are connected via Bluetooth or TTY, but does not work for Linkbots that are connected to BaroboLink. |
Get the serial ID from the Linkbot
|
Move a joint from it's current position by 'angle' degrees.
|
Non-blocking version of moveJoint(). See moveJoint() for more details. |
Move a joint to an angle.
|
Non-blocking version of moveJointTo. See moveJointTo for more details. |
Move all of the joints on a robot by a number of degrees.
|
Non-blocking version of move(). See move() for more details |
Make the joints begin moving continuously.
|
Move all joints on the Linkbot. Linkbot-I modules will ignore the 'angle2' parameter and Linkbot-L modules will ignore the 'angle3' parmeter. This function is the non-blocking version of moveTo(), meaning this function will return immediately after the robot has begun moving and will not wait until the motion is finished.
|
Reboot the connect robot. Note that communications with the robot will not succeed while the robot is booting back up. |
Begin recording joint angles.
|
Set the acceleration of all joints. Each joint motion will begin with this acceleration after calling this function. Set the acceleration to 0 to disable this feature. |
Set an analog output pin (PWM) to a value between 0-255. This can be used to set the power of a motor, dim a LED, or more.
|
Set the reference voltage of an analog input pin.
|
Set a digital I/O pin to either a high or low value. The pin will be set high if the parameter 'value' is non-zero, or set to ground otherwise. |
Set the mode of a digital I/O pin on the breakout board. Valid modes are barobo.PINMODE_INPUT, barobo.PINMODE_OUTPUT, and barobo.PINMODE_INPUTPULLUP. |
Set the buzzer to begin playing a tone.
|
Set a joint movement state
|
Set the speed of a joint.
|
Set all three motor speed simultaneously. Parameters in degrees/second. |
Set a joint's movement state.
|
Set the joint states for all 3 joints simultaneously.
|
Set the LED color
|
Set the power of a motor.
|
Set the movement state for all three motors.
|
Move a joint to a desired position with a specified amount of starting and stopping acceleration.
|
Receive data from a TWI device. See twiSend() for more details.
|
Send data onto the Two-Wire Interface (TWI) (aka I2c) of the Linkbot. Many Linkbot peripherals are located on the TWI bus, including the accelerometer, breakout boards, and some sensors. The black phone-jack on top of the Linkbot exposes TWI pins where custom or prebuild peripherals may be attached.
|
Send and receive data from a TWI device attached to the Linkbot. See twiSend() and twiRecv() for more details.
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 7 14:08:45 2013 | http://epydoc.sourceforge.net |