John,
I am using 5 volts from an Arduino Nano. No need for a resistor at 5 volts. What Steve was referring to, if you powered the light from more than 5 volts, then you would need a resistor.
The video I have attached is a nano setup with a Ultrasonic sensor, HC-SR04 to detect a train passing for another project I am working on , I wired the light to demonstrate the light turning on when a train passes. Sorry I am away from my trains so am improvising with a small plastic box, excuse the arm motive power for the box.
To test the light I wired the red and brown wires to the power strip on the breadboard. The yellow wire tapping to ground. Took a few times and a lot of tapping to have the mode change. Keep trying and fast tapping and you’ll get a mode change .
Tom