buzzer and vibraton motor wont work

In this code I am making 2 threads to work
every thread is connected to an ultrasonic sensor
if the distance is less than 10 cm
the vib and the buzzer should work
however, they are not working
but if I use leds , the leds works but it’s very faded
ps:the buzzer and the vibarton motor are not defective

#include <TimerThree.h> //Include the library corresponding to your Arduino.
#include "Thread.h"
#include "ThreadController.h"

//////////////vibration motor-buzzer/////////////
//defining pin numbers
const int vib = 5;
const int buzzer = 22;
// Create a new Class, called SensorThread, that inherits from Thread
class SensorThread: public Thread
   int trigPin; ////////////////ultrasonic sensors////////////////
   int echoPin ;
   int trigPin2 ;
   int echoPin2 ;
  float duration, distance;
  float duration2, distance2;
  int safetyDistance,safetyDistance2;
  // No, "run" cannot be anything...
  // Because Thread uses the method "run" to run threads,
  // we MUST overload this method here. using anything other
  // than "run" will not work properly...
  void run(){
    // Write a pulse to the HC-SR04 Trigger Pin
  digitalWrite(trigPin, LOW);// Clears the trigPin
  digitalWrite(trigPin, HIGH);// Sets the trigPin on HIGH state for 10 micro seconds to generate the ultrasound wave
  digitalWrite(trigPin, LOW);
  // Measure the response from the HC-SR04 Echo Pin
  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn(echoPin, HIGH);
  // Determine distance from duration// Calculating the distance
  // Use 343 metres per second as speed of sound
    distance = (duration / 2) * 0.0343;   // Reads the analog pin, and saves it localy
  digitalWrite(trigPin2, LOW);
  digitalWrite(trigPin2, HIGH);
  digitalWrite(trigPin2, LOW);
  // Measure the response from the HC-SR04 Echo Pin
  duration2 = pulseIn(echoPin2, HIGH);
  // Determine distance from duration
  // Use 343 metres per second as speed of sound
  distance2 = (duration2 / 2) * 0.0343;

  runned();  }

SensorThread analog1 = SensorThread();
SensorThread analog2 = SensorThread();
// Instantiate a new ThreadController
ThreadController controller = ThreadController();
// This is the callback for the Timer
void timerCallback(){;

void setup() { // put your setup code here, to run once:

  pinMode(analog1.trigPin, OUTPUT);
  pinMode(analog1.echoPin, INPUT);

  pinMode(analog2.trigPin2, OUTPUT);
  pinMode(analog2.echoPin2, INPUT);



void loop() {// put your main code here, to run repeatedly:

  Serial.print("Distance = ");
  Serial.println(" cm   a");
  analog1.safetyDistance = analog1.distance;
  if (analog1.safetyDistance <= 10){
  digitalWrite(vib, HIGH);
  digitalWrite(vib, LOW);}
  digitalWrite(vib, LOW);}

  Serial.print("Distance = ");
  Serial.println(" cm   b");
  analog2.safetyDistance2 = analog2.distance2;
  if (analog2.safetyDistance2 <= 10){
  digitalWrite(buzzer, HIGH); delay(2000); digitalWrite(buzzer, LOW);}
  else{digitalWrite(buzzer, LOW);}