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)

Attachment: i2c-2012-08-19.tar.gz
Description: GNU Zip compressed data

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

Reply via email to