On Mon, Aug 20, 2012 at 12:37 AM, Andrius Sutas <andrius.su...@gmail.com> wrote: > Hi everyone, > > I would like to announce a public commit for i2c package in main/i2c. Also, > snapshot attached for testing convenience. > > Simple example: > Assume we are working with AD7991 ADC ( goo.gl/TsFMZ ) and our i2c adapter > is at /dev/i2c-0 (hint: nodes are usually created by i2c-dev module) > > pkg load i2c > > adc = i2c("/dev/i2c-0"); # Open the interface > i2c_addr(adc, bin2dec(00101001)); # Set i2c slave address, see datasheet > (Table 8) > > # Reads all 4 channels > for i = 1:4 > data = i2c_read(adc, 2) > endfor > > i2c_write(adc, uint8( [bin2dec("01000000")] )) # Enable only CH2, see > datasheet (Table 9) > > # Reads ch2, 4 times > for i = 1:4 > [data, count] = i2c_read(adc, 2) > endfor > > i2c_close(adc) > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Octave-dev mailing list > Octave-dev@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/octave-dev >
Hi Andrius, Thank you very much. I haven't testes i2c yet, but I will do it soon. I am very curious! I just went again through the code and I see no documentation yet. Please understand that documentation is a very important (I would say critical) art of your programming activity. Without documentation your code is not as valuable as it could be! Please document serial and i2c properly before continuing developing code. It is not only necessary to add comments to your code, but also (and this is necessary if you want your project to be released publicly, or ever migrate to core) add documentation for the user in the help string. Do not underestimate the time and difficulty of documenting your functions. A professor of mine used to say documenting is about 30% of the time of a project. Keep up the good job. -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Zürich http://ailab.ifi.uzh.ch/carbajal/ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev