Pages: [1]   Go Down
Author Topic: Doing Two things at Once  (Read 654 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sure that this is possible, by the very nature of the thing, but is it possible to have the Arduino (in my case, Uno) do two completely unrelated things at one time?

As a basic example:  Have Arduino log temperature while also having it work a servo. 

I'm sure it's possible, I just haven't seen it talked about anywhere.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That is the basis of Blink without delay.

in loop,
check if 50mS has gone by, it if has do one thing.
at the next 50mS interval, do the other

both are done at same time, status checked/action taken every 100mS on each for this example.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Ah, there it is right there!  Thank you!
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 193
The people the people they see me and they know
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Of course you could always get a FPGA. But the trick to micros is figuring out how to do the most stuff in the best possible order and efficiently. Its like an art haha
Logged

Pages: [1]   Go Up
Jump to: