Personal tools
 
Document Actions

Class "cmd"

Sending commands for Tux Droid control

Thierry Nancy

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

Functions List

The list is structured according to the device to be controlled.Simply click on the right link in the list to get the function documentation


Audio Channel selection

These functions have limited use for beginners. They are provident d for selecting audio channel for Tux Droid
      1.1.1)    Function : tux.cmd.audio_channel_general
1.1.2) Function : tux.cmd.audio_channel_tts

Eyes Control

      1.1.3)    Function : tux.cmd.eyes_close
1.1.4) Function : tux.cmd.eyes_off
1.1.5) Function : tux.cmd.eyes_on
1.1.6) Function : tux.cmd.eyes_on_free
1.1.7) Function : tux.cmd.eyes_open

Infrared Control

      1.1.8)    Function : tux.cmd.ir_off
1.1.9) Function : tux.cmd.ir_on
1.1.10) Function : tux.cmd.ir_send

Led Control

      1.1.11)   Function : tux.cmd.ledl_during
1.1.12) Function : tux.cmd.ledl_during_free
1.1.13) Function : tux.cmd.ledl_off
1.1.14) Function : tux.cmd.ledl_on
1.1.15) Function : tux.cmd.ledr_during
1.1.16) Function : tux.cmd.ledr_during_free
1.1.17) Function : tux.cmd.ledr_off
1.1.18) Function : tux.cmd.ledr_on
1.1.19) Function : tux.cmd.leds_blink
1.1.20) Function : tux.cmd.leds_during
1.1.21) Function : tux.cmd.leds_during_free
1.1.22) Function : tux.cmd.leds_off
1.1.23) Function : tux.cmd.leds_on

Mouth Control

      1.1.24)   Function : tux.cmd.mouth_close
1.1.25) Function : tux.cmd.mouth_off
1.1.26) Function : tux.cmd.mouth_on
1.1.27) Function : tux.cmd.mouth_on_free
1.1.28) Function : tux.cmd.mouth_open
1.1.29) Function : tux.cmd.ping
1.1.30) Function : tux.cmd.raw
1.1.31) Function : tux.cmd.sleep_off
1.1.32) Function : tux.cmd.sleep_on

Sound Control

      1.1.33)   Function : tux.cmd.sound_play
1.1.34) Function : tux.cmd.sound_store_index
1.1.35) Function : tux.cmd.sound_storing
1.1.36) Function : tux.cmd.sound_test

Spin Control

      1.1.37)   Function : tux.cmd.spinl_off
1.1.38) Function : tux.cmd.spinl_on
1.1.39) Function : tux.cmd.spinl_on_free
1.1.40) Function : tux.cmd.spinr_off
1.1.41) Function : tux.cmd.spinr_on
1.1.42) Function : tux.cmd.spinr_on_free

General Control

      1.1.43)   Function : tux.cmd.structured

Wings Control

      1.1.44)   Function : tux.cmd.wings_off
1.1.45) Function : tux.cmd.wings_on
1.1.46) Function : tux.cmd.wings_on_free

Function Details

   
1.1.1) Function : tux.cmd.audio_channel_general

Send a command to tux for selecting the "general" audio channel in
the dongle

Example:
>>> tux.cmd.audio_channel_general()

1.1.2) Function : tux.cmd.audio_channel_tts

Send a command to tux for selecting the "TTS" audio channel in
the dongle

Example:
>>> tux.cmd.audio_channel_tts()

1.1.3) Function : tux.cmd.eyes_close

Send a command to tux for closing the eyes

Example:
>>> tux.cmd.eyes_close()

1.1.4) Function : tux.cmd.eyes_off

Send a command to tux for stopping the eyes movement

Example:
>>> tux.cmd.eyes_off()

1.1.5) Function : tux.cmd.eyes_on

Send a command to tux for moving the eyes

Parameters:
"count" as integer : Number of movements
(default = 1)

Example:
>>> tux.cmd.eyes_on()
>>> tux.cmd.eyes_on(2)

1.1.6) Function : tux.cmd.eyes_on_free

Send a command to tux for moving the eyes in free mode

Parameters:
"count" as integer : number of movements
(default = 1)

Example:
>>> tux.cmd.eyes_on_free()
>>> tux.cmd.eyes_on_free(2)

1.1.7) Function : tux.cmd.eyes_open

Send a command to tux for opening the eyes

Example:
>>> tux.cmd.eyes_open()

1.1.8) Function : tux.cmd.ir_off

Send a command to tux for turning the IR off

Example:
>>> tux.cmd.ir_off()

