pythonpushover503
Published © GPL3+

Arm held CATAPULT!!!!!!

Learn how to launch items with a handheld catapult!!!

IntermediateShowcase (no instructions)113
Arm held CATAPULT!!!!!!

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Arduino Mega 2560
Arduino Mega 2560
×1
LED (generic)
LED (generic)
×1
Switch Actuator, APEM A01 series Illuminated Push-Button Switches
Switch Actuator, APEM A01 series Illuminated Push-Button Switches
×1

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Catapult code

Arduino
Used to make the robot work
#include <EduIntro.h>
/*

*/
const int buzzer = 9;
const int led = 10;
const int button = 12;
ServoMotor servo(D3);

void setup() {
  // put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(button, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(button) == LOW) {
  delay(10);
  digitalWrite(led, HIGH);
}
if (digitalRead(button) == HIGH) {
  delay(10);
  digitalWrite(led, LOW);
}

if (digitalRead(button) == LOW) {
  delay(100);
  servo.write(180);
  delay(100);
}
if (digitalRead(button) == HIGH) {
  delay(2000);
  servo.write(-180);
}
if (digitalRead(button) == LOW) {
  delay(1000);
  tone(buzzer, 165); 
  delay(500);
  noTone(buzzer); 
  delay(50);
  tone(buzzer, 165); 
  delay(500);
  noTone(buzzer); 
  delay(50);
  tone(buzzer, 165); 
  delay(500);
  noTone(buzzer); 
  delay(50);
  tone(buzzer, 247); 
  delay(750);
  noTone(buzzer);
  delay(1000);
}
}

Credits

pythonpushover503
4 projects • 2 followers

Comments