Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. DHT11 Sensor with RPI

DHT11 Sensor with RPI

Scheduled Pinned Locked Moved Unsolved General and Desktop
graphrpidht11
13 Posts 2 Posters 1.8k Views
  • 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.
  • H helloworldddd

    @jsulm i cant figure out on how to plot a graph and display it with PlotWidget and pyqtgraph with the values taken from the sensor !

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @helloworldddd I never used PlotWidget or pyqtgraph and those are not part of Qt.
    You should consider reading some documentation/tutorial like https://www.learnpyqt.com/courses/graphics-plotting/plotting-pyqtgraph/
    Or check https://doc.qt.io/qt-5/qtcharts-index.html which is part of Qt.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    H 1 Reply Last reply
    0
    • jsulmJ jsulm

      @helloworldddd I never used PlotWidget or pyqtgraph and those are not part of Qt.
      You should consider reading some documentation/tutorial like https://www.learnpyqt.com/courses/graphics-plotting/plotting-pyqtgraph/
      Or check https://doc.qt.io/qt-5/qtcharts-index.html which is part of Qt.

      H Offline
      H Offline
      helloworldddd
      wrote on last edited by
      #5

      @jsulm ive also read up on using .csv files to plot the graph by using the values recorded. the examples shown were only fixed values. how do i plot the graph with values that just being recorded ?

      jsulmJ 1 Reply Last reply
      0
      • H helloworldddd

        @jsulm ive also read up on using .csv files to plot the graph by using the values recorded. the examples shown were only fixed values. how do i plot the graph with values that just being recorded ?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #6

        @helloworldddd said in DHT11 Sensor with RPI:

        how do i plot the graph with values that just being recorded ?

        Well, use the recorded values instead of the values from csv. I really don't get what exactly the problem is! Can you please be more specific?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        H 1 Reply Last reply
        0
        • jsulmJ jsulm

          @helloworldddd said in DHT11 Sensor with RPI:

          how do i plot the graph with values that just being recorded ?

          Well, use the recorded values instead of the values from csv. I really don't get what exactly the problem is! Can you please be more specific?

          H Offline
          H Offline
          helloworldddd
          wrote on last edited by
          #7

          @jsulm how do i get the recorded values and put it into a list and limit the list to like in 2 hour intervals with 20 mins as every point. and the time, which is the x axis to self increment?

          jsulmJ 1 Reply Last reply
          0
          • H helloworldddd

            @jsulm how do i get the recorded values and put it into a list and limit the list to like in 2 hour intervals with 20 mins as every point. and the time, which is the x axis to self increment?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #8

            @helloworldddd said in DHT11 Sensor with RPI:

            how do i get the recorded values and put it into a list and limit the list to like in 2 hour intervals with 20 mins as every point

            What is your level of experience with programming? Do you know how you can add values to a list in Python? Please don't forget that this is Qt forum not Python... "limit the list to like in 2 hour intervals with 20 mins" - this is simple math to calculate how many elements the list should contain (max).

            You never answered my question: "Is DHTread(self) called? If so, what does it print?" Can you please answer it?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            H 1 Reply Last reply
            0
            • jsulmJ jsulm

              @helloworldddd said in DHT11 Sensor with RPI:

              how do i get the recorded values and put it into a list and limit the list to like in 2 hour intervals with 20 mins as every point

              What is your level of experience with programming? Do you know how you can add values to a list in Python? Please don't forget that this is Qt forum not Python... "limit the list to like in 2 hour intervals with 20 mins" - this is simple math to calculate how many elements the list should contain (max).

              You never answered my question: "Is DHTread(self) called? If so, what does it print?" Can you please answer it?

              H Offline
              H Offline
              helloworldddd
              wrote on last edited by
              #9

              @jsulm like i said im just a newbie with programming. was hoping to find some help here. which incase guess i came to the wrong place. DHTread(self) is called. it just shows the value onto the UI through lcdnumber display

              jsulmJ 1 Reply Last reply
              0
              • H helloworldddd

                @jsulm like i said im just a newbie with programming. was hoping to find some help here. which incase guess i came to the wrong place. DHTread(self) is called. it just shows the value onto the UI through lcdnumber display

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #10

                @helloworldddd said in DHT11 Sensor with RPI:

                DHTread(self) is called

                That is good. Now you can add the values to a list (myList.append(myValue)). But it is better to use https://www.oreilly.com/library/view/python-cookbook/0596001673/ch05s19.html in your case as you want to have a list with fixed max size and remove old values if you insert new values into full list.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                H 2 Replies Last reply
                0
                • jsulmJ jsulm

                  @helloworldddd said in DHT11 Sensor with RPI:

                  DHTread(self) is called

                  That is good. Now you can add the values to a list (myList.append(myValue)). But it is better to use https://www.oreilly.com/library/view/python-cookbook/0596001673/ch05s19.html in your case as you want to have a list with fixed max size and remove old values if you insert new values into full list.

                  H Offline
                  H Offline
                  helloworldddd
                  wrote on last edited by
                  #11

                  @jsulm ahhh u could have started with that but thanks so much for your help !

                  1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @helloworldddd said in DHT11 Sensor with RPI:

                    DHTread(self) is called

                    That is good. Now you can add the values to a list (myList.append(myValue)). But it is better to use https://www.oreilly.com/library/view/python-cookbook/0596001673/ch05s19.html in your case as you want to have a list with fixed max size and remove old values if you insert new values into full list.

                    H Offline
                    H Offline
                    helloworldddd
                    wrote on last edited by
                    #12

                    @jsulm hello, sorry to bother u again. do u know how to use plot values to time, time as x axis on pyqtgraph? im using the command self.widget.plot() i would like to input the x axis value as time instead of a list of number like below. Thanks in advance !

                    hour = [1,2,3,4,5,6,7,8,9,10]
                    reading = []  #this is the reading from the sensor
                    
                    self.widget.plot(hour, reading)
                    
                    jsulmJ 1 Reply Last reply
                    0
                    • H helloworldddd

                      @jsulm hello, sorry to bother u again. do u know how to use plot values to time, time as x axis on pyqtgraph? im using the command self.widget.plot() i would like to input the x axis value as time instead of a list of number like below. Thanks in advance !

                      hour = [1,2,3,4,5,6,7,8,9,10]
                      reading = []  #this is the reading from the sensor
                      
                      self.widget.plot(hour, reading)
                      
                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      @helloworldddd said in DHT11 Sensor with RPI:

                      do u know how to use plot values to time, time as x axis on pyqtgraph?

                      Sorry, I never used pyqtgraph. Did you check its documentation?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

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