You are reading a single comment by @user7143 and its replies. Click here to read the full conversation.
  • Thanks, updated per your suggestion.

    If this works (I can't test - I don't have one of the chips on hand), I'll make a pull request this weekend.

  • I will test tomorrow but still think a couple of changes need to be made.

    var d = SPI1.send("\0\0\0\0",C0);  
    
    //needs to be changed to 
    
    var d = this.spi.send("\0\0\0\0",this.cs);
    
    

    This will allow more than one temp sensor to be connected and report temperature.

    The else statement needs to be added back in at the end. See my code above. The reason for this is you only want the temperature reported if everything is ok. If a fault code is displayed then you only want that code. If not you get the fault code as well as a incorrect temperature reading. Once this is done I will test again and let you know if it works.

    Really glad that I shared this code as I learnt a lot about OOP javascript today from everyones responses. Even though I have been reading a really good book on the subject, this thread really helped to cement all the pieces in place.

    So thank you to all who responded.

About

Avatar for user7143 @user7143 started