B4J Code Snippet MCP9808 reading temperature

Discussion in 'B4J Code Snippets' started by Coldrestart, Jan 29, 2018.

  1. Coldrestart

    Coldrestart New Member Licensed User

    Hello everyone,

    Here an example for using the MCP9808 sensor on a raspberry pi.
    This is only a code snippet, as it only read's the temperature.
    Not all the registers are implemented.
    Negative values aren't yet tested.

    This is a console application.

    Kind regards,
    Tim.

    *IMPORTANT UPDATE*
    The conversion from previous version was not correct.
    Java uses signed values, as the values to be calculated must be unsigned.
    Here the new adjusted version. Negative values aren't tested yet.
    *******************

    *IMPORTANT UPDATE 2*
    Latest version updatet for negative temperature measurement (tested)
    ********************
     

    Attached Files:

    Last edited: Feb 25, 2018
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice