Pages: [1]   Go Down
Author Topic: Managing Five US-100 Ultra-sonic sensors while managing serial data  (Read 245 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Know this that every soul is free.

London
Offline Offline
Edison Member
*
Karma: 23
Posts: 1067
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code????
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 549
Posts: 46138
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Check out the NewPing library.
Logged

Pages: [1]   Go Up
Jump to: