Servo and digital distance sensor cold help?

so i out this code that i made for my project, what the code is supposed to do is when the sensors output is triggerd the servo will move when i put the code in and run it on my adafruit trinket 3.3v the sensor turns on without anything in front of it and the servo does a 360 degree turn 2 times except it does it in 15ths so thats weird. anyways if anyone can help me revise my code that would be great thanks!

The code…

#include <Servo.h>

Servo servo_6;

void setup()
{
pinMode(1, OUTPUT);
servo_6.attach(6);

pinMode(8, OUTPUT);
}

void loop()
{
if (false) {
digitalWrite(1, HIGH);

}
servo_6.write(360);
if (false) {
digitalWrite(8, LOW);

}
servo_6.write(0);

}

Did you connect the grounds?

"if (false)" ?

Please remember to use code tags when posting code

  pinMode(1, OUTPUT);

Not a good idea to use pins 0 and 1 as they are used by the Serial interface. What have you got attached to pins 1 and 8 ?

 if (false)
  {
    digitalWrite(1, HIGH);
  }

What are you testing for true/false and why ?

  if (false)
  {
    digitalWrite(1, HIGH);
  }
  servo_6.write(360);
  if (false)
  {
    digitalWrite(8, LOW);
  }
  servo_6.write(0);

Not much time for the servo to move, is there ?

Is your servo a continuous rotation type (no position control)? If so, you can only control it's speed (somewhat), around 90 degrees, it should stand still, the farther from 90 (+ & -), the faster.

servo_6.write(360);looks unlikely too

UKHeliBob:
servo_6.write(360);looks unlikely too

aka writeMicroseconds