I don't know what's the problem


hello guys, thats 1st topic! bad... have troubles simple codes... here provide code wrote today 5 min seems incorrect: :smiley-confuse:


int x=255;
int led=9;

void setup() {
  // put setup code here, run once:
  pinmode(led,output);
}

void loop() {
  // put main code here, run repeatedly:
  while(x=0){
  analogwrite(led,x);
  x=x-1;
  delay(3);
    if (x=0) {
      while(x=255){
        analogwrite(led,x);
        x=x+1;
        delay(3);
}
}
}
}



this code should fade led on pin 9 255 0 , after reaching x=0 x should raise
 again 255 , forever.  :o  :o  :o
p.s. new this...
please, in comments below, describe exact problem , provide code repaired.

code: [select]

while(x=0){
...
    if (x=0) {


oops.



Arduino Forum > Using Arduino > Programming Questions > I don't know what's the problem


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor