Pages: [1]   Go Down
Author Topic: 2 codes in 1 software  (Read 445 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?                                                                                                       












       
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 50243
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5655
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
void loop()
{
  code1();
  delay(500000)
  code2();
}


Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26489
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look at the blink without delay example, without delay.
Logged

"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.

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have made a circuit for the code below:
Code:
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?
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: