ja du hattest recht es war was mit dem Taster nicht in Ordnung der hatte nicht den richtigen Kontakt typisch Steckbrett eben jetzt geht alles wie ich mir das vorstelle später kommt noch ein 3 * 7Segment anzeige für die Ausgabe in % hinzu
hir mein aktueller code

Code:
/*
  Analog Input

 
*/
#include "OneButton.h"

#define MOTOR_1  A2
#define MOTOR_2  A4
#define POTI     A0
#define PWM      9
#define TASTER   5

#define LED      3

bool sto = 0;
bool drehrichtung = 0;




//void clickedIt();
OneButton button(TASTER, true);
//int poti = A0;    // select the input pin for the potentiometer

int poti_Value = 0;  // variable to store the value coming from the sensor

int poti_prozent = 0;
bool sicherheit = 1;

void setup() {
  
 Serial.begin(9600);

  pinMode(LED,OUTPUT);
  //pinMode(TASTER,INPUT_PULLUP);
  pinMode(MOTOR_1,OUTPUT);
  pinMode(MOTOR_2,OUTPUT);
  pinMode(PWM,OUTPUT);
  digitalWrite(LED, LOW); 
  poti_prozent = 4;
  // Sicherheitsschaltung Poti auf 0 und Motor Aus
  

  //pinMode(TASTER, INPUT);
  button.attachClick(clickedIt);
  button.attachDoubleClick(doubleClickedIt);

  
      while( poti_prozent >= 3 )
      {  
           Serial.println("Poti zu Hoch ! ! !");
           digitalWrite(MOTOR_1, HIGH);
           digitalWrite(MOTOR_2, HIGH);
           digitalWrite(LED, HIGH);
           delay(60); 
          poti_Value = analogRead(POTI);
          poti_prozent = map(poti_Value, 0,1023, 0,100);
           digitalWrite(LED, LOW);
           delay(60);
          
      }

        
}
bool Drehrichtung = true;

void loop() {
 button.tick();
 stopp();
 if(drehrichtung == 1)
 {
    button.tick();
    drehrichtun();
 }
       
  //void clickedIt();
  
  int pwmSpeed;

  
  if(Drehrichtung == true)
  {
       button.tick();
       stopp();
 
 // LED Drehrichtung Rechts 
 digitalWrite(LED, LOW);
 
  poti_Value = analogRead(POTI);
  poti_prozent = map(poti_Value, 0,1023, 0,100);

       button.tick();
        stopp();
  
  // Ausgabe
  Serial.print("Rechts Poti = ");
  Serial.print(poti_prozent);
  Serial.println("% ");

       button.tick();
        stopp();
  
  
  // Drehrichtung Rechts
  digitalWrite(MOTOR_1, LOW);
  digitalWrite(MOTOR_2, HIGH);
  
  // Geschwindigkeit regeln
  analogWrite(PWM, poti_Value / 4);

       button.tick();
        stopp();
  
  
  }
  else
  {
        button.tick();
        stopp();
  //void clickedIt();
  
  // LED Drehrichtung Links
  digitalWrite(LED, HIGH);

  poti_Value = analogRead(POTI);
  poti_prozent = map(poti_Value, 0,1023, 0,100);

       button.tick();
        stopp();
  
  // Ausgabe
  Serial.print("Links Poti = ");
  Serial.print(poti_prozent);
  Serial.println("% ");

       button.tick();
        stopp();

  // Drehrichtung Links 
  digitalWrite(MOTOR_1, HIGH);
  digitalWrite(MOTOR_2, LOW);
  
  // Geschwindigkeit regeln
  analogWrite(PWM, poti_Value / 4);
  
         button.tick();
        stopp();
  
  }




  
}

void clickedIt()
{

drehrichtung = 1;
  
 }
 
void doubleClickedIt()
{
  sto = !sto;
  
 }

 void stopp(void)
{
  while(sto == true )
  {
   button.tick();
  digitalWrite(MOTOR_1, HIGH);
  digitalWrite(MOTOR_2, HIGH);

   Serial.println("STOPP!!!");
  
  
  digitalWrite(LED, HIGH);
  delay(50);
  button.tick(); 
    delay(50);
  button.tick(); 
    delay(50);
  button.tick();
    delay(50);
  button.tick(); 
    delay(50);
  button.tick();  
  digitalWrite(LED, LOW);
  delay(50);
  button.tick(); 
    delay(50);
  button.tick(); 
    delay(50);
  button.tick();
    delay(50);
  button.tick(); 
    delay(50);
  button.tick(); 
  
  }
  
}

void drehrichtun(void)
{
  Drehrichtung = !Drehrichtung;
  
  digitalWrite(MOTOR_1, HIGH);
  digitalWrite(MOTOR_2, HIGH);
  
  
  digitalWrite(LED, HIGH);
  delay(100); 
  digitalWrite(LED, LOW);
  delay(100);
  digitalWrite(LED, HIGH);
  delay(100); 
  digitalWrite(LED, LOW);
  delay(100);
  drehrichtung = 0;
}