Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error unknown typ name 'DS18B20'
Forum Updated to NodeBB v4.3 + New Features

Error unknown typ name 'DS18B20'

Scheduled Pinned Locked Moved Solved Mobile and Embedded
93 Posts 4 Posters 29.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M mrjj
    8 Jul 2020, 16:36

    hi
    I dont have a board so i dont have the Arduino software / libs installed so no #include "Arduino.h" etc.

    the uint8_t comes from
    #include <stdint.h>

    A Offline
    A Offline
    AlexKrammer
    wrote on 8 Jul 2020, 17:31 last edited by
    #17

    @mrjj i dont use arduino too. Raspberry Pi is what i use.
    The stdint.h is just a standart library or where can i get it?

    If this change remove the error do u thing when i type in a raspberry pin into the constructor e.g. 22 it will work?

    M 1 Reply Last reply 8 Jul 2020, 17:34
    0
    • A AlexKrammer
      8 Jul 2020, 17:31

      @mrjj i dont use arduino too. Raspberry Pi is what i use.
      The stdint.h is just a standart library or where can i get it?

      If this change remove the error do u thing when i type in a raspberry pin into the constructor e.g. 22 it will work?

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 8 Jul 2020, 17:34 last edited by
      #18

      @AlexKrammer
      Oh
      I just assume since it had Arduino included and most google searches talked about Arduino :)

      Well i just added
      #include <stdint.h>
      and it knew it.
      So its included on newer compilers.

      • If this change remove the error do u thing when i type in a raspberry pin into the constructor e.g. 22 it will work?

        Yes if it has that chip then yes.
        https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/

      A 1 Reply Last reply 8 Jul 2020, 18:45
      0
      • M mrjj
        8 Jul 2020, 17:34

        @AlexKrammer
        Oh
        I just assume since it had Arduino included and most google searches talked about Arduino :)

        Well i just added
        #include <stdint.h>
        and it knew it.
        So its included on newer compilers.

        • If this change remove the error do u thing when i type in a raspberry pin into the constructor e.g. 22 it will work?

          Yes if it has that chip then yes.
          https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/

        A Offline
        A Offline
        AlexKrammer
        wrote on 8 Jul 2020, 18:45 last edited by
        #19

        @mrjj
        And if i create a new class called "CheckTemlerature" how could i use the DS18B20 sensor.
        The first thing to open the constructor with input the Raspberry Pin.
        Second step Funktion getTemp?
        Third step close with destructor?
        Thanks for halp

        M 1 Reply Last reply 8 Jul 2020, 18:54
        0
        • A AlexKrammer
          8 Jul 2020, 18:45

          @mrjj
          And if i create a new class called "CheckTemlerature" how could i use the DS18B20 sensor.
          The first thing to open the constructor with input the Raspberry Pin.
          Second step Funktion getTemp?
          Third step close with destructor?
          Thanks for halp

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 8 Jul 2020, 18:54 last edited by
          #20

          @AlexKrammer
          Yes, it seems that way looking over the examples.

          are you using the
          DS18B20::DS18B20(const char* address) version or the other version using uint pin ?

          A 2 Replies Last reply 8 Jul 2020, 19:33
          0
          • M mrjj
            8 Jul 2020, 18:54

            @AlexKrammer
            Yes, it seems that way looking over the examples.

            are you using the
            DS18B20::DS18B20(const char* address) version or the other version using uint pin ?

            A Offline
            A Offline
            AlexKrammer
            wrote on 8 Jul 2020, 19:33 last edited by
            #21

            @mrjj
            I deleted the DS18B20::DS18B20(const char* address) version and try it with your idea. I hope it will work but ill see it tomorrow. Its enough for today.
            Thanks a lot.

            1 Reply Last reply
            1
            • M mrjj
              8 Jul 2020, 18:54

              @AlexKrammer
              Yes, it seems that way looking over the examples.

              are you using the
              DS18B20::DS18B20(const char* address) version or the other version using uint pin ?

              A Offline
              A Offline
              AlexKrammer
              wrote on 9 Jul 2020, 10:22 last edited by
              #22

              @mrjj
              Now i removed the
              #include "Arduino.h"
              #include <OneWire.h>

              and added #include <stdint.h>

              screenshot.png

              But now i receive the error massage with OneWire again.
              How did you solve that problem?

              The second fault is that the .cpp produced a lot of errors too.
              I think it depends on the OneWire file.

              screenshot.png
              How did you solve that problem?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 11 Jul 2020, 09:50 last edited by
                #23

                Hi
                That include file comes from
                https://www.pjrc.com/teensy/td_libs_OneWire.html
                But im not sure that works with a RaspberryPi directly.

                A 1 Reply Last reply 11 Jul 2020, 09:53
                0
                • M mrjj
                  11 Jul 2020, 09:50

                  Hi
                  That include file comes from
                  https://www.pjrc.com/teensy/td_libs_OneWire.html
                  But im not sure that works with a RaspberryPi directly.

                  A Offline
                  A Offline
                  AlexKrammer
                  wrote on 11 Jul 2020, 09:53 last edited by
                  #24

                  @mrjj
                  that to files OneWire.h and OneWire.cpp include also like DS18B20 as existing File?

                  M 1 Reply Last reply 11 Jul 2020, 10:01
                  0
                  • A AlexKrammer
                    11 Jul 2020, 09:53

                    @mrjj
                    that to files OneWire.h and OneWire.cpp include also like DS18B20 as existing File?

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 11 Jul 2020, 10:01 last edited by
                    #25

                    @AlexKrammer
                    Yes but im not sure it will just work with a pi board.

                    A 2 Replies Last reply 11 Jul 2020, 10:03
                    0
                    • M mrjj
                      11 Jul 2020, 10:01

                      @AlexKrammer
                      Yes but im not sure it will just work with a pi board.

                      A Offline
                      A Offline
                      AlexKrammer
                      wrote on 11 Jul 2020, 10:03 last edited by
                      #26

                      @mrjj
                      its even dont work on my windows pc ^^

                      1 Reply Last reply
                      0
                      • M mrjj
                        11 Jul 2020, 10:01

                        @AlexKrammer
                        Yes but im not sure it will just work with a pi board.

                        A Offline
                        A Offline
                        AlexKrammer
                        wrote on 11 Jul 2020, 10:06 last edited by AlexKrammer 7 Nov 2020, 10:08
                        #27

                        @mrjj
                        There are still error. i dont know, why you dont receive that errors respectively when you try to compile the code, why its work. if i try to run it, there are hundreds of error messages.
                        Unbenannt.JPG

                        M 1 Reply Last reply 11 Jul 2020, 10:09
                        0
                        • A AlexKrammer
                          11 Jul 2020, 10:06

                          @mrjj
                          There are still error. i dont know, why you dont receive that errors respectively when you try to compile the code, why its work. if i try to run it, there are hundreds of error messages.
                          Unbenannt.JPG

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 11 Jul 2020, 10:09 last edited by mrjj 7 Nov 2020, 10:18
                          #28

                          @AlexKrammer
                          Well i didnt download and added OneWire to see. Maybe why.
                          Just checkout DS18B20 as question started with.
                          I dont have a board to test on so i would never be able to run it anyway.

                          Thats just #include <stdio.h> it complains about.
                          Very odd the .h does not include that.

                          Also, you do understand that these libs are meant to be used ON the board.?
                          They can never read a sensor on a pi board where apps run on win pc and have the pi board connected via USB
                          or similar.
                          But you do seem to have a raspberry Debian running so you are compiling directly on the board, right ?

                          A 1 Reply Last reply 11 Jul 2020, 10:21
                          0
                          • M mrjj
                            11 Jul 2020, 10:09

                            @AlexKrammer
                            Well i didnt download and added OneWire to see. Maybe why.
                            Just checkout DS18B20 as question started with.
                            I dont have a board to test on so i would never be able to run it anyway.

                            Thats just #include <stdio.h> it complains about.
                            Very odd the .h does not include that.

                            Also, you do understand that these libs are meant to be used ON the board.?
                            They can never read a sensor on a pi board where apps run on win pc and have the pi board connected via USB
                            or similar.
                            But you do seem to have a raspberry Debian running so you are compiling directly on the board, right ?

                            A Offline
                            A Offline
                            AlexKrammer
                            wrote on 11 Jul 2020, 10:21 last edited by AlexKrammer 7 Nov 2020, 10:23
                            #29

                            @mrjj
                            Now I includes #include <stdio.h> in ds18b20.cpp but nothing changed.
                            the error C1083 does not depend on stdio.h, does it?

                            yes i have both systems running.

                            M 1 Reply Last reply 11 Jul 2020, 10:25
                            0
                            • A AlexKrammer
                              11 Jul 2020, 10:21

                              @mrjj
                              Now I includes #include <stdio.h> in ds18b20.cpp but nothing changed.
                              the error C1083 does not depend on stdio.h, does it?

                              yes i have both systems running.

                              M Offline
                              M Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on 11 Jul 2020, 10:25 last edited by mrjj 7 Nov 2020, 10:26
                              #30

                              @AlexKrammer
                              Ok. Good. Just checking
                              No that error comes from some missing .h file. As it shows.
                              From the utils folder
                              https://github.com/PaulStoffregen/OneWire/tree/master/util
                              so you should add those too it seems.

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                AlexKrammer
                                wrote on 11 Jul 2020, 10:31 last edited by
                                #31

                                oh thanks. that i missed. but its funny. i have the same errors on windows and raspien.
                                i think it dont depend where to compily. The only different i think will be, on raspberry will the outputs work. Dont you think?

                                M 1 Reply Last reply 11 Jul 2020, 10:34
                                0
                                • A AlexKrammer
                                  11 Jul 2020, 10:31

                                  oh thanks. that i missed. but its funny. i have the same errors on windows and raspien.
                                  i think it dont depend where to compily. The only different i think will be, on raspberry will the outputs work. Dont you think?

                                  M Offline
                                  M Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on 11 Jul 2020, 10:34 last edited by
                                  #32

                                  @AlexKrammer
                                  Well it should give same errors from compile on both systems if they are related to missing includes.
                                  What are the errors now ?

                                  Still bitRead etc ?

                                  And yes, the biggest difference is when you run it. On win pc there would be no hardware to to talk to.

                                  A 1 Reply Last reply 11 Jul 2020, 11:04
                                  0
                                  • M mrjj
                                    11 Jul 2020, 10:34

                                    @AlexKrammer
                                    Well it should give same errors from compile on both systems if they are related to missing includes.
                                    What are the errors now ?

                                    Still bitRead etc ?

                                    And yes, the biggest difference is when you run it. On win pc there would be no hardware to to talk to.

                                    A Offline
                                    A Offline
                                    AlexKrammer
                                    wrote on 11 Jul 2020, 11:04 last edited by
                                    #33

                                    @mrjj no but much more ^
                                    screenshot.png

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on 11 Jul 2020, 11:13 last edited by
                                      #34

                                      Hi
                                      Seems to come from
                                      https://www.arduino.cc/reference/en/language/functions/interrupts/nointerrupts/

                                      So I think we are down the wrong path using this with a pi board as it seems tied to
                                      Arduino.

                                      A 1 Reply Last reply 11 Jul 2020, 11:18
                                      0
                                      • M mrjj
                                        11 Jul 2020, 11:13

                                        Hi
                                        Seems to come from
                                        https://www.arduino.cc/reference/en/language/functions/interrupts/nointerrupts/

                                        So I think we are down the wrong path using this with a pi board as it seems tied to
                                        Arduino.

                                        A Offline
                                        A Offline
                                        AlexKrammer
                                        wrote on 11 Jul 2020, 11:18 last edited by
                                        #35

                                        @mrjj
                                        and what will be the right way. is it possible to use qt for this?
                                        is it possible to create a own library to convert the input of the sensor in a temperatur?

                                        M 1 Reply Last reply 11 Jul 2020, 11:21
                                        0
                                        • A AlexKrammer
                                          11 Jul 2020, 11:18

                                          @mrjj
                                          and what will be the right way. is it possible to use qt for this?
                                          is it possible to create a own library to convert the input of the sensor in a temperatur?

                                          M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 11 Jul 2020, 11:21 last edited by
                                          #36

                                          @AlexKrammer
                                          Hi
                                          But do you have such sensor ?
                                          and hook it up to the board like they do here ?
                                          https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/

                                          A 1 Reply Last reply 11 Jul 2020, 11:26
                                          0

                                          26/93

                                          11 Jul 2020, 10:03

                                          67 unread
                                          • Login

                                          • Login or register to search.
                                          26 out of 93
                                          • First post
                                            26/93
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved