Wanted to get this ball started before I consider it too much work. This is the lighting for one of the two SC-HPA Nerf Guns. It’s super simple, all of the lights are run off of a single PWM pin. You flip on the safety switch at the bottom and there you go, pretty pulsing lights.
Here is the code, really its super short:
int led = 9;
int brightness = 0;
int fadeAmount = 5;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount;
}
delay(30);
}
It runs off of an Arduino Nano (off-brand clone) with a 9v battery for power. And that’s it.