I have no idea what I'm doing (Help me?)

So, I'm trying to set up this project but I don't know squat about coding and I was hoping somebody could help me

Arduino Uno
Ky-018 Photeresistor
Various Wires
2 Servos (Mini blue ones)

Servo 1 Presses A on my 3DS by turning 45 degrees then going back
Servo 2 Presses Start on my 3DS by also turning 45 degrees and going back

My Goal:
Servo 1 Presses A
Wait 3 Seconds
Servo 1 Presses A
Wait 5 Seconds
Servo 1 Presses A
Wait 4 seconds
Servo 1 Presses A
Wait 1 Second
Servo 1 Presses A
Wait 1 Second
Servo 1 Presses A
Wait 1 Second
Servo 1 Presses A
Time how long the screen goes black using the photoresistor/photocell (I don't know what to call it)

  • If longer than 16 seconds stop process

  • If shorter than 16 seconds servo 2 presses start
    Wait 14 seconds
    Repeat process

If somebody could help me out that'd be great, I spent a lot longer writing this than I probably should have

Here's a picture: Screenshot - 6e47d7ca1012b624312af83657dad45b - Gyazo

We can help you but you do the the heavy lifting.

Always show us your ‘current’ compete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

Show us a good schematic of your circuit.

Show us a good image of your wiring.

What coding and electronics have you done?

What will this be used for?

Read up on state machine programmming techniques.



Alright, so I have nothing in the way of code besides:

#include <Servo.h>

But I do have a better picture

The bottom row on the left is GND
The bottom row on the right is 5V
The top two are connecting a servo (doesn’t matter which one) to input 2
The middlish two are connecting the other servo to input 5
the green wired below that are connecting the signal on my KY-018 to A2

My intention is to make this automatically shiny hunt Pokemon as a hobby project.

Draw a schematic showing everything.

Powering two servos with the Arduino is not recommended as you may be drawing too much current.


Do not power ANY servos or motors with Arduino 5V output. You will damage or destroy it.
Use a separate power supply for the servos (like a 4xAA battery pack) and connect the grounds.