ZOETROPE - SWITCH STATE

THIS IS MY CODE:

const int controlPin1 = 2;
const int controlPin2 = 3;
const int enablePin = 9;
const int directionSwitchPin = 4;
const int onOffSwitchStateSwitchPin = 5;
const int potPin = A0;
int onOffSwitchState = 0;
int previousOnOffSwitchState = 0;
int directionSwitchState = 0;
int previousDirectionSwitchState = 0;
int motorEnabled = 0;
int motorSpeed = 0;
int motorDirection = 1;
void setup(){

    pinMode(directionSwitchPin, INPUT);
    pinMode(onOffSwitchStateSwitchPin, INPUT);
    pinMode(controlPin1, OUTPUT);
    pinMode(controlPin2, OUTPUT);
    pinMode(enablePin, OUTPUT);
    digitalWrite(enablePin, LOW);

}//Fin de la función setup.
void loop(){

    onOffSwitchState = digitalRead(onOffSwitchStateSwitchPin);
    if (onOffSwitchState != previousOnOffSwitchState)
    {
        Serial.println("El pulsador on/off cambia el estado...");
        if (onOffSwitchState == HIGH)
        {
            Serial.println("cuando es presionado...");
            motorEnabled = !motorEnabled;
        }
    }
    if (directionSwitchState != previousDirectionSwitchState) {
        if (directionSwitchState == HIGH) {
            motorDirection = !motorDirection;
        }
    }
    if (motorDirection == 1) {
        digitalWrite(controlPin1, HIGH);
        digitalWrite(controlPin2, LOW);
    }
    else {
        digitalWrite(controlPin1, LOW);
        digitalWrite(controlPin2, HIGH);
    }
    if (motorEnabled == 1) {
        analogWrite(enablePin, motorSpeed);
    }
    else {
        analogWrite(enablePin, 0);
    }
    previousDirectionSwitchState = directionSwitchState;
    previousOnOffSwitchState = onOffSwitchState;


}//Fin de la función loop.

SO, I NEED TO CHANGE THIS PART:

void loop(){

    onOffSwitchState = digitalRead(onOffSwitchStateSwitchPin);
    if (onOffSwitchState != previousOnOffSwitchState)
    {
        Serial.println("El pulsador on/off cambia el estado...");
        if (onOffSwitchState == HIGH)
        {
            Serial.println("cuando es presionado...");
            motorEnabled = !motorEnabled;
        }
    }

FOR:

I HAVE TWO STATES ON THE SWITCH. 1 WHEN I PRESS THE SWITCH & OTHER WHEN I DROP IT.
I NEED THAT THE SWITCH CHANGE THE STATE WHEN I DROP IT.
PLEASE CAN YOU HELP ME? IT’S VERY IMPORTANT FOR ME TO BE SUCSSES ON MY MARK! THANKS FOR ALL!

THIS IS MY CODE

Which you have already posted in another thread while screaming your fool head off.

I HAVE TWO STATES ON THE SWITCH.

Yeah, pressed and not pressed.

You have some code that determines that the switch has changed state - from pressed to not pressed or from not pressed to pressed.

In that block, you deal with the case where the transition is from not pressed to pressed, but you complete ignore the case where the transition is from pressed to not pressed. Why?

PLEASE CAN YOU HELP ME?

Here's a hint. Use an else block.

IT'S VERY IMPORTANT FOR ME TO BE SUCSSES ON MY MARK!

It may be important TO YOU. It matters not at all to us, so quit screaming and start THINKING!

THIS IS SHOUTING W H E R E A S T H I S I S S C R E A M I N G ! I agree, normal voice is a much better way to communicate :-)