Welcome, Guest
Username Password: Remember me

Turn off LED
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Turn off LED

Turn off LED 6 years, 4 months ago #131

Hi,

Once I turn on the LEDs, how can I turn them off? (I mean in the code, in my own URBI module!)

Thanks

Re: Turn off LED 6 years, 4 months ago #132

Use changecolor() with intensity = 0

Re: Turn off LED 5 years, 9 months ago #165

Hello,

I believe there is a problem on this method "changeColor".
As I understood, It can take 3 parameters (int, String, float).
I guessed that the first is the "mode" : 0 for both leds, 1 for right, and 2 for left (dunno why it can also take 3?).
The 2 others are the name of the color (i.e. "red") and the last is the intensity ([0;1]) . However, when i tested :
Global.servo.changeColor(0,"blue",1);
Global.servo.changeColor(1,"red",1);

Both leds turned red. Where can i fix this bug?

Thank you

Re: Turn off LED 5 years, 9 months ago #169

You are right, there is a bug !

Waiting for a patch, here a workaround I found :
To have left led on :
Global.servo.changeColor(1,"red",1);
Global.servo.changeColor(1,"red",0);

To have right led on :
Global.servo.changeColor(2,"red",1);
Global.servo.changeColor(2,"red",0);


Originaly there was a third led on the backpack. It's why argument 3 is accepted. But it shouldn't light anything on --> same bug

Re: Turn off LED 5 years, 9 months ago #170

To turn off a led you can also use color = "stop"

Global.servo.changeColor(0,"stop",1);
  • Page:
  • 1
Time to create page: 0.17 seconds