Go Down

Topic: 2 codes in 1 software (Read 509 times) previous topic - next topic

florin

Hi!

I have made 2 different softwares in Arduino IDE. I want to make a software like: first code
                                                                                                                delay(500000)
                                                                                                                second code
                                             

How i can call that 2 softwares in one?                                                                                                       












     

PaulS

Quote
I have made 2 different softwares in Arduino IDE.

You've shown 0 of them.

Quote
I want to make a software like: first code
                                                                                                                delay(500000)
                                                                                                                second code

Feel free.

Quote
How i can call that 2 softwares in one?

Without seeing your code? No clue.

If one sketch is for reading RFID cards, and one is for watering plants, why do you want to combine them? Why the 6 minute and 20 second delay? Seems like a strange interval.

What happens when the second code finishes? The first will be run again, immediately. Is that OK?

florin

The full software will run non-stop.Software will run the first code(wich contain functions), than wait 5 minutes , than run the second code. When the second code is end,  repeat non- stop the full code.

fungus


The full software will run non-stop.Software will run the first code(wich contain functions), than wait 5 minutes , than run the second code. When the second code is end,  repeat non- stop the full code.


So...what's the problem? What prevents you from doing this?

Code: [Select]

void loop()
{
  code1();
  delay(500000)
  code2();
}



No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

florin

I need to run first code for a time interval, than code 2 for another time interval.

AWOL

Have a look at the blink without delay example, without delay.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

florin

I have made a circuit for the code below:
Code: [Select]

void loop(){

time=millis();

while(millis()-time<10000)
{
    first code
}

time=millis(); 

while(millis()-time<10000)
{
   
}

}


The circuit run the first code for ten seconds, than the second code for 10 second, than first code for ten 10 seconde and than STOP. Why?

billroy

Can't say without seeing all your code (post it all, please), but at a guess you may have declared time as an int instead of an unsigned long.  At least that is what usually causes weird behavior during the first 30 seconds after startup.

-br
http://bitlash.net

Go Up