Editing Instrument control package
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 377: | Line 377: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
In the example case the temperature sensor is connected to the i2c-ch341-usb 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 385: | Line 385: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
To read the | 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 393: | Line 393: | ||
data = fread (i2cdev, 3); | data = fread (i2cdev, 3); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="octave" style="font-size:13px"> | <syntaxhighlight lang="octave" style="font-size:13px"> |