Show Posts
Pages: 1 ... 3 4 [5] 6
61  Using Arduino / Project Guidance / Re: call function on: January 07, 2013, 04:57:14 pm

You just call your function like this:

Delay_function();

When it is finished doing what it should, program flow will be returnd to where you called it from.
i need when make specific action such as press switch exit from Delay_function() and back to the void loop (), what order can i used 
62  Using Arduino / Project Guidance / call function on: January 07, 2013, 04:42:28 pm
Code:
const int Sensor1 = 2 ;
int i;
void setup ()
{
  pinMode(Sensor1,INPUT);
}
void loop ()
{Sensor_1:
 // statement...............
}

void delay_function ()
{
for(i=0;i<10000;i++)
  {
  if (digitalRead(Sensor1) == 0)
     {
       goto Sensor_1 ;
     }
  }
}

can i use goto function to Transfers program flow between different functions such as goto from void delay_function()  to void loop()
63  Using Arduino / Project Guidance / timer0 UNO r3 using (ATmega328p) on: January 04, 2013, 08:45:49 am
i need to enable timer0 and when reach to 256 give flag
64  Using Arduino / Project Guidance / Re: clock (second and minutes) on: January 04, 2013, 05:02:05 am
how i can set timer in arduino
65  Using Arduino / Project Guidance / clock (second and minutes) on: January 04, 2013, 04:52:23 am
i need make clock display second and minutes using arduino UNO R3
66  Using Arduino / Project Guidance / Re: can i connect two arduino UNO together on: December 26, 2012, 04:10:26 am
Yep.

With ordinary serial just connect RX from board A to TX on Board B, TX from Board A to RX on Board B and very important connect ground from board A to ground on board B.
Not need any code for interface
67  Using Arduino / Project Guidance / can i connect two arduino UNO together on: December 26, 2012, 03:36:10 am
i need to send and receive data from UNO board to another one
68  Using Arduino / Project Guidance / LCD on: December 24, 2012, 05:50:03 am
Code:
lcd.setCursor(0,2);
lcd.print(line_percentage);
lcd.print("%");

when this code print in LCD give three number such as( 100%)  and when give two number (85%%) and when give  one number (0%%%)
i need to out (100%)  & (85%) & (0%)
69  Using Arduino / Project Guidance / avrdude stk500_getsync not in sync resp 0x00 for UNO R3 on: December 23, 2012, 02:01:13 pm
board suddenly give me this message (avrdude  stk500_getsync    not in sync  resp 0x00) when upload any program
70  Using Arduino / Installation & Troubleshooting / avrdude stk500_getsync (): not in sync: resp=0x00 for UNO R3 on: December 23, 2012, 01:52:33 pm
the board suddenly show this message (avrdude  stk500_getsync (): not in sync: resp=0x00)   when upload any program !!!
71  Using Arduino / Project Guidance / Re: LCD show variable output on: December 23, 2012, 08:03:09 am
I mean the output shown in LCD appear small time  then disappear and repeat i need appear at all time
72  Using Arduino / Project Guidance / LCD show variable output on: December 23, 2012, 07:22:34 am
i need to show variable output without blinking in output and i need when the value of variable output change the LCD show this change
73  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:58:13 pm
Code:
if(analogRead(sensor)==1023)
  {
   if(!flagged) 
    {  if (inputsignal == 1)                     // i need print "x" when analogRead(sensor)==1023 and when inputsignal == 1
        {
          Serial.print("x");
          Serial.println();
          flagged = 1;     
        }
    }   
  }
  else flagged =0;
please check this i need
74  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:34:56 pm
You just need to keep track of past reading through the main loop:


Code:
const int sensor = A0; // analog input use variable resistance
int flagged = 0;  

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

void loop ()
{
  if(analogRead(sensor)==1023)//when variable resistance give value =1023 print 'x'
  {
   if(!flagged)
    {                             // i need to add if condition here and when it valid print "X"  , my problem: when i add if condition not print "x"
      Serial.print("x");
      Serial.println();
      flagged = 1;
    }
   else flagged =0;
  }
 
   delay (1000);
}
i need to add if condition as i shown in code
75  Using Arduino / Project Guidance / Re: stay in the same value of analog input give output one time on: December 20, 2012, 01:27:19 pm
Your "x" never equals 1, because there is no input for it to change to 1 and at the top you have it as 2.

What are you trying to do with the code, what is its purpose?

The original code was to print out "x" only ONCE, if it equaled 1023 and if the input changed to a new number and then back to 1023.

ok i need add if condition before print "x" to the original code ( print " x " when if condition is valid ) 
Pages: 1 ... 3 4 [5] 6