the problem in noting me by vibrating signals

#include <Servo.h>.

const int trigPin = 10;

const int echoPin = 9;
const int buzzer = 8;

// defining time and distance

long duration;

int distance;

int safetyDistance ;

Servo myServo; // Object servo

void setup() {

pinMode(trigPin, OUTPUT); // trigPin as an Output

pinMode(echoPin, INPUT); // echoPin as an Input

pinMode ( buzzer , OUTPUT ) ;

Serial.begin(9600);

myServo.attach(7); // Pin Connected To Servo

}

void loop() {

// rotating servo i++ depicts increment of one degree

for(int i=0;i<=180;i++){

myServo.write(i);

delay(30);

distance = calculateDistance();

Serial.print(i);

Serial.print(",");

Serial.print(distance);

Serial.print(".");

safetyDistance = distance ;
if ( safetyDistance >= 10 ) {
digitalWrite ( buzzer , HIGH ) ;
delay(0.5);
}
else {
digitalWrite ( buzzer , LOW ) ;
delay(0);
}

}

// Repeats the previous lines from 180 to 0 degrees

for(int i=180;i>=0;i–){

myServo.write(i);

delay(30);

distance = calculateDistance();

Serial.print(i);

Serial.print(",");

Serial.print(distance);

Serial.print(".");
safetyDistance = distance ;
if ( safetyDistance >= 10 ) {
digitalWrite ( buzzer , HIGH ) ;
delay(0.5);
}
else {
digitalWrite ( buzzer , LOW ) ;
delay(0);
}
}

}

int calculateDistance(){

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

return distance;

}
it’s should notify me in right angle by vibrate 1 time “buz” , and notify again in the left angle by vibrate 2 time"buz"

And the question is?
Please go to the top of this page and read the sticky, "How to use this forum".

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

delay(0.5); :wink:

more specific details i don't understand

Syntax
delay(ms)
Parameters
ms: the number of milliseconds to pause. Allowed data types: ‘unsigned long’.

Sparkfun:
Below is a list of the data types commonly seen in Arduino, with the memory size of each in parentheses after the type name. Note: signed variables allow both positive and negative numbers, while unsigned variables allow only positive values.

boolean (8 bit) - simple logical true/false

byte (8 bit) - unsigned number from 0-255

char (8 bit) - signed number from -128 to 127. The compiler will attempt to interpret this data type as a character in some circumstances, which may yield unexpected results

unsigned char (8 bit) - same as 'byte'; if this is what you're after, you should use 'byte' instead, for reasons of clarity

word (16 bit) - unsigned number from 0-65535

unsigned int (16 bit)- the same as 'word'. Use 'word' instead for clarity and brevity

int (16 bit) - signed number from -32768 to 32767. This is most commonly what you see used for general purpose variables in Arduino example code provided with the IDE

unsigned long (32 bit) - unsigned number from 0-4,294,967,295. The most common usage of this is to store the result of the millis() function, which returns the number of milliseconds the current code has been running

long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647

float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38. Floating point on the Arduino is not native; the compiler has to jump through hoops to make it work. If you can avoid it, you should.