I am at the planning stage of my project and would like to understand how the sampling on the analogue inputs works. I will probably purchase the Mega2560 and I have been reading datasheet doc2549.PDF & the protolab TutorialSensors site.( I'm still not allowed to post links yet)
My project is a interactive kiosk for a museum and it is planned that up to 4 users will control objects on screen using a 3D IDE like Unity3D. I hope to use a variety of input devices (flex sensors, pressure sensors). To keep things smooth I would like to sample the analogue inputs at 60 fps.
Is this possible? Can I sample each analogue input at this rate. It appears that there is one AD converter and it takes 13 clock cycles to complete a sample and a wait of 1 clock cycle before starting the next sample. Although some of the tutorials use a wait of 10ms.
My other option would be to use a separate board for each user and have 4 separate USB inputs? Any insights greatly appreciated.
60 samples per second is incredibly slow for an ATmega2560. It does indeed take ~13 clock cycles, but A/D converter clock frequencies are generally in the 50 kHz - 200 kHz range, so even at the slowest 50 kHz frequency 13 clocks is only 260 microseconds. You can sample 64 different analog objects (assuming you had 64 A/D channels!) in the span of time that represents 60 samples per second (16ms).
You've got plenty of time
--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons
@RuggedCircuits Hey thnxs for the feedback. My background is mainly software so I'm trying to get my head around some of these concepts.
Will the serial speed of 9600 bps along the USB cable be a problem. I noticed that the only way to get the data into my program is through a web service using UDP packets from the virtual COM port.
Apparently the IO.serial port on the Mac OSX platform isn't functional.