From: Dave H. <dhy...@gm...> - 2007-10-08 03:48:09
|
Hi Peck Hui, > I'm sorry to post this question here as I'm a newbie to Gumstix and c-programming. Can I ask if anyone is willing to share with me any simple i2c scripts that I can take reference on so that I can start collecting some useful data using one of the ADC channels in the robostix? The only script I have is called servo and it can be found in the robostix/gumstix/i2c-io directory. > My basic application is just to make use of the gumstix to collect data online via the ADC in the robostix and stores it in the CF card. > > I've sucessfully configured the gumstix and robostix (I hope!!) to communicate via the i2c (as given in the Gumstix tutorial) and and I even managed to get single values (analog outputs) from a measuring system using the i2c-io commands (i.e. i2c-io 0x0b get adc.0), which I learnt in (http://docwiki.gumstix.org/Robostix_i2c-io). > > I'm confused by some of the examples which I saw in the SVN (http://docwiki.gumstix.org/Robostix_samples#Simple_samples), in particular the a2d_10.c and Read-ADC.c (http://svn.gumstix.com/gumstix-buildroot/branches/users/ddiall/robostix/Read-ADC/Read-ADC.c). Could you be more specific? a2d_10.c is C code which runs on the ATMega128 on the robostix. The i2c-io scripts run on the gumstix and communicate with the i2c-io code on the robostix. Read-ADC.c seems to just call a2d_10 function (which returns a 10-bit result from the A/D converter). There is also an a2d_8.c which returns 8 bit values instead. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |