Show Posts
Pages: 1 ... 4 5 [6]
76  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:10:03 pm
do you add if condition    if (x==1) 
77  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:08:39 pm
const int sensor = A0; // analog input use variable resistance
const int x = 2;
int flagged = 0;  // create a flag variable

void setup ()
{
  pinMode(x,INPUT);
  Serial.begin (9600);
}

void loop ()
{
  if(analogRead(sensor)==1023)//when variable resistance give value =1023 print 'x'
  {
   if(!flagged)   // if already printed out an x, don't repeat unless a less then 1023 reading has occured
    {
      if (x==1)
      {
        Serial.print("x");
        Serial.println();
      }
      flagged = 1;      // set flag to note the we have printed an x on first new reading of a 1023 value
    }
   
  }
  else flagged =0;  // we read a value less then 1023 so clear flag so next time a 1023 will print an x
 
 delay (1000);
}
78  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:01:03 pm
please Lefty , i have problem when i add if condition x not print   
79  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 18, 2012, 03:46:11 pm
yes that i need   smiley-grin  smiley-grin  smiley-grin  , please can you add line comment to help me to understand the code 
thanks smiley-grin smiley-grin
80  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 18, 2012, 03:32:59 pm
@ retrolefty  : this code give  me the same result when i stay in this value (1023) 'x' repeated
81  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 18, 2012, 02:48:51 pm
please , can you give me an example on signal edge detection or any link explain it
82  Using Arduino / Project Guidance / stay in the same value of analog input give output one time on: December 18, 2012, 02:38:57 pm
const int sensor = A0; // analog input use variable resistance 

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

void loop ()
{
  if(analogRead(sensor)==1023)//when variable resistance give value =1023 print 'x'
  {
    Serial.print("x");
    Serial.println();
  }
 
   delay (1000);
}
  // my proplem : when i stay in this value (1023) it repeated  print 'x' until i change this value, i need when i stay in (1023) print x one time and repeat it when i change the value of analug input and back to (1023)
83  Using Arduino / Project Guidance / How can i make array ? on: December 17, 2012, 11:39:31 am
i need help to understand array and an example on it
84  Using Arduino / Project Guidance / Re: How can i take 4 bit binary input on: December 17, 2012, 11:33:04 am
thanks  smiley-grin
85  Using Arduino / Project Guidance / Re: How can i take 4 bit binary input on: December 17, 2012, 11:12:40 am
when i used PIND that give weight of all pins on PORTD from 0 to 7 ,i only need weight of pins from 4 to 7   
86  Using Arduino / Project Guidance / Re: How can i take 4 bit binary input on: December 17, 2012, 09:04:42 am
i need to enter input value Randomly from 4 pin  such as 0000,0010,0100,1000,............ then save this value entered in memory called value  as 4 bit
then check the value saved
if (value==0010)
{

}
if (value==0100)
{

}

my problem i can't save the value input from pin 8,9,10,11 as four binary bit
87  Using Arduino / Project Guidance / Re: How can i take 4 bit binary input on: December 17, 2012, 08:15:37 am
please ,How can i used The  bitWrite() function     
88  Using Arduino / Project Guidance / How can i take 4 bit binary input on: December 17, 2012, 07:48:34 am
i want to take 4 bit binary input from 4 pin (8,9,10,11)
to count 0000,0001,0010,0011,0100,................
Pages: 1 ... 4 5 [6]