1.1.9) Function : tux.cmd.ir_on

Send a command to tux for turning the IR on

Example:
>>> tux.cmd.ir_on()

1.1.10) Function : tux.cmd.ir_send

Send a command to tux for sending an IR code

Parameters:
"address" as integer : RC5 address
"command" as integer : RC5 command

Example:
>>> tux.cmd.ir_send(1,1)

1.1.11) Function : tux.cmd.ledl_during

Send a command to tux for turning the left led on during a specified
time

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.ledl_during(2.5)

1.1.12) Function : tux.cmd.ledl_during_free

Send a command to tux for turning the left led on during a specified
time in free mode

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.ledl_during_free(2.5)

1.1.13) Function : tux.cmd.ledl_off

Send a command to tux for turning the left led off

Example:
>>> tux.cmd.ledl_off()

1.1.14) Function : tux.cmd.ledl_on

Send a command to tux for turning the left led on

Example:
>>> tux.cmd.ledl_on()

1.1.15) Function : tux.cmd.ledr_during

Send a command to tux for turning the right led on during a specified
time

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.ledr_during(2.5)

1.1.16) Function : tux.cmd.ledr_during_free

Send a command to tux for turning the right led on during a specified
time in free mode

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.ledr_during_free(2.5)

1.1.17) Function : tux.cmd.ledr_off

Send a command to tux for turning the right led off

Example:
>>> tux.cmd.ledr_off()

1.1.18) Function : tux.cmd.ledr_on

Send a command to tux for turning the right led on

Example:
>>> tux.cmd.ledr_on()

1.1.19) Function : tux.cmd.leds_blink

Send a command to tux for blinking the leds

Parameters:
"count" as integer : number of blink(0..255)
"delay" as integer : delay between 2 states (u=4msec)

Example:
>>> tux.cmd.leds_blink(10,25)

1.1.20) Function : tux.cmd.leds_during

Send a command to tux for turning the leds on during a specified time

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.leds_during(2.5)

1.1.21) Function : tux.cmd.leds_during_free

Send a command to tux for turning the leds on during a specified time
in free mode

Parameters:
"seconds" as float : time to wait in seconds

Example:
>>> tux.cmd.leds_during_free(2.5)

1.1.22) Function : tux.cmd.leds_off

Send a command to tux for turning the leds off

Example:
>>> tux.cmd.leds_off()

1.1.23) Function : tux.cmd.leds_on

Send a command to tux for turning the leds on

Example:
>>> tux.cmd.leds_on()

1.1.24) Function : tux.cmd.mouth_close

Send a command to tux for closing the mouth

Example:
>>> tux.cmd.mouth_close()

1.1.25) Function : tux.cmd.mouth_off

Send a command to tux for stopping the mouth movement

Example:
>>> tux.cmd.mouth_off()

1.1.26) Function : tux.cmd.mouth_on

Send a command to tux for moving the mouth

Parameters:
"count" as integer : number of movements
(default = 1)

Example:
>>> tux.cmd.mouth_on()
>>> tux.cmd.mouth_on(2)

1.1.27) Function : tux.cmd.mouth_on_free

Send a command to tux for moving the mouth in free mode

Parameters:
"count" as integer : number of movements
(default = 1)

Example:
>>> tux.cmd.mouth_on_free()
>>> tux.cmd.mouth_on_free(2)

1.1.28) Function : tux.cmd.mouth_open

Send a command to tux for opening the mouth

Example:
>>> tux.cmd.mouth_open()

1.1.29) Function : tux.cmd.ping

Send a command to tux for the "ping-pong" test

Parameters:
"count" as integer : number of pong requested
(default = 200)

Example:
>>> tux.cmd.ping()
>>> tux.cmd.ping(200)

1.1.30) Function : tux.cmd.raw

Send a raw command to tux

Parameters:
"cmd" as integer : command
"param1" as integer : parameter 1 of these command
"param2" as integer : parameter 2 of these command
"param3" as integer : parameter 3 of these command

Return a ACK if it's required

Example:
>>> tux.cmd.raw(BLINK_EYES_CMD,4,0,0)

1.1.31) Function : tux.cmd.sleep_off

Send a command to tux for turning the sleep mode off

Example:
>>> tux.cmd.sleep_off()

1.1.32) Function : tux.cmd.sleep_on

Send a command to tux for turning the sleep mode on

Example:
>>> tux.cmd.sleep_on()

1.1.33) Function : tux.cmd.sound_play

Send a command to tux for playing a sound from the flash
memory

