Go Down

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

deanmsands3

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.


PaulS

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

Yes, you do know.

Check out the NewPing library.

Go Up