BMS_T2

Dependencies:   INA226

Revision:
3:61174d4de67d
Parent:
2:3bbbe439ec11
--- a/max6675_2.cpp	Tue Oct 13 06:26:34 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-
-#include <mbed.h>
-#include "max6675_2.h"
-
-max6675_2::max6675_2(SPI& _spi_2, PinName _ncs_2) : spi_2(_spi_2), ncs_2(_ncs_2) {
-
-}
-
-float max6675_2::read_temp_2() {
-    short value_2 = 0;
-    float temp_2 = 0;
-    
-    uint8_t highByte_2=0;
-    uint8_t lowByte_2=0;
-    
-    select_2();
-    wait(.25); //This delay is needed else it does'nt seem to update the temp
-
-    highByte_2 = spi_2.write(0);
-    lowByte_2 = spi_2.write(0);
-    deselect_2();
-
-
-    if (lowByte_2 & (1<<2)) {
-        error("No Probe");
-    } else {
-        value_2 = (highByte_2 << 5 | lowByte_2>>3);
-    }
-
-    temp_2 = (value_2*0.25); // Multiply the value by 0.25 to get temp in ˚C or
-                         //  * (9.0/5.0)) + 32.0;   // Convert value to ˚F (ensure proper floats!)
-
-return temp_2;
-}
-
-void max6675_2::select_2() {
-    ncs_2 = 0;
-}
-
-void max6675_2::deselect_2() {
-    ncs_2 = 1;
-}