Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by DJ Sures!

Is It Possible To Ramp Up And Down The Brightness Of Leds?

No lucking finding a post on this. I am working on a BB-8 driod with the EZ-Robot and am looking to get LEDs to quickly ramp to full brightness and fade out the same way (as opposed to just turn on or off.) Any ideas on the best way to achieve this?




Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
Yes, you can use PWM to control the brightness of an LED, so a script that ramps up and down the pwm going to the digital port will do it.

Use the ServoSpeed() command to apply a ramping speed to the PWM. And as alan mentioned, use the PWM command to set the brightness.

Something like this...


# set the servo speed to 2
ServoSpeed(d0, 2)


# Set LED On
pwm(d0, 100)

# wait some time for the pwm to do its ramping thing

#set LED Off
pwm(d0, 0)

# wait some time for the pwm to do its ramping thing


I figured it might be through the servo controller. Seeing the code is very helpful. Thanks for the fast response, guys!
Oh, good one DJ. I didn't think about using the PWM ramping built into Servospeed.

I did this script (D11 is my LED)


$brightness = 0
repeatwhile($brightness) <= 100)
$brighness = $brightness + 1

(this just ramps up, not back down).
@Science Bob.... Next time ask us something really challenging will ya.... LOL

Welcome to ez robot, btw.... :)