[tuxdroid-svn] r847 - api/python/trunk daemon/trunk/libs
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-01-11 16:02:54
|
Author: jaguarondi Date: 2008-01-11 17:02:54 +0100 (Fri, 11 Jan 2008) New Revision: 847 Modified: api/python/trunk/tuxapi_class.py daemon/trunk/libs/USBDaemon_command_tux.c Log: * Adapting the boundaries of the effect.speed float to have higher speeds, this was limiting the pulse effect. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-11 15:47:49 UTC (rev 846) +++ api/python/trunk/tuxapi_class.py 2008-01-11 16:02:54 UTC (rev 847) @@ -2613,8 +2613,8 @@ only. We don't send floats through TCP/IP (effect_speed and effect_step), we - just multiply by 16 and divide by the same value on the other side. So - the boundaries are 1/16 to 15. + just multiply by 64 and divide by the same value on the other side. So + the boundaries are 1/64 to 3. Parameters: See the daemon API for details. @@ -2667,15 +2667,15 @@ """ if effect_speed > 15: effect_speed = 15 - if effect_speed < 1.0/16: - effect_speed = 1.0/16 + if effect_speed < 1.0/64: + effect_speed = 1.0/64 if effect_step > 255: effect_step = 255 # workaround to send a float over TCP/IP in the current API: - # effect_speed is multiplied by 16 + # effect_speed is multiplied by 64 self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, TUX_CMD_STRUCT_SUB_SET, leds, intensity, effect_type, - int(effect_speed*16), effect_step) + int(effect_speed*64), effect_step) #-------------------------------------------------------------------------- # Mapping of the daemon command to pulse the LEDs. @@ -2689,8 +2689,8 @@ one probably will have to be removed or kept for debug purposes only. We don't send floats through TCP/IP (effect_speed and effect_step), we - just multiply by 16 and divide by the same value on the other side. So - the boundaries are 1/16 to 15. + just multiply by 64 and divide by the same value on the other side. So + the boundaries are 1/64 to 3. Parameters: See the daemon API for details. @@ -2752,8 +2752,8 @@ """ if effect_speed > 15: effect_speed = 15 - if effect_speed < 1.0/16: - effect_speed = 1.0/16 + if effect_speed < 1.0/64: + effect_speed = 1.0/64 if effect_step > 255: effect_step = 255 if pulse_count > 255: @@ -2766,11 +2766,11 @@ return # workaround to send a float over TCP/IP in the current API: # pulse_period is multiplied by 250 - # effect_speed is multiplied by 16 + # effect_speed is multiplied by 64 self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, TUX_CMD_STRUCT_SUB_PULSE, leds, min_intensity, max_intensity, pulse_count, int(250 * pulse_period), effect_type, - int(effect_speed*16), effect_step) + int(effect_speed*64), effect_step) #-------------------------------------------------------------------------- # Send a command to tux for playing a sound from the flash memory Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-11 15:47:49 UTC (rev 846) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-11 16:02:54 UTC (rev 847) @@ -482,7 +482,7 @@ * uint8_t which is the float parameter multiplied by 16, then * divide it here again. The limitation is of course the range. */ - effect.speed = (float)data[5]/16; + effect.speed = (float)(data[5])/64; effect.step = data[6]; ACK = led_set(data[2], data[3], &effect); } @@ -496,9 +496,8 @@ * divide it here again. The limitation is of course the range. * pulse_period is multiplied by 250. */ - effect.speed = (float)data[8]/16; + effect.speed = (float)data[8]/64; effect.step = data[9]; - printf("%x %x %x %x %x %x %x %x \n",data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9]); ACK = led_pulse(data[2], data[3], data[4], data[5], (float)data[6]/250, &effect); } break; |