Editing Instrument control package

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 374: Line 374:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
In the example case the temperature sensor is connected to the i2c-ch341-usb device, and it is assumed the user has sufficient permissions to access the device.  
+
In the example case the temperature sensor is connected to the i2c-ch341-usb device, as as sufficient permissions to access the device as a user.  
  
 
According to the datasheet, the temperature device uses address 0x40, so create a i2c device using the linux device and address:
 
According to the datasheet, the temperature device uses address 0x40, so create a i2c device using the linux device and address:
Line 382: Line 382:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
To read  the temperature, register 0xF3 must be addressed and read (2 bytes of data):
+
To read  the termaturem register 0xF3 must be addressed and read (2 bytes of data):
  
 
<syntaxhighlight lang="octave" style="font-size:13px">
 
<syntaxhighlight lang="octave" style="font-size:13px">
Line 390: Line 390:
 
data = fread (i2cdev, 3);
 
data = fread (i2cdev, 3);
 
</syntaxhighlight>
 
</syntaxhighlight>
 
The data must be converted to a deg K value by making  16 bit number of the value and masking out unused bits.
 
  
 
<syntaxhighlight lang="octave" style="font-size:13px">
 
<syntaxhighlight lang="octave" style="font-size:13px">

Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: