Python Forum
display reading sensor data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
display reading sensor data
#6
       while True:
            if not self._ser.is_open:
                break
            temp = self._ser.read()
            if start:
                if iii % 2:
                    xx = int.from_bytes(temp, byteorder='little')
                elif not iii % 2:
                    yy = int.from_bytes(temp, byteorder='little') << 8
                    zz = xx + yy

                    y[int(iii / 2) - 1] = zz
                    if iii == 6:
                        start = False
                        self.data1[:-1] = self.data1[1:]
                        self.data2[:-1] = self.data2[1:]
                        self.data3[:-1] = self.data3[1:]
                        self.data1[-1] = y[0]
                        self.data2[-1] = y[1]
                        self.data3[-1] = y[2]
                        self.curve1.setData(self.data1)
                        self.curve2.setData(self.data2)
                        self.curve3.setData(self.data3)
                        self.xpos1 += 1
                        self.xpos2 += 1
                        self.xpos3 += 1
                        #self.curve1.setPos(self.xpos1, 0)
                        #self.curve2.setPos(self.xpos2, 0)
                        #self.curve3.setPos(self.xpos3, 0)
                        fftCount += 1
                        if fftCount >= self._fftLength:
                            self.fftDataSet1 = self.calculateFFT(self.data1[-self._fftLength:])
                            self.on_PlotButton1_clicked()
                            self.addValuesToTable(self.fftDataSet1, self.FFTTable1, self._FFTPointList1)

                            self.fftDataSet2 = self.calculateFFT(self.data2[-self._fftLength:])
                            self.on_PlotButton2_clicked()
                            self.addValuesToTable(self.fftDataSet2, self.FFTTable2, self._FFTPointList2)

                            self.fftDataSet3 = self.calculateFFT(self.data3[-self._fftLength:])
                            self.on_PlotButton3_clicked()
                            self.addValuesToTable(self.fftDataSet3, self.FFTTable3, self._FFTPointList3)

                            fftCount = 0
                        self._reachedFFT = True
                        self.app.processEvents()

                iii += 1
            if temp == b'y' and not (start):
                tempOld = temp

            if temp == b'z' and not (start):
                if tempOld == b'y':
                    start = True
                    iii = 1
 
Reply


Messages In This Thread
display reading sensor data - by hassan_elahi - May-03-2018, 10:15 PM
RE: display reading sensor data - by Larz60+ - May-03-2018, 10:22 PM
RE: display reading sensor data - by woooee - May-03-2018, 11:53 PM
RE: display reading sensor data - by hassan_elahi - May-04-2018, 12:51 AM
RE: display reading sensor data - by woooee - May-04-2018, 02:18 AM
RE: display reading sensor data - by hassan_elahi - May-05-2018, 04:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Display MySQL data in QLlineEdit text boxes JayCee 1 4,213 Mar-26-2020, 03:55 PM
Last Post: JayCee
  Display and update the label text which display the serial value jenkins43 5 9,259 Feb-04-2019, 04:36 AM
Last Post: Larz60+
  Display more than one button in GUI to display MPU6000 Sensor readings barry76 4 4,040 Jan-05-2019, 01:48 PM
Last Post: wuf
  [PyQt] How to display multiple data(from 2 different related table) in one cell of QTableWid yangjae 4 4,510 Oct-17-2018, 07:54 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020