Personal tools
 
Document Actions

Class "status"

Functions providing access to Tux Droid internal states

Thierry Nancy

This tutorial provides functions and parameters description while illustrating each item with examples
Page 6 of 8.

Functions List


   1.6) Class : tux.status
1.6.1) Function : tux.status.charger_state
1.6.2) Function : tux.status.eyes_closed
1.6.3) Function : tux.status.eyes_counter
1.6.4) Function : tux.status.eyes_motor
1.6.5) Function : tux.status.eyes_opened
1.6.6) Function : tux.status.get
1.6.7) Function : tux.status.head_bt
1.6.8) Function : tux.status.ir_led
1.6.9) Function : tux.status.ir_signal
1.6.10) Function : tux.status.light_level
1.6.11) Function : tux.status.lled
1.6.12) Function : tux.status.lwing_bt
1.6.13) Function : tux.status.mouth_closed
1.6.14) Function : tux.status.mouth_counter
1.6.15) Function : tux.status.mouth_motor
1.6.16) Function : tux.status.mouth_opened
1.6.17) Function : tux.status.power_plug
1.6.18) Function : tux.status.rf_state
1.6.19) Function : tux.status.rled
1.6.20) Function : tux.status.rwing_bt
1.6.21) Function : tux.status.sounds_count
1.6.22) Function : tux.status.sound_muted
1.6.23) Function : tux.status.spin_backward
1.6.24) Function : tux.status.spin_bt
1.6.25) Function : tux.status.spin_counter
1.6.26) Function : tux.status.wings_backward
1.6.27) Function : tux.status.wings_counter
1.6.28) Function : tux.status.wings_motor
1.6.29) Function : tux.status.wings_forward
1.6.30) Function : tux.status.wings_bt
1.6.31) Function : tux.status.get_wings_position_switch
1.6.32) Function : tux.status.to_string

Functions Details


Global variables of this class:
"rf_connected" as boolean : State of the droid/dongle connection

Functions of the class


1.6.1) Function : tux.status.charger_state

Get the status of the charger

Return 1 for charging and 0 for not charging

Example:
>>>var = tux.status.charger_state()

1.6.2) Function : tux.status.eyes_closed

Get the last state of "eyes closed position switch" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.eyes_closed()

1.6.3) Function : tux.status.eyes_counter

Get the number of remaining movements of the eyes

Return an integer (0..255)

Example:
>>> var = tux.status.eyes_counter()

1.6.4) Function : tux.status.eyes_motor

Get the last state of "head motor for eyes" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.eyes_motor()

1.6.5) Function : tux.status.eyes_opened

Get the last state of "eyes open position switch" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.eyes_opened()

1.6.6) Function : tux.status.get

Get a specified status

Parameters:
"DATA_STATUS" as integer : desired status

Return a boolean
(True if the status arrives before 2 seconds)
(The raw of the status response is in tux.tcp_data)

Example:
>>> tux.status.get(DATAS_STATUS_WINGS_MOTOR_BACKWARD)

1.6.7) Function : tux.status.head_bt

Get the status of the head button

Return 1 for on and 0 for off

Example:
>>> var = tux.status.head_bt()

1.6.8) Function : tux.status.ir_led

Get the last state of "IR led" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.ir_led()

1.6.9) Function : tux.status.ir_signal

Get the last state of "IR receiver signal" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.ir_signal()

1.6.10) Function : tux.status.light_level

Get the last light level

Return an integer (0..1024, max light=0)

Example:
>>> var = tux.status.light_level()

1.6.11) Function : tux.status.lled

Get the state of the left blue led

Return 1 for on and 0 for off

Example:
>>> var = tux.status.lled()

1.6.12) Function : tux.status.lwing_bt

Get the last state of "left wing push" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.lwing_bt()

1.6.13) Function : tux.status.mouth_closed

Get the last state of "mouth closed position" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.mouth_closed()

1.6.14) Function : tux.status.mouth_counter

Get the number of remaining movements of the mouth

Return an integer (0..255)

Example:
>>> var = tux.status.mouth_counter()

1.6.15) Function : tux.status.mouth_motor

Get the last state of "head motor for mouth" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.mouth_motor()

1.6.16) Function : tux.status.mouth_opened

Get the last state of "mouth open position" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.mouth_opened()

1.6.17) Function : tux.status.power_plug

Get the last state of "power plug switch" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.power_plug()

1.6.18) Function : tux.status.rf_state

Get the last state of the RF status

Return 1 for connected and 0 for disconnected

Example:
>>>var = tux.status.rf_state()

1.6.19) Function : tux.status.rled

Get the state of the right blue led

Return 1 for on and 0 for off

Example:
>>> var = tux.status.rled()

1.6.20) Function : tux.status.rwing_bt

Get the last state of "right wing push" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.rwing_bt()

1.6.21) Function : tux.status.sounds_count

Get the number of sounds stored in the flash memory

Return a integer (0..255)

Example:
>>> var = tux.status.sounds_count()

1.6.22) Function : tux.status.sound_muted

Get the last state of "tux mute sound" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.sound_muted()

1.6.23) Function : tux.status.spin_backward

Get the last state of "spin motor forward" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.spin_forward()

1.6.24) Function : tux.status.spin_bt

Get the last state of "spin position switch" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.spin_bt()

1.6.25) Function : tux.status.spin_counter

Get the number of remaining movements of 'spinning'

Return an integer (0..255)

Example:
>>> var = tux.status.spin_counter()

1.6.26) Function : tux.status.wings_backward

Get the last state of "wings motor backward" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.wings_backward()

1.6.27) Function : tux.status.wings_counter

Get the number of remaining movements of the wings

Return an integer (0..255)

Example:
>>> var = tux.status.wings_counter()

1.6.28) Function : tux.status.wings_motor

Get the last state of "motor for wings" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.wings_motor()

1.6.29) Function : tux.status.wings_forward

Get the last state of "wings motor forward" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.wings_forward()

1.6.30) Function : tux.status.wings_bt

Get the last state of "wings position switch" status

Return 1 for on and 0 for off

Example:
>>> var = tux.status.wings_bt()

1.6.31) Function : tux.status.get_wings_position_switch

Deprecated : see 'tux.status.wings_bt'

1.6.32) Function : tux.status.to_string

Convert the current raw statuses to an explicit string

Return a string

Example:
>>> print tux.status.to_string()

 
by Thierry Nancy last modified 2007-05-02 16:16
Contributors: Rémi Jocaille, Thierry Nancy
You are here: Home Documentation Tutorials Tux API Documentation Class "status"

Powered by Plone CMS, the Open Source Content Management System