Go Down

Topic: Managing Five US-100 Ultra-sonic sensors while managing serial data (Read 731 times) previous topic - next topic


I have an Arduino Mega 2560 I'm using in conjunction with a Pandaboard for a robot project. The Arduino is used for controlling motors and also reading distances from five US-100 ultra-sonic sensors.
The problem I'm running into is that pulsein isn't what I need. If the signal doesn't come back, the system will sit idly waiting for as long as 26ms, which isn't acceptable.
I most probably need an interrupt driven system, but I don't know yet.
What I have is this:
I'm sending and receiving serial data over the USB.
When the serial data comes in, I process it to either manipulate the motors, or get distance data from the sensors.
I will poll the sensors repeatedly and save the data instead of reading them "on demand."
What I'm worried about is dropping Serial information were I to move to an interrupt driven system.
Any suggestions?
Maybe I should use the micros() timer?
Know this that every soul is free.


I most probably need an interrupt driven system, but I don't know yet.

Yes, you do know.

Check out the NewPing library.
The art of getting good answers lies in asking good questions.

Go Up

Please enter a valid email to subscribe

Confirm your email address

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
Torino, 10131