Control the LED color Without power the other servo

Is there a way to do so?

this is a very simple python script to change to RAPIRO's eye color.
i put a simple Loop and th crew some random RGB number so the colors would fade.

i wanted to use the #H fuction to turn of the servo but it power on the servo, change the led and power of. And so on. As a result, the robot is twitching,, thats kinda funny, any help on how to modify the Arduino sketch to do so?

here is the script if you want to play around..

{{{
import time
import sys
import serial
import os
import time
import datetime

bot = serial.Serial('/dev/ttyAMA0', 57600, timeout = 10)

#Define colors codes and maximum intensity
MAXRED = 255
MAXGREEN = 225
MAXBLUE = 255
MAXTIME = 050

RED = MAXRED
GREEN = MAXGREEN
BLUE = MAXBLUE
TIME = MAXTIME

def Rapiro(r):
bot.write(r)

def Led(RED,GREEN,BLUE,TIME):
s = "#PR" + str(RED).zfill(3) + "G" + str(GREEN).zfill(3) + "B" + str(BLUE).zfill(3) + "T"+ str(TIME).zfill(3)
return (s)

#Print Max values, and Changing colors. All max= White.
#TIME is the fading speed 000 change the color instantaneously, 255 very slowly.

Rapiro(Led('013','032','033',010))

Rapiro('#M00')
time.sleep(2.5)
x = 1
while True:
print "To infinity and beyond! We're getting close, on %d now!" % (x)
Rapiro(Led('008','100','255',010))
Rapiro(Led('100','100','020',010))
Rapiro(Led('055','070','050',010))
Rapiro(Led(RED,'000','000',010))
Rapiro('#H')
time.sleep(2)
x += 1

}}}

posted by djakku_u on 2014-05-10 10:31

Probably, this problem would not be solved by software.

*Cause guess
・Turn-on time of the servo switch too fast.
・ Input voltage of the DCDC to drop by the rush current of the servo.
・Soft-start does not work on the above factors. (And system reset)
・Voltage of the DCDC is not a normal value

*Countermeasure
・Between the DCDC and battery box, I was connected to an electric double layer capacitor (1.5F).
http://akizukidenshi.com/catalog/g/gP-04300/

・I want to slow down the turn-on time of the servo switch. (I have not tried for modified of the board is required)

I have added Step-Down DCDC for Rpi and 1.5F capacitor.
It is worked fine. Your script also worked.

I also want to know if there are other ways.

posted by oga on 2014-05-10 12:20

Thanks oga for your information. Too bad nothing can be done software wise, your assumptions make senses..

script wise, i have no programming backround so i just doodle.
ideally i want to be able to use the wiimote and its ACC data to change the RDG led.
i'm sure you can help seeing how beautifully you polished the original ps3 controler script :)

posted by djakku_u on 2014-05-11 12:53

I am not good at English and I'm not a good programmer.
However, I might be able to help you.

I'll try to modify wiimot script.
If I modify the script, I will up to git.

posted by oga on 2014-05-11 18:44

I modified script, and assigned motion to the button.
https://github.com/oga00000001/RapiroTools/blob/master/RapiroWiimote/RapiroWiimote.py

posted by oga on 2014-05-12 22:29

( Allowed tags: <b> <s> <code> <blockquote> <img> . Automatic URL link.)

Uploaded image is placed to the bottom of the post. To add multiple images, make post once then edit the post.

Read Terms of Service upon submitting. 投稿する前に利用規約をお読みください。