유은제김은지김선미gledel
Published

Arduino campaign project for my adorable cat, "Fishing Cat"

It was the first day of our project, "Fishing Cat", and we tested the servo motor and the switch.

BeginnerWork in progress287
Arduino campaign project for my adorable cat, "Fishing Cat"

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Breadboard (generic)
Breadboard (generic)
×1
Servos (Tower Pro MG996R)
×1
Jumper wires (generic)
Jumper wires (generic)
×8
nano expansion shield
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×2
LED (generic)
LED (generic)
×1
Resistor 221 ohm
Resistor 221 ohm
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Servo test

Switch test

Code

Servo test

EJS
#include <Servo.h>

Servo servo1;

void setup() {

 servo1.attach(7);// put your setup code here, to run once:

}

 

void loop() {

  servo1.write(0);

 delay(500);

  servo1.write(30);

 delay(500);

  servo1.write(60);

 delay(500);

  servo1.write(90);

 delay(500);

  servo1.write(60);

 delay(500);

  servo1.write(30);

 delay(500);

  servo1.write(0);

 delay(500);

 // put your main code here, to run repeatedly:

}

Switch test

EJS
int led_pin = 13;

int sw_pin1 = 2;

int sw_pin2= 8;

int sw1_value;

int sw2_value;

int input_value;

 

void setup(){

pinMode(led_pin, OUTPUT);

pinMode(sw_pin1, INPUT);

pinMode(sw_pin2, INPUT);

Serial.begin(9600);

}

 

void loop(){

  Serial.println("input_value"+String(input_value));

  Serial.println(input_value);

sw1_value = digitalRead(sw_pin1);

sw2_value = digitalRead(sw_pin2);

if(sw1_value == LOW){

  digitalWrite(led_pin, HIGH);

}

if(sw2_value == HIGH){

  digitalWrite(led_pin, HIGH);

}

  digitalWrite(led_pin, LOW);

}

Credits

유은제

유은제

15 projects • 6 followers
Hello :-) I'm a high school student in South Korea.
김은지

김은지

6 projects • 0 followers
I am a high school student in Korea.
김선미

김선미

8 projects • 1 follower
gledel

gledel

100 projects • 91 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"

Comments