NEED HELP! Coding.

Write what? Where's the spec?

This is all i need.

CODE: 3 ping))) sensors that each control one vibration motor As the distance from the ping))) to the object decreases the speed of the vibration gets faster (you can code that however technical you want)

for example: One sensor will point at on object and two others won't have objects in front of it. As the object and the sensor get closer, the speed of the vibration increases. (Another Idea is that the vibration motors will periodically buzz and when the object gets closer, the time in which the buzzes happen will be less)

How about showing the code you have written so far. Sounds like a homework assignment that is comming due.

I assure you this is not a homework assignment. I just need this code to make this machine i'm making and i'm hoping a coder will help me.

/* Ping))) Sensor
  
   This sketch reads a PING))) ultrasonic rangefinder and returns the
   distance to the closest object in range. To do this, it sends a pulse
   to the sensor to initiate a reading, then listens for a pulse 
   to return.  The length of the returning pulse is proportional to 
   the distance of the object from the sensor.
     
   The circuit:
    * +V connection of the PING))) attached to +5V
    * GND connection of the PING))) attached to ground
    * SIG connection of the PING))) attached to digital pin 7
 */

// this constant won't change.  It's the pin number
// of the sensor's output:
const int pingPin = 7;

void setup() 
{
  // initialize serial communication:
  Serial.begin(9600);
}

void loop()
{
  // establish variables for duration of the ping, 
  // and the distance result in inches and centimeters:
  long duration, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  cm = microsecondsToCentimeters(duration);
  
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  
  delay(100);
}

long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}

That is the code I have. I need to write the vibration motor part and I need to add 2 more sensors without the need of printing.

My [u]limited[/u] experience of vibration motors (the eccentric weight variety, not the linear ones)is that speed is quite difficult to control. You could try pulsing the PWM on and off, and increase/decrease the pulsing frequency.

What have you tried?

That is the code I have. I need to write the vibration motor part and I need to add 2 more sensors without the need of printing.

You appear to have a reading comprehension problem, too. Back in reply #1, I showed you have to put the ping stuff in a function, and call that function.

You haven't done that yet. What are you waiting for?

In reply #3, I showed you a possible way to control the motor. You haven't implemented that code, yet, so you don't know whether it will work, or not.

If you send me your Arduino, your ping sensors, your vibration motors, and $50. I'll put them together for you. If that is not to your liking, get off your butt and try writing some code yourself.

This forum works best when we make suggestions, you try them, and provide feedback.

Your feedback so far consists mostly of "I don't understand" and "can you do that for me".