FIRST PROJECT WITH ARDUINO PLEASE HELP

hi, i was wondering if someone would be able to help me. my goal in mind is that i am creating a pair of robotic eyes (for a show vehicle with transformer theme) that i would like to have the leds in the eyes blink at random intervals and randoms amounts of blinks as well as to have them move left and right at random intervals and speed. this is going from a 12 volt source to the seeeduino then from seeeduino to brick and the brick will go out to 2 push buttons which will be used to turn on and turn off both the eye movements and the leds in the eyes. The servo will be on a connecting rod with the eyes and will generate the movement. i have purchased the following from trossen robotics and have never worked with robots or coding, im just looking to get this installed for an upcoming car show, so if anyone can help id be more than appreciated, thanks

Item : 36 Inch PWM Signal Booster Cable
Item : Electronic Brick - Half Buckled 3 Wire Cable - 5 Pack
Item : JST 2 Pin Power Connector
Item : (2) Electronic Brick - Mini Push Button
Item : Seeeduino V2.2 (Atmega 328P)
Item : Electronic Brick Shield V4
Item : 25W Step down adjustable switching regulator

i was wondering if these codes will work and if so can someone help me combine the two codes as well as incoporate the 2 push buttons to control the power on and off of the leds for one and the movement for the other. thanks, here is the code

#include <Servo.h> //include the servo libary - a bunch of code for a host of servo instructions y9ou can use and don't have to develop yourself

Servo myservo; // create servo object to control a servo

int pos = 0; // variable to store the servo position
int delay1 = 0; // variable to store the delay between servo arm's movement info

void setup()
{
myservo.attach(9); // attaches pin 9 of the micro controller to the servo object - the servo's "control wire"
}

void loop()
{
pos=random(65,115); // ramdomly set the servo arm postion between 65 & 115 degrees. "90" is "straight ahead"
delay1=random(50, 500); // randomly set delay between servo movement between 50 and 500 milliseconds
myservo.write(pos); // tell servo to go to position specified by variable ‘pos’ value
delay(delay1); // waits randomly between 50ms and 500 ms between servo movements
}

heres the code for the leds

/*

  • Blink_Randomly
  • Modified from the basic Arduino example. Turns an LED on for a random time,
  • then off for a (most likely) different random time. We use pin 13 because,
  • depending on your Arduino board, it has either a built-in LED
  • or a built-in resistor so that you need only an LED.
  • Original at - http://www.arduino.cc/en/Tutorial/Blink
    */

int ledPin = 13; // LED connected to digital pin 13
long randOn = 0; // Initialize a variable for the ON time
long randOff = 0; // Initialize a variable for the OFF time

void setup() // run once, when the sketch starts
{
randomSeed (analogRead (0)); // randomize
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop() // run over and over again
{
randOn = random (100, 1200); // generate ON time between 0.1 and 1.2 seconds
randOff = random (200, 900); // generate OFF time between 0.2 and 0.9 seconds
digitalWrite(ledPin, HIGH); // sets the LED on
delay(randOn); // waits for a random time while ON
digitalWrite(ledPin, LOW); // sets the LED off
delay(randOff); // waits for a random time while OFF
}

this is going from a 12 volt source to the seeeduino then from seeeduino to brick and the brick will go out to 2 push buttons which will be used to turn on and turn off both the eye movements and the leds in the eyes.

I've got a few bricks. They are covered in mortar and make lousy conductors. I hope you have better luck. Wires might be easier to use, though. Certainly lighter.

There are no LEDs listed. We'd need to know what kinds of LEDs you have to know whether all that stuff you listed is really necessary. Most LEDs are very easy to control. Set a pin HIGH and the LED comes on. Set the pin LOW, and the LED turns off.

pos=random(65,115); // ramdomly set the servo arm postion between 65 & 115 degrees.

The value in pos will be 65 or more, but not more than 114. If you need the servo to get to 115, the 2nd argument in the call to random needs to be 116.

If you combine those two codes, the LEDs won't blink while the servos are moving, and the servos won't move while the LEDs are blinking.

thank you for the reply and helping me out. the leds i have are just 3mm ultra bright red component leds. i am only using 2 of these, 1 for each eye.

would you be able to help me with a code for these by any chance. im not a programmer but i just really wanna get this idea on my vehicle for the show coming up

First thing we need to know:

If you combine those two codes, the LEDs won't blink while the servos are moving, and the servos won't move while the LEDs are blinking.

Is this a problem?

no it does not matter when the leds blink, all that matters is the leds are just on while they move, i dont care if they blink only when the servo is stationary

Did you try to copy&paste everything from one sketch to the other?

Copy all variables from one to the other (everything above setup())
Then the contents of the setup() from one to the other (what's between the { and } )
Then the same for loop() (again, between { and })
Last step, copy everything between setup() and loop() and everything below loop()

like this

#include <Servo.h> //include the servo libary - a bunch of code for a host of servo instructions y9ou can use and don't have to develop yourself

Servo myservo; // create servo object to control a servo

int pos = 0; // variable to store the servo position
int delay1 = 0; // variable to store the delay between servo arm's movement info

int ledPin = 13; // LED connected to digital pin 13
long randOn = 0; // Initialize a variable for the ON time
long randOff = 0; // Initialize a variable for the OFF time

void setup()

{

myservo.attach(9); // attaches pin 9 of the micro controller to the servo object - the servo's "control wire"

randomSeed (analogRead (0)); // randomize
pinMode(ledPin, OUTPUT); // sets the digital pin as output

}

void loop()

{
pos=random(65,115); // ramdomly set the servo arm postion between 65 & 115 degrees. "90" is "straight ahead"
delay1=random(50, 500); // randomly set delay between servo movement between 50 and 500 milliseconds
myservo.write(pos); // tell servo to go to position specified by variable ‘pos’ value
delay(delay1); // waits randomly between 50ms and 500 ms between servo movements

randOn = random (100, 1200); // generate ON time between 0.1 and 1.2 seconds
randOff = random (200, 900); // generate OFF time between 0.2 and 0.9 seconds
digitalWrite(ledPin, HIGH); // sets the LED on
delay(randOn); // waits for a random time while ON
digitalWrite(ledPin, LOW); // sets the LED off
delay(randOff); // waits for a random time while OFF

}