Jump to content
43oh

jxlbbb

Members
  • Content Count

    1
  • Joined

  • Last visited

Reputation Activity

  1. Like
    jxlbbb got a reaction from yosh in [Energia Library] OneWire DS18B20 (430 & Stellaris)   
    Hi, 
     
    Here is a small change to StellarisOW.ino that will provide full resolution without adding floats.
    the binary size remains very small :
    Binary sketch size: 4,771 bytes (of a 131,072 byte maximum) (MSP430F5529)   :
     
    change 
     
    byte result[MAXOW+5]; to  int32_t  result[MAXOW+5];   change the saveTemperature(uint8_t ROMno) routine to    void saveTemperature(uint8_t ROMno){   result[ROMno] = (int32_t)((data[1] << 8) | data[0]); }   change           Serial.print(result);  to             prt2((result*625)/100);   add the prt2 routine      void prt2(int x){     Serial.print(x/100);     Serial.print(".");     Serial.print(x%100); }     output is now   OW1=20.56C OW2=20.62C    Hope this will help some !   jxlbbb  
  2. Like
    jxlbbb got a reaction from OzGrant in [Energia Library] OneWire DS18B20 (430 & Stellaris)   
    Hi, 
     
    Here is a small change to StellarisOW.ino that will provide full resolution without adding floats.
    the binary size remains very small :
    Binary sketch size: 4,771 bytes (of a 131,072 byte maximum) (MSP430F5529)   :
     
    change 
     
    byte result[MAXOW+5]; to  int32_t  result[MAXOW+5];   change the saveTemperature(uint8_t ROMno) routine to    void saveTemperature(uint8_t ROMno){   result[ROMno] = (int32_t)((data[1] << 8) | data[0]); }   change           Serial.print(result);  to             prt2((result*625)/100);   add the prt2 routine      void prt2(int x){     Serial.print(x/100);     Serial.print(".");     Serial.print(x%100); }     output is now   OW1=20.56C OW2=20.62C    Hope this will help some !   jxlbbb  
×
×
  • Create New...