DHT11 Sensor with RPI
-
@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. -
@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?
-
@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?
-
@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.
-
@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)
-
@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?