Parameters:
"index" as integer : index of the sound
"volume" as integer : volume of the sound(0..7,0=max)
(default = 0)

Example:
>>> tux.cmd.sound_play(1)
>>> tux.cmd.sound_play(1,0)

1.1.34) Function : tux.cmd.sound_store_index

Send a command to tux for indexing the sound

Parameters:
"highAdd" as integer : high byte address of the sound
"middleAdd" as integer : middle byte address of the sound
"lowAdd" as integer : low byte address of the sound

Example:
>>> tux.cmd.sound_store_index(0x00,0x04,0x00)

1.1.35) Function : tux.cmd.sound_storing

Send a command to tux for storing a sound collection in the
memory flash

Parameters:
"number" as integer : number of sounds to be stored

Example:
>>> tux.cmd.sound_storing(10)

1.1.36) Function : tux.cmd.sound_test

Send a command to tux for testing the sound in tux

Example:
>>> tux.cmd.sound_test()

1.1.37) Function : tux.cmd.spinl_off

Send a command to tux for stopping the spinning movement

Example:
>>> tux.cmd.spinl_off()

1.1.38) Function : tux.cmd.spinl_on

Send a command to tux to spin to the left

Parameters:
"count" as integer : number of quarter turns
(default = 4)
"speed" as integer : speed of the movement(1..5)
(default = 5)

Example:
>>> tux.cmd.spinl_on()
>>> tux.cmd.spinl_on(2) (count = 2)
>>> tux.cmd.spinl_on(2,5) (count = 2 and speed = 5)

1.1.39) Function : tux.cmd.spinl_on_free

Send a command to tux to spin to the left in free mode

Parameters:
"count" as integer : number of quarter turns
(default = 4)
"speed" as integer : speed of the movement(1..5)
(default = 5)

Example:
>>> tux.cmd.spinl_on_free()
>>> tux.cmd.spinl_on_free(2) (count = 2)
>>> tux.cmd.spinl_on_free(2,5) (count = 2 and speed = 5)

1.1.40) Function : tux.cmd.spinr_off

Send a command to tux for stopping the spinning movement

Example:
>>> tux.cmd.spinr_off()

1.1.41) Function : tux.cmd.spinr_on

Send a command to tux to spin to the right

Parameters:
"count" as integer : number of quarter turns
(default = 4)
"speed" as integer : speed of the movement(1..5)
(default = 5)

Example:
>>> tux.cmd.spinr_on()
>>> tux.cmd.spinr_on(2) (count = 2)
>>> tux.cmd.spinr_on(2,5) (count = 2 and speed = 5)

1.1.42) Function : tux.cmd.spinr_on_free

Send a command to tux to spin to the right in free mode

Parameters:
"count" as integer : number of quarter turns
(default = 4)
"speed" as integer : speed of the movement(1..5)
(default = 5)

Example:
>>> tux.cmd.spinr_on_free()
>>> tux.cmd.spinr_on_free(2) (count = 2)
>>> tux.cmd.spinr_on_free(2,5) (count = 2 and speed = 5)

1.1.43) Function : tux.cmd.structured

Send a structured command to tux

Parameters:
"fct" as integer : function of tux
"cmd" as integer : command for this function
"param1" as integer : parameter 1 for this command
"param2" as integer : parameter 2 for this command
"param3" as integer : parameter 3 for this command

Return a ACK as integer

Example:
>>> tux.cmd.structured(TUX_CMD_STRUCT_EYES,TUX_CMD_STRUCT_SUB_ON
,count,0,0)

1.1.44) Function : tux.cmd.wings_off

Send a command to tux for stopping the wings movement

Example:
>>> tux.cmd.wings_off()

1.1.45) Function : tux.cmd.wings_on

Send a command to tux for moving the wings

Parameters:
"count" as integer : number of movements
(default = 1)
"speed" as integer : speed of the movement(1-5)
(default = 5)

Example:
>>> tux.cmd.wings_on()
>>> tux.cmd.wings_on(2) (2 movements)
>>> tux.cmd.wings_on(2,5) (2 movements and speed=5)

1.1.46) Function : tux.cmd.wings_on_free

Send a command to tux for moving the wings in free mode

Parameters:
"count" as integer : number of movements
(default = 1)
"speed" as integer : speed of the movement(1..5)
(default = 5)

Example:
>>> tux.cmd.wings_on_free()
>>> tux.cmd.wings_on_free(2) (2 movements)
>>> tux.cmd.wings_on_free(2,5) (2 movements and speed=5)


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

Powered by Plone CMS, the Open Source Content Management System