Go Down

Topic: malfunctioning.... (Read 1 time) previous topic - next topic

naeemuzz

so u mean the problem is wth ma circuit or program...thats affordable...my qstn will ther be chance that ma arduino is damaged??

Delta_G

This may come as quite a shock to you, but nobody here can see your code or your circuit.  So nobody here can possibly know if you've got a broken board or if you have made a mistake.  I'm betting you have a floating pin.  Common mistake for people to make.  But unless you want to show us the schematic and the code no one here will ever be able to tell you. 

naeemuzz

#7
Jan 18, 2013, 05:44 pm Last Edit: Jan 18, 2013, 06:09 pm by AWOL Reason: 1
Code: [Select]

int yel= 1;
int blue= 0;
int in=9;

void setup()
{
 pinMode(yel, OUTPUT);
 pinMode(blue, OUTPUT);
 pinMode(in, INPUT);
}

void loop()
{
 if(digitalRead(in)==HIGH)
 {
   for(int i=1;i<=5;i++)
   {
     digitalWrite(yel, HIGH);
     delay(1);
     digitalWrite(yel, LOW);
     delay(1);

     digitalWrite(yel, HIGH);
     delay(1);
     digitalWrite(yel, LOW);
     delay(1);

     digitalWrite(blue, HIGH);
     delay(1);
     digitalWrite(blue,LOW);
     delay(1);

     digitalWrite(blue, HIGH);
     delay(1);
     digitalWrite(blue, LOW);
     delay(1);
   }
 }
}


welll this my code...circuit is just ardui itself...snc pin 1 nd 0 are connectd to onbord leds i just tested testd it wth that...

Moderator edit: excess whitespace removed and CODE TAGS added.  Grrr.

retrolefty

Those delay(1) statements are not going to be able to be seen by human eye site as the eye can't detect a one millisecond blink of an led. Also you need to show the wiring of your digital input pin as that is what may or may not have a floating input pin condition.

Lefty

PeterH


circuit is just ardui itself


So nothing connected on pin 9? That means you have a floating input.

By the way, if you could take the trouble to write proper English rather than txtspk it would be appreciated.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up