Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

scardinale

Member Since 12 Apr 2013
Offline Last Active Sep 08 2019 06:48 PM
-----

#64539 I2C strange behavior

Posted by scardinale on 20 November 2015 - 01:48 AM

Glad to help.




#64535 I2C strange behavior

Posted by scardinale on 18 November 2015 - 11:49 PM

Try using this example from GHI's codeshare. It will tell you what the I2C address of your device is. If you get an value back it will tell you the 8bit address and verify that your setup is correct.

 

https://www.ghielect...share/entry/294




#64532 I2C strange behavior

Posted by scardinale on 18 November 2015 - 12:13 PM

That is true about the addressing but NetMF uses a 7-bit addressing scheme and automatically appends the correct bit when reading or writing internally. So all you need to do is supply the 8-bit address right shifted by one.




#64527 I2C strange behavior

Posted by scardinale on 18 November 2015 - 12:32 AM

0x40 is the 8 bit I2C address. NetMF uses 7 bit addressing, so try 0x40 >> 1 as your I2C Address.




#61542 How to add the missing byte shifter operators to a vb.net

Posted by scardinale on 06 February 2015 - 11:17 PM

Simpler yet is to add these two extension methods to your project.
 

<System.Runtime.CompilerServices.Extension> _
Public Shared Function RightShift(integerToShift As Integer, bitsToShift As Integer) As Integer
    Return CInt(integerToShift / 2 ^ bitsToShift)
End Function

<System.Runtime.CompilerServices.Extension> _
Public Shared Function LeftShift(integerToShift As Integer, bitsToShift As Integer) As Integer
    Return CInt(integerToShift * 2 ^ bitsToShift)
End Function



home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.