Automatic Nerf Target
Print Profile(1)

Description
This is a Nerf target that automatically resets itself when you shoot it.
For this project I use a simple 9-gram servo and a switch.
If you want the version without the servo and switch mounts, click here:
Nerf Target Servo Version
Below is an example code. You will need to change the pin numbers depending on your wiring arrangement.
#include <Servo.h>
#define switchPin 2
#define servoPin 3
Servo myservo; // Create a Servo object to control the servo
int pos = 90; // Variable to store the servo position
void setup() {
myservo.attach(servoPin);
pinMode(switchPin, INPUT);
myservo.write(90); // Set servo to the starting position
}
void loop() {
if (digitalRead(switchPin) == HIGH) {
delay(1000);
for (pos = 90; pos >= 0; pos -= 1) {
myservo.write(pos);
delay(5);
}
delay(2000);
myservo.write(90); // Reset the target
}
}
License
You may create derivative works based on this object, provided that all such derivative works are published exclusively on the MakerWorld platform and include proper attribution to the original creator. You may not share, upload, host, distribute, or publish this object—or any derivative work of this object—on any other digital platform, marketplace, or distribution channel. Commercial use of this object and any derivative works is strictly prohibited. This includes, but is not limited to, selling, renting, sublicensing, or using the object in any context in which you receive monetary compensation or other financial benefits.










Comment & Rating (2)