Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Calculated Variable Celsius to Fahrenheit DS18

Home Forums Mayfly Data Logger Calculated Variable Celsius to Fahrenheit DS18

Viewing 14 reply threads
  • Author
    Posts
    • #15133
      BrianJastram
      Participant
        My problem is that during compilation I get the error below.
        I’m trying to convert the Celsius reading from my DS18 to Fahrenheit by using the baro_rho_correction sketch as a guide. I feel like
      • #15134
        Sara Damiano
        Moderator
          In line 237 you don’t need the “new” or anything else with the calcTempF.

          Replace new CalcTempF(&ds18, "12345689-abcd-1234-ef00-1234567890ab"), with just Calc

        • #15135
          Sara Damiano
          Moderator
            Does that make sense?

            So, for example, in line 178 you created a variable for the DS18 (Variable *ds18Temp = new MaximDS18_Temp(&ds18, "12345678-abcd-1234-ef00-1234567890ab");) Since

          • #15138
            BrianJastram
            Participant
              Awesome, thank you. That solved the error. I was wondering about my variable array because I saw the format of the variable array in the baro_rho_correction sketch and it was more bare bones.
              Now I
            • #15139
              BrianJastram
              Participant

                Now I got it to be 33.8 F by replacing
                float TempF = TempCFromMaxiumDS18_Temp*1.8+32 with
                float TempF = true*1.8+32

              • #15140
                Sara Damiano
                Moderator
                  -17966.20 does seem a little bit cold for most offices.  Did you change your variable array so it has the ds18Temp named variable in it instead of the other new variable?  If not update
                • #15141
                  Sara Damiano
                  Moderator

                    You can throw a Serial.println(TempCFromMaxiumDS18_Temp); into the middle of your calculation equation just for testing.  I can try testing your code myself later this afternoon.

                  • #15142
                    BrianJastram
                    Participant

                      I tried just DS18Temp but that didn’t work.
                      The Celsius temperature from the DS18 is a reasonable 22.25 degrees.

                    • #15143
                      Sara Damiano
                      Moderator
                        Hm.  Can you post your current code? I’ll try running it.  I have a DS18 here so hopefully once I attach things and start trying to run them whatever issue I’m missing will jump out at m
                      • #15144
                        BrianJastram
                        Participant
                          Yes, thank you. Here it is.

                        • #15145
                          BrianJastram
                          Participant

                            There should be no u in Maxium in line 194.

                          • #15146
                            Sara Damiano
                            Moderator
                              The C-to-F is working for me with this calculation function:

                            • #15147
                              Sara Damiano
                              Moderator
                                Here’s the version without the extra un-needed BME code.  I left in all the code for the display.

                              • #15148
                                Sara Damiano
                                Moderator

                                  Sorry, the formatter and I were having an argument. I think it’s right now.

                                • #15149
                                  Sara Damiano
                                  Moderator
                                    The print-outs are always going to be updated about a minute behind because the board will go to sleep at the end of the logdata() function and won’t do the printing until the next
                                Viewing 14 reply threads
                                • You must be logged in to reply to this topic.