please use code tags per the how to use message in all the forums.
even easier:
while (digitalRead(buttonPin) == HIGH){
analogWrite(Fan, value); //PWM
Serial.println(value);
delay(100000000000);}
your issue is that value is not being updated correctly... just set a value for now and it will work... are you trying to increment value with the button push?
This looks like a mistake: you want it to wait like a billion seconds before the next time it's available? I would take it out completely.
delay(100000000000)
Paul__B:
Common sense suggests that you wire the button in series with the fan and it does just that. An Arduino - or other microcontroller - is not involved.
Perhaps your requirement is not what you have just described and you want it to do something else? If so, explain what that is.
I want the button to be separate from the arduino and bread board kind of like a remote control. When someones presses the button the fan would run until they let go kind of like a rc car or helicopter.
youser123:
I want the button to be separate from the arduino and bread board kind of like a remote control. When someones presses the button the fan would run until they let go kind of like a rc car or helicopter.
Then do like Paul_B suggests and use a momentary contact pushbutton of sufficient current ability.
Forget any Arduino.
Or is there more to this than you are saying............??????