QuoteNow let's say that I wanted to take temperature readings and then control a servo motor independently.What does this mean. You have one computer and two jobs. How can you expect to do them independently? Doing one right after the other (read the temps; diddle with the servo; read the temps; diddle with the servo) makes sense. Doing the two tasks independently requires two Arduinos. Help me understand what independently means to you.
Now let's say that I wanted to take temperature readings and then control a servo motor independently.
Maybe thermometer and servo are the independent parts?Gin, loop() is your friend. Every time through can be 100 microseconds or less later, if your code doesn't hang things up. Inside loop() you can have a block of code that watches the sensor and the next block of code runs the servo. Each runs then loop() starts again and loop() is perpetually 'now'... but only if your code doesn't block.
after the void setup (), then the void loop (), i put another loop ()
Quoteafter the void setup (), then the void loop (), i put another loop () No, you can't have two "loop"s.You could write "loop1" and "loop2", and call them one after the other inside "loop"
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16