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
Forum Updated to NodeBB v4.3 + New Features

DHT11 Sensor with RPI

Scheduled Pinned Locked Moved Unsolved General and Desktop
graphrpidht11
13 Posts 2 Posters 2.2k 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
    2 Nov 2020, 07:08

    @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 !

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 2 Nov 2020, 07:12 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 2 Nov 2020, 08:04
    0
    • J jsulm
      2 Nov 2020, 07:12

      @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 2 Nov 2020, 08:04 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 ?

      J 1 Reply Last reply 2 Nov 2020, 08:12
      0
      • H helloworldddd
        2 Nov 2020, 08:04

        @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 ?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 2 Nov 2020, 08:12 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 2 Nov 2020, 08:15
        0
        • J jsulm
          2 Nov 2020, 08:12

          @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 2 Nov 2020, 08:15 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?

          J 1 Reply Last reply 2 Nov 2020, 08:18
          0
          • H helloworldddd
            2 Nov 2020, 08:15

            @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?

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 2 Nov 2020, 08:18 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 2 Nov 2020, 08:27
            0
            • J jsulm
              2 Nov 2020, 08:18

              @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 2 Nov 2020, 08:27 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

              J 1 Reply Last reply 2 Nov 2020, 08:31
              0
              • H helloworldddd
                2 Nov 2020, 08:27

                @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

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 2 Nov 2020, 08:31 last edited by jsulm 11 Feb 2020, 08:34
                #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 2 Nov 2020, 08:41
                0
                • J jsulm
                  2 Nov 2020, 08:31

                  @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 2 Nov 2020, 08:41 last edited by
                  #11

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

                  1 Reply Last reply
                  0
                  • J jsulm
                    2 Nov 2020, 08:31

                    @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 3 Nov 2020, 06:01 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)
                    
                    J 1 Reply Last reply 3 Nov 2020, 06:03
                    0
                    • H helloworldddd
                      3 Nov 2020, 06:01

                      @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)
                      
                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 3 Nov 2020, 06:03 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

                      13/13

                      3 Nov 2020, 06:03

                      • Login

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