Using Flashlight in VCS


#1

I can’t seem to find any code in VCS using C++ in order to use the VEX Flashlight. We aren’t using it for this game, but for something else. Does anyone know any code we could use to turn on the Flashlight?


#2

Never had the chance to use the Flashlight. Is it a Digital Output?

https://help.vex.com/article/29-how-to-view-the-3-wire-ports-on-the-v5-robot-brain
http://help.vexcodingstudio.com/#cpp/namespacevex/classvex_1_1digital__out/set

DigitalOut1.set(true);

#3

Usually the flashlight receives power from a motor port. To be able to turn on and off from code you need an MC29 motor controller. Setup in VCS as pwm_out rather than motor29 so that turn on/off is instant (motor29 uses slew rate control)