Changeset - 4455a7e86643
[Not reviewed]
default
0 1 0
drewp - 22 years ago 2002-07-12 10:00:10

added a note about the funny read order
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light8/serport.i
Show inline comments
 
@@ -31,12 +31,16 @@
 
  PyObject *read_all_adc(int file) {
 
    PyObject *t=PyTuple_New(4);
 
    
 
    #define CHAN_TO_TUPLE_POS(chan,idx) i2c_smbus_write_byte(file, chan);\
 
    PyTuple_SetItem(t,idx,PyInt_FromLong(i2c_smbus_read_byte(file)));
 

	
 
    /*
 
      these are shuffled here to match the way the pots read in. in
 
      the returned tuple, 0=left pot..3=right pot.
 
    */
 
    CHAN_TO_TUPLE_POS(1,0)
 
    CHAN_TO_TUPLE_POS(2,1)
 
    CHAN_TO_TUPLE_POS(3,2)
 
    CHAN_TO_TUPLE_POS(0,3)
 
      
 
    return t;
0 comments (0 inline, 0 general)