Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    How to measure 200 samples/sec of accelerometer in pysense?

    Scheduled Pinned Locked Moved Projects
    pysenseaccelerometermeasurementdata ratelis2hh12 accele
    2 Posts 2 Posters 28 Views 2 Watching
    Loading More Posts
    • 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.
    • C Offline
      Chandan Verma
      last edited by Chandan Verma

      I want to get 200 sample data in a seconds of x,y and z coordinates of accelerometer present in pysense board. I have set the output data rate of 200Hz (ODR value: 4). I am getting only on a average of 30 samples/sec from the acceleration function.
      Here i am attaching the LIS2HH12 setup code and main code to print the data in console.

      LIS2HH12 setup code:

      #!/usr/bin/env python
      #
      # Copyright (c) 2020, Pycom Limited.
      #
      # This software is licensed under the GNU GPL version 3 or any
      # later version, with permitted additional terms. For more information
      # see the Pycom Licence v1.0 document supplied with this file, or
      # available at https://www.pycom.io/opensource/licensing
      #
      
      import math
      import time
      import struct
      from machine import Pin
      
      
      FULL_SCALE_2G = const(0)
      FULL_SCALE_4G = const(2)
      FULL_SCALE_8G = const(3)
      
      ODR_POWER_DOWN = const(0)
      ODR_10_HZ = const(1)
      ODR_50_HZ = const(2)
      ODR_100_HZ = const(3)
      ODR_200_HZ = const(4)
      ODR_400_HZ = const(5)
      ODR_800_HZ = const(6)
      
      ACC_G_DIV = 1000 * 65536
      
      
      class LIS2HH12:
      
          ACC_I2CADDR = const(30)
      
          PRODUCTID_REG = const(0x0F)
          CTRL1_REG = const(0x20)
          CTRL2_REG = const(0x21)
          CTRL3_REG = const(0x22)
          CTRL4_REG = const(0x23)
          CTRL5_REG = const(0x24)
          ACC_X_L_REG = const(0x28)
          ACC_X_H_REG = const(0x29)
          ACC_Y_L_REG = const(0x2A)
          ACC_Y_H_REG = const(0x2B)
          ACC_Z_L_REG = const(0x2C)
          ACC_Z_H_REG = const(0x2D)
          ACT_THS = const(0x1E)
          ACT_DUR = const(0x1F)
       
      
          SCALES = {FULL_SCALE_2G: 4000, FULL_SCALE_4G: 8000, FULL_SCALE_8G: 16000}
          ODRS = [0, 10, 50, 100, 200, 400, 800]
      
          def __init__(self, pysense = None, sda = 'P22', scl = 'P21'):
              if pysense is not None:
                  self.i2c = pysense.i2c
              else:
                  from machine import I2C
                  self.i2c = I2C(0, mode=I2C.MASTER, pins=(sda, scl))
      
              self.odr = 0
              self.full_scale = 0
              self.x = 0
              self.y = 0
              self.z = 0
              self.int_pin = None
              self.act_dur = 0
              self.debounced = False
      
              whoami = self.i2c.readfrom_mem(ACC_I2CADDR , PRODUCTID_REG, 1)
              if (whoami[0] != 0x41):
                  raise ValueError("LIS2HH12 not found")
              print("ODR Value : {}".format(ODR_200_HZ))
              # enable acceleration readings at 200Hz
              self.set_odr(ODR_200_HZ)
      
              # change the full-scale to 2g
              self.set_full_scale(FULL_SCALE_2G)
      
              # set the interrupt pin as active low and open drain
              self.set_register(CTRL5_REG, 3, 0, 3)
      
              # make a first read
              self.acceleration()
      
          def acceleration(self):
              x = self.i2c.readfrom_mem(ACC_I2CADDR , ACC_X_L_REG, 2)
              self.x = struct.unpack('<h', x)
              y = self.i2c.readfrom_mem(ACC_I2CADDR , ACC_Y_L_REG, 2)
              self.y = struct.unpack('<h', y)
              z = self.i2c.readfrom_mem(ACC_I2CADDR , ACC_Z_L_REG, 2)
              self.z = struct.unpack('<h', z)
              _mult = self.SCALES[self.full_scale] / ACC_G_DIV
              # print(CTRL1_REG)
              return (self.x[0] * _mult, self.y[0] * _mult, self.z[0] * _mult)
      
          def roll(self):
              x,y,z = self.acceleration()
              rad = math.atan2(-x, z)
              return (180 / math.pi) * rad
      
          def pitch(self):
              x,y,z = self.acceleration()
              rad = -math.atan2(y, (math.sqrt(x*x + z*z)))
              return (180 / math.pi) * rad
      
          def set_register(self, register, value, offset, mask):
              reg = bytearray(self.i2c.readfrom_mem(ACC_I2CADDR, register, 3))
              # print("reg value",reg)
              reg[0] &= ~(mask << offset)
              reg[0] |= ((value & mask) << offset)
              print(ACC_I2CADDR, register, reg)
              self.i2c.writeto_mem(ACC_I2CADDR, register, reg)
      
          def set_full_scale(self, scale):
              self.set_register(CTRL4_REG, scale, 4, 3)
              self.full_scale = scale
      
          def set_odr(self, odr):
              # self.set_register(CTRL1_REG, odr, 6, 7)
              val = b'\xE7'
              print("Writing values in register: ", ACC_I2CADDR, CTRL1_REG, val)
              self.i2c.writeto_mem(ACC_I2CADDR, CTRL1_REG, b'\xF7')
              eg = bytearray(self.i2c.readfrom_mem(ACC_I2CADDR, CTRL1_REG, 1))
              print("register read: ", eg)
              self.odr = odr
              print(self.odr)
      
          def set_high_pass(self, hp):
              self.set_register(CTRL2_REG, 1 if hp else 0, 2, 1)
      
          def enable_activity_interrupt(self, threshold, duration, handler=None):
              # Threshold is in mg, duration is ms
              self.act_dur = duration
      
              if threshold > self.SCALES[self.full_scale]:
                  error = "threshold %d exceeds full scale %d" % (threshold, self.SCALES[self.full_scale])
                  print(error)
                  raise ValueError(error)
      
              if threshold < self.SCALES[self.full_scale] / 128:
                  error = "threshold %d below resolution %d" % (threshold, self.SCALES[self.full_scale]/128)
                  print(error)
                  raise ValueError(error)
      
              if duration > 255 * 1000 * 8 / self.ODRS[self.odr]:
                  error = "duration %d exceeds max possible value %d" % (duration, 255 * 1000 * 8 / self.ODRS[self.odr])
                  print(error)
                  raise ValueError(error)
      
              if duration < 1000 * 8 / self.ODRS[self.odr]:
                  error = "duration %d below resolution %d" % (duration, 1000 * 8 / self.ODRS[self.odr])
                  print(error)
                  raise ValueError(error)
      
              _ths = int(127 * threshold / self.SCALES[self.full_scale]) & 0x7F
              _dur = int((duration * self.ODRS[self.odr]) / 1000 / 8)
      
              self.i2c.writeto_mem(ACC_I2CADDR, ACT_THS, _ths)
              self.i2c.writeto_mem(ACC_I2CADDR, ACT_DUR, _dur)
      
              # enable the activity/inactivity interrupt
              self.set_register(CTRL3_REG, 1, 5, 1)
      
              self._user_handler = handler
              self.int_pin = Pin('P13', mode=Pin.IN)
              self.int_pin.callback(trigger=Pin.IRQ_FALLING | Pin.IRQ_RISING, handler=self._int_handler)
      
              # return actual used threshold and duration
              return (_ths * self.SCALES[self.full_scale] / 128, _dur * 8 * 1000 / self.ODRS[self.odr])
      
          def activity(self):
              if not self.debounced:
                  time.sleep_ms(self.act_dur)
                  self.debounced = True
              if self.int_pin():
                  return True
              return False
      
          def _int_handler(self, pin_o):
              if self._user_handler is not None:
                  self._user_handler(pin_o)
              else:
                  if pin_o():
                      print('Activity interrupt')
                  else:
                      print('Inactivity interrupt')
      
      

      main code:

      
      from network import WLAN
      import socket
      import pycom
      import time
      from wifi_conn import wifiCon
      from pysense import Pysense
      # from pytrack import Pytrack
      from LIS2HH12 import LIS2HH12
      from machine import SD, Pin, RTC
      import machine
      import utime 
      
      
      from SI7006A20 import SI7006A20
      from LTR329ALS01 import LTR329ALS01
      from MPL3115A2 import MPL3115A2,ALTITUDE,PRESSURE
      
      
      # SD card mount
      #sd = SD()
      #os.mount(sd, '/sd')
      #time.sleep(2)
      
      pycom.rgbled(0x007f00) # green
      time.sleep(1)
      # RTC sync
      rtc = RTC()
      rtc.init((2021, 7, 23, 16, 10, 0, 0, 0))
      utime.sleep_ms(250)
      
      print(rtc.now())
      # py = Pytrack()
      py = Pysense()
      
      mp = MPL3115A2(py,mode=ALTITUDE)
      mpp = MPL3115A2(py,mode=PRESSURE)
      si = SI7006A20(py)
      t_ambient = 24.4
      lt = LTR329ALS01(py)
      acc = LIS2HH12(py)
      
      pycom.heartbeat(False)
      pycom.rgbled(0xff3333) # red
      utime.sleep_ms(250)
      # File open
      ftime = rtc.now()
      fname = str(ftime[2]) + str(ftime[1]) + str(ftime[0]) #+ "_" + str(ftime[3]) + str(ftime[4]) + str(ftime[5])
      datee = str(ftime[2]) + "/" + str(ftime[1]) + "/" + str(ftime[0])
      
      # define all sensors
      MPLtemperature = str(mp.temperature())
      llatitude = str(mp.altitude())
      ppressure = str(mpp.pressure())
      ttemperature = str(si.temperature())
      hhumidity = str(si.humidity())  
      dewPoint = str(si.dew_point())
      Ambi_Light = str(si.humid_ambient(t_ambient))
      light_LUX = str(lt.light())
      f = open('book1.csv', 'a')
      
      
      
      pycom.rgbled(1000) # blue
      t_end = time.time() + 10
      print("Reading the accelerometer data...")
      TotalData=[]
      while time.time() < t_end:
          dataString = acc.acceleration()
          # acc1 = str(round(dataString[0],2))
          # acc2 = str(round(dataString[1],2))
          # acc3 = str(round(dataString[2],2))
          # x = bytes(acc1, 'utf-8')
          # y = bytes(acc2, 'utf-8')
          # z = bytes(acc3, 'utf-8')
          ttime = rtc.now()
          timee = str(ttime[3]) + ":" + str(ttime[4]) + ":" + str(ttime[5])
          # dataBytes = datee + " " + timee + " " + str(x) + " " + str(y) + " " + str(z) 
          # fullData2 = datee + "," + timee + "," + acc2 + "," + acc1 + "," + acc3 #+ "," + ppressure + "," + ttemperature +  "," + hhumidity + "," + light_LUX 
          fullData2 = datee + "," + timee + "," + str(dataString)
          TotalData.append(fullData2)
          print(fullData2)
      
          f.write(fullData2)
          f.write("\n")
      f.close()
      print("Length of Total Data is : ")
      # print(TotalData)
      print(len(TotalData))
      pycom.rgbled(0x007f00) # green
      time.sleep(1)
      pycom.rgbled(False)
      print("Data is collected and saved.")
      
      

      output data collected in 10 seconds :

      23/7/2021,16:10:4,(-0.1531372, 0.008056641, 0.9604492)
      23/7/2021,16:10:4,(-0.154541, 0.007995605, 0.9663086)
      23/7/2021,16:10:4,(-0.1571655, 0.007568359, 0.9680176)
      23/7/2021,16:10:4,(-0.1550903, 0.006530762, 0.9591675)
      23/7/2021,16:10:4,(-0.1578369, 0.00769043, 0.9657593)
      23/7/2021,16:10:4,(-0.1594849, 0.008483887, 0.9747925)
      23/7/2021,16:10:4,(-0.1582642, 0.007873535, 0.9663086)
      23/7/2021,16:10:4,(-0.1580811, 0.006408691, 0.9642334)
      23/7/2021,16:10:4,(-0.1563721, 0.01220703, 0.9665527)
      23/7/2021,16:10:4,(-0.1113281, -0.004699707, 0.9753418)
      23/7/2021,16:10:4,(-0.2111206, 0.01818848, 1.002197)
      23/7/2021,16:10:4,(-0.09790039, 0.03955078, 1.004639)
      23/7/2021,16:10:4,(-0.03875732, 0.02502441, 1.042053)
      23/7/2021,16:10:4,(-0.05621338, 0.08813477, 1.032959)
      23/7/2021,16:10:4,(-0.1005859, 0.1329346, 0.9644775)
      23/7/2021,16:10:4,(-0.08666992, 0.07287598, 0.9727173)
      23/7/2021,16:10:5,(-0.05023193, 0.06188965, 0.9977417)
      23/7/2021,16:10:5,(-0.09442139, 0.08746338, 0.9581299)
      23/7/2021,16:10:5,(-0.1203613, 0.05841064, 0.9735107)
      23/7/2021,16:10:5,(-0.1047974, 0.02404785, 1.008118)
      23/7/2021,16:10:5,(-0.1182251, 0.05865479, 0.9533691)
      23/7/2021,16:10:5,(-0.1079102, 0.03240967, 0.9866943)
      23/7/2021,16:10:5,(-0.1130371, 0.01416016, 0.9690552)
      23/7/2021,16:10:5,(-0.1471558, -0.00213623, 0.972168)
      23/7/2021,16:10:5,(-0.1050415, -0.007629395, 0.9708252)
      23/7/2021,16:10:5,(-0.1428833, -0.0300293, 0.9779053)
      23/7/2021,16:10:5,(-0.1273804, -0.02539063, 0.9621582)
      23/7/2021,16:10:5,(-0.1303101, -0.03271484, 0.9631348)
      23/7/2021,16:10:5,(-0.1343384, -0.04693604, 0.9580688)
      23/7/2021,16:10:5,(-0.1560059, -0.05499268, 0.9655762)
      23/7/2021,16:10:5,(-0.1256714, -0.07159424, 0.9779053)
      23/7/2021,16:10:5,(-0.147522, -0.08190918, 0.9730835)
      23/7/2021,16:10:5,(-0.1377563, -0.07745361, 0.9578857)
      23/7/2021,16:10:5,(-0.1397095, -0.1033936, 0.9677124)
      23/7/2021,16:10:5,(-0.111145, -0.1029053, 0.9590454)
      23/7/2021,16:10:5,(-0.1032104, -0.1185913, 0.9688721)
      23/7/2021,16:10:5,(-0.07214355, -0.1386719, 0.9754639)
      23/7/2021,16:10:5,(-0.09106445, -0.1325073, 0.9610596)
      23/7/2021,16:10:5,(-0.08544922, -0.1358643, 0.9782715)
      23/7/2021,16:10:5,(-0.08929443, -0.1680298, 1.004883)
      23/7/2021,16:10:5,(-0.08294678, -0.1303101, 0.9460449)
      23/7/2021,16:10:5,(-0.1242676, -0.1446533, 0.9517212)
      23/7/2021,16:10:5,(-0.08776855, -0.1523438, 0.9681396)
      23/7/2021,16:10:5,(-0.09228516, -0.1463623, 0.9362793)
      23/7/2021,16:10:5,(-0.09417725, -0.1700439, 0.9578857)
      23/7/2021,16:10:5,(-0.05224609, -0.161377, 0.9671631)
      23/7/2021,16:10:6,(-0.07946777, -0.1773071, 0.9707031)
      23/7/2021,16:10:6,(-0.08081055, -0.1680298, 0.9614868)
      23/7/2021,16:10:6,(-0.1113281, -0.1600952, 0.9489136)
      23/7/2021,16:10:6,(-0.06707764, -0.1917725, 0.9978027)
      23/7/2021,16:10:6,(-0.1038208, -0.1568604, 0.9224854)
      23/7/2021,16:10:6,(-0.09442139, -0.1825562, 0.9746704)
      23/7/2021,16:10:6,(-0.105896, -0.1370239, 0.9237671)
      23/7/2021,16:10:6,(-0.1089478, -0.12146, 0.9238892)
      23/7/2021,16:10:6,(-0.1405029, -0.168335, 0.9742432)
      23/7/2021,16:10:6,(-0.05474854, -0.1453857, 0.9755249)
      23/7/2021,16:10:6,(-0.1193848, -0.1607666, 0.984375)
      23/7/2021,16:10:6,(-0.1449585, -0.1467285, 0.9865723)
      23/7/2021,16:10:6,(-0.04931641, -0.1518555, 1.026733)
      23/7/2021,16:10:6,(-0.1071777, -0.1448975, 1.02124)
      23/7/2021,16:10:6,(-0.1399536, -0.1089478, 0.9522095)
      23/7/2021,16:10:6,(-0.07720947, -0.1102905, 0.968689)
      23/7/2021,16:10:6,(-0.06231689, -0.1712646, 1.028687)
      23/7/2021,16:10:6,(-0.1378784, -0.1116333, 0.9387817)
      23/7/2021,16:10:6,(-0.1168213, -0.1112061, 0.9298096)
      23/7/2021,16:10:6,(-0.0958252, -0.1407471, 0.9551392)
      23/7/2021,16:10:6,(-0.1021118, -0.1456909, 0.9740601)
      23/7/2021,16:10:6,(-0.1090088, -0.1247559, 0.9275513)
      23/7/2021,16:10:6,(-0.1132813, -0.1315918, 0.9367676)
      23/7/2021,16:10:6,(-0.06872559, -0.1699829, 0.991394)
      23/7/2021,16:10:6,(-0.09436035, -0.1408081, 0.942749)
      23/7/2021,16:10:6,(-0.0848999, -0.1182251, 0.9172363)
      23/7/2021,16:10:6,(-0.08874512, -0.168457, 0.9944458)
      23/7/2021,16:10:6,(-0.09484863, -0.1646118, 1.005737)
      23/7/2021,16:10:6,(-0.08239746, -0.1315918, 0.947998)
      23/7/2021,16:10:6,(-0.06878662, -0.1669312, 0.9788818)
      23/7/2021,16:10:7,(-0.1040649, -0.1932983, 0.9915771)
      23/7/2021,16:10:7,(-0.07550049, -0.1609497, 0.9539185)
      23/7/2021,16:10:7,(-0.05615234, -0.1760254, 0.9727173)
      23/7/2021,16:10:7,(-0.06439209, -0.1785889, 0.9797974)
      23/7/2021,16:10:7,(-0.04943848, -0.182251, 0.9676514)
      23/7/2021,16:10:7,(-0.07794189, -0.1776733, 0.956665)
      23/7/2021,16:10:7,(-0.1095581, -0.1692505, 0.9318848)
      23/7/2021,16:10:7,(-0.04400635, -0.15802, 0.9487915)
      23/7/2021,16:10:7,(-0.04083252, -0.1567383, 0.9588623)
      23/7/2021,16:10:7,(-0.07171631, -0.1305542, 0.9492798)
      23/7/2021,16:10:7,(-0.07696533, -0.1478882, 0.9677124)
      23/7/2021,16:10:7,(-0.03167725, -0.1749268, 1.000183)
      23/7/2021,16:10:7,(-0.0758667, -0.1442871, 0.9542236)
      23/7/2021,16:10:7,(-0.06091309, -0.1566162, 0.973877)
      23/7/2021,16:10:7,(-0.03997803, -0.1794434, 1.007874)
      23/7/2021,16:10:7,(-0.04663086, -0.1312256, 0.9334717)
      23/7/2021,16:10:7,(-0.06152344, -0.166687, 0.9771118)
      23/7/2021,16:10:7,(-0.03143311, -0.1759644, 0.9974976)
      23/7/2021,16:10:7,(-0.07208252, -0.138855, 0.9341431)
      23/7/2021,16:10:7,(-0.06365967, -0.1732178, 0.9654541)
      23/7/2021,16:10:7,(-0.07641602, -0.1837158, 0.9690552)
      23/7/2021,16:10:7,(-0.03643799, -0.1494751, 0.9400635)
      23/7/2021,16:10:7,(-0.08477783, -0.1732178, 0.9719238)
      23/7/2021,16:10:7,(-0.05322266, -0.1663208, 0.9782715)
      23/7/2021,16:10:7,(-0.05682373, -0.1584473, 0.9616699)
      23/7/2021,16:10:7,(-0.07818604, -0.1570435, 0.9851074)
      23/7/2021,16:10:7,(-0.04229736, -0.1762695, 0.9729004)
      23/7/2021,16:10:8,(-0.05065918, -0.1890869, 0.9743042)
      23/7/2021,16:10:8,(-0.07275391, -0.1846924, 0.9645996)
      23/7/2021,16:10:8,(-0.04223633, -0.1838379, 0.9873657)
      23/7/2021,16:10:8,(-0.02044678, -0.1854248, 0.9838867)
      23/7/2021,16:10:8,(-0.06512451, -0.1766968, 0.9602661)
      23/7/2021,16:10:8,(-0.04803467, -0.1757202, 0.9796143)
      23/7/2021,16:10:8,(-0.02050781, -0.184021, 0.9805908)
      23/7/2021,16:10:8,(-0.04168701, -0.1835938, 0.9787598)
      23/7/2021,16:10:8,(-0.04333496, -0.1672974, 0.9293823)
      23/7/2021,16:10:8,(-0.07562256, -0.1717529, 0.9332275)
      23/7/2021,16:10:8,(-0.04077148, -0.2033691, 0.9835205)
      23/7/2021,16:10:8,(-0.006469727, -0.2004395, 0.9619141)
      23/7/2021,16:10:8,(-0.03729248, -0.1829834, 0.9307251)
      23/7/2021,16:10:8,(-0.01953125, -0.1973267, 0.9443359)
      23/7/2021,16:10:8,(0.04382324, -0.2383423, 0.9768677)
      23/7/2021,16:10:8,(-0.01586914, -0.1921997, 0.9199829)
      23/7/2021,16:10:8,(-0.002441406, -0.1998901, 0.9591675)
      23/7/2021,16:10:8,(-0.02453613, -0.206665, 0.975769)
      23/7/2021,16:10:8,(-0.02606201, -0.206665, 0.9906616)
      23/7/2021,16:10:8,(-0.01470947, -0.2001343, 0.975769)
      23/7/2021,16:10:8,(-0.03778076, -0.2046509, 0.9562378)
      23/7/2021,16:10:8,(-0.02215576, -0.1965332, 0.961853)
      23/7/2021,16:10:8,(-0.01861572, -0.2127686, 0.9840698)
      23/7/2021,16:10:8,(-0.02545166, -0.2176514, 0.96875)
      23/7/2021,16:10:8,(-0.0458374, -0.2114868, 0.9631348)
      23/7/2021,16:10:8,(0.004943848, -0.2192383, 0.9841919)
      23/7/2021,16:10:8,(-0.01159668, -0.2503662, 0.9835205)
      23/7/2021,16:10:8,(-0.03771973, -0.2333374, 0.9344482)
      23/7/2021,16:10:8,(-0.02581787, -0.2339478, 0.9276733)
      23/7/2021,16:10:9,(-0.01403809, -0.2396851, 0.9483032)
      23/7/2021,16:10:9,(-0.03759766, -0.2477417, 0.951416)
      23/7/2021,16:10:9,(0.003540039, -0.2305908, 0.9290161)
      23/7/2021,16:10:9,(-0.01837158, -0.2495117, 0.9312134)
      23/7/2021,16:10:9,(0.008789063, -0.249939, 0.9539795)
      23/7/2021,16:10:9,(0.01147461, -0.2625732, 0.9620972)
      23/7/2021,16:10:9,(0.003540039, -0.2351685, 0.9243774)
      23/7/2021,16:10:9,(0.008850098, -0.2437134, 0.9553223)
      23/7/2021,16:10:9,(0.01409912, -0.2661133, 0.9515381)
      23/7/2021,16:10:9,(0.00213623, -0.2581177, 0.928894)
      23/7/2021,16:10:9,(0.00592041, -0.2738037, 0.9400024)
      23/7/2021,16:10:9,(-0.003662109, -0.2971191, 0.9884644)
      23/7/2021,16:10:9,(0.0480957, -0.2579956, 0.9736938)
      23/7/2021,16:10:9,(-0.03741455, -0.2659912, 0.9712524)
      23/7/2021,16:10:9,(-0.008056641, -0.2541504, 0.9522705)
      23/7/2021,16:10:9,(0.05175781, -0.288147, 0.9648438)
      23/7/2021,16:10:9,(0.02728271, -0.2776489, 0.9462891)
      23/7/2021,16:10:9,(-0.01281738, -0.2543945, 0.9421387)
      23/7/2021,16:10:9,(-0.0166626, -0.2598267, 0.9370728)
      23/7/2021,16:10:9,(-0.03161621, -0.2963867, 0.9391479)
      23/7/2021,16:10:9,(-0.03070068, -0.2941284, 0.9400024)
      23/7/2021,16:10:9,(0.01452637, -0.2661133, 0.9307861)
      23/7/2021,16:10:9,(-0.009399414, -0.3026733, 0.9736328)
      23/7/2021,16:10:9,(-0.006652832, -0.2823486, 0.9425659)
      23/7/2021,16:10:9,(0.007263184, -0.2806396, 0.9285889)
      23/7/2021,16:10:9,(-0.01470947, -0.2985229, 0.9475708)
      23/7/2021,16:10:9,(0.007385254, -0.2935181, 0.9429932)
      23/7/2021,16:10:9,(0.002197266, -0.2907104, 0.9338379)
      23/7/2021,16:10:10,(-0.01495361, -0.3046265, 0.9458618)
      23/7/2021,16:10:10,(-0.004455566, -0.2862549, 0.9386597)
      23/7/2021,16:10:10,(-0.0112915, -0.3085327, 0.9506836)
      23/7/2021,16:10:10,(-0.01055908, -0.3101196, 0.9505615)
      23/7/2021,16:10:10,(0.00378418, -0.2962646, 0.9437256)
      23/7/2021,16:10:10,(-0.01043701, -0.3140869, 0.9555664)
      23/7/2021,16:10:10,(0.02154541, -0.3060303, 0.9447021)
      23/7/2021,16:10:10,(0.02355957, -0.3138428, 0.9337158)
      23/7/2021,16:10:10,(0.00769043, -0.3303223, 0.942749)
      23/7/2021,16:10:10,(0.001220703, -0.3326416, 0.9135742)
      23/7/2021,16:10:10,(0.02062988, -0.3270264, 0.8754272)
      23/7/2021,16:10:10,(-0.0002441406, -0.3442383, 0.90625)
      23/7/2021,16:10:10,(0.00579834, -0.3222656, 0.913208)
      23/7/2021,16:10:10,(0.02783203, -0.328186, 0.9454956)
      23/7/2021,16:10:10,(0.03082275, -0.3323975, 0.960083)
      23/7/2021,16:10:10,(-0.005493164, -0.3286743, 0.942627)
      23/7/2021,16:10:10,(0.01251221, -0.3404541, 0.9490967)
      23/7/2021,16:10:10,(0.005554199, -0.3269043, 0.9206543)
      23/7/2021,16:10:10,(0.01879883, -0.3441772, 0.9299316)
      23/7/2021,16:10:10,(-0.01098633, -0.3222656, 0.9158325)
      23/7/2021,16:10:10,(-0.009399414, -0.3234863, 0.927063)
      23/7/2021,16:10:10,(-0.005493164, -0.3092651, 0.8946533)
      23/7/2021,16:10:10,(-0.02038574, -0.3205566, 0.9193726)
      23/7/2021,16:10:10,(-0.01971436, -0.3019409, 0.9343872)
      23/7/2021,16:10:10,(-0.02313232, -0.2993164, 0.9850464)
      23/7/2021,16:10:10,(-0.06610107, -0.2983398, 0.9714355)
      23/7/2021,16:10:10,(-0.0647583, -0.2835693, 0.9206543)
      23/7/2021,16:10:10,(-0.08441162, -0.2887573, 0.9100952)
      23/7/2021,16:10:10,(-0.07965088, -0.3067017, 0.9407349)
      23/7/2021,16:10:11,(-0.06506348, -0.2970581, 0.9094238)
      23/7/2021,16:10:11,(-0.06097412, -0.3074341, 0.9226685)
      23/7/2021,16:10:11,(-0.06011963, -0.2926025, 0.9537354)
      23/7/2021,16:10:11,(-0.09283447, -0.2915649, 0.9528809)
      23/7/2021,16:10:11,(-0.08679199, -0.2609253, 0.9221191)
      23/7/2021,16:10:11,(-0.065979, -0.2767944, 0.942688)
      23/7/2021,16:10:11,(-0.09716797, -0.286499, 0.9107666)
      23/7/2021,16:10:11,(-0.07879639, -0.2700806, 0.9185181)
      23/7/2021,16:10:11,(-0.06634521, -0.27948, 0.9616089)
      23/7/2021,16:10:11,(-0.0802002, -0.2761841, 0.9736328)
      23/7/2021,16:10:11,(-0.06182861, -0.2521362, 0.968689)
      23/7/2021,16:10:11,(-0.07910156, -0.2667236, 0.9524536)
      23/7/2021,16:10:11,(-0.05249023, -0.2634277, 0.9396973)
      23/7/2021,16:10:11,(-0.05828857, -0.2642212, 0.9389648)
      23/7/2021,16:10:11,(-0.07385254, -0.2645874, 0.9404907)
      23/7/2021,16:10:11,(-0.06164551, -0.2669678, 0.9389648)
      23/7/2021,16:10:11,(-0.06774902, -0.2752075, 0.9348145)
      23/7/2021,16:10:11,(-0.07440186, -0.2582397, 0.8884277)
      23/7/2021,16:10:11,(-0.1040039, -0.2171021, 0.8701782)
      23/7/2021,16:10:11,(-0.1055908, -0.2537842, 0.9921265)
      23/7/2021,16:10:11,(-0.07965088, -0.260498, 1.020752)
      23/7/2021,16:10:11,(-0.1000366, -0.2333984, 0.9611816)
      23/7/2021,16:10:11,(-0.07006836, -0.2319946, 0.9708252)
      23/7/2021,16:10:11,(-0.09301758, -0.2410278, 0.9624023)
      23/7/2021,16:10:11,(-0.08520508, -0.239563, 0.9829102)
      23/7/2021,16:10:11,(-0.06158447, -0.2496338, 0.96875)
      23/7/2021,16:10:11,(-0.08483887, -0.2368164, 0.9824829)
      23/7/2021,16:10:11,(-0.09265137, -0.2318726, 0.9539185)
      23/7/2021,16:10:11,(-0.1100464, -0.2290649, 0.9297485)
      23/7/2021,16:10:11,(-0.1221313, -0.2174072, 0.9263306)
      23/7/2021,16:10:12,(-0.1100464, -0.2324829, 0.9559326)
      23/7/2021,16:10:12,(-0.1282349, -0.2431641, 0.9416504)
      23/7/2021,16:10:12,(-0.1243896, -0.2330322, 0.9267578)
      23/7/2021,16:10:12,(-0.1088257, -0.2376709, 0.9485474)
      23/7/2021,16:10:12,(-0.1255493, -0.2446289, 0.9532471)
      23/7/2021,16:10:12,(-0.1080933, -0.2478027, 0.9658203)
      23/7/2021,16:10:12,(-0.09332275, -0.2199707, 0.9199219)
      23/7/2021,16:10:12,(-0.1072998, -0.2174072, 0.9414673)
      23/7/2021,16:10:12,(-0.1133423, -0.2174072, 0.9801636)
      23/7/2021,16:10:12,(-0.09710693, -0.2167358, 0.9811401)
      23/7/2021,16:10:12,(-0.1188354, -0.2169189, 0.9748535)
      23/7/2021,16:10:12,(-0.09204102, -0.206665, 0.9574585)
      23/7/2021,16:10:12,(-0.1344604, -0.2304688, 0.9535522)
      23/7/2021,16:10:12,(-0.1672974, -0.197937, 0.9223022)
      23/7/2021,16:10:12,(-0.1481323, -0.1895752, 0.9480591)
      23/7/2021,16:10:12,(-0.1436157, -0.2074585, 0.9761353)
      23/7/2021,16:10:12,(-0.1378174, -0.2215576, 0.9822388)
      23/7/2021,16:10:12,(-0.12854, -0.2128296, 0.9414673)
      23/7/2021,16:10:12,(-0.1229248, -0.2146606, 0.9195557)
      23/7/2021,16:10:12,(-0.1044922, -0.2114868, 0.9376221)
      23/7/2021,16:10:12,(-0.1022339, -0.2175903, 0.9473267)
      23/7/2021,16:10:12,(-0.07611084, -0.2006226, 0.9451294)
      23/7/2021,16:10:12,(-0.102356, -0.1990356, 0.9588013)
      23/7/2021,16:10:12,(-0.1003418, -0.1889038, 0.9573364)
      23/7/2021,16:10:12,(-0.0692749, -0.1832275, 0.9532471)
      23/7/2021,16:10:12,(-0.1105347, -0.15802, 0.9404297)
      23/7/2021,16:10:12,(-0.1715088, -0.1575317, 0.9580078)
      23/7/2021,16:10:13,(-0.102417, -0.1443481, 0.9955444)
      23/7/2021,16:10:13,(-0.08813477, -0.1485596, 1.018616)
      23/7/2021,16:10:13,(-0.1340332, -0.1384888, 0.9936523)
      23/7/2021,16:10:13,(-0.104187, -0.1213989, 0.9592285)
      23/7/2021,16:10:13,(-0.0949707, -0.1394653, 0.973877)
      23/7/2021,16:10:13,(-0.0970459, -0.137146, 0.9547119)
      23/7/2021,16:10:13,(-0.07775879, -0.1253662, 0.9818726)
      23/7/2021,16:10:13,(-0.09088135, -0.1279297, 0.9771118)
      23/7/2021,16:10:13,(-0.07324219, -0.1055298, 0.9788818)
      23/7/2021,16:10:13,(-0.06610107, -0.1004028, 0.9708862)
      23/7/2021,16:10:13,(-0.074646, -0.09472656, 0.958313)
      23/7/2021,16:10:13,(-0.08618164, -0.08721924, 0.9610596)
      23/7/2021,16:10:13,(-0.1087036, -0.05377197, 0.9656982)
      23/7/2021,16:10:13,(-0.1566162, -0.05395508, 1.002197)
      23/7/2021,16:10:13,(-0.1137085, -0.08654785, 1.031128)
      23/7/2021,16:10:13,(-0.07269287, -0.0982666, 1.001404)
      23/7/2021,16:10:13,(-0.06488037, -0.1069336, 0.9693604)
      23/7/2021,16:10:13,(-0.0557251, -0.07806396, 0.9769897)
      23/7/2021,16:10:13,(-0.009643555, -0.1078491, 0.9485474)
      23/7/2021,16:10:13,(-0.01275635, -0.08984375, 1.012634)
      23/7/2021,16:10:13,(0.007629395, -0.0803833, 1.042236)
      23/7/2021,16:10:13,(0.02954102, -0.06170654, 1.017212)
      23/7/2021,16:10:13,(-0.01605225, -0.07141113, 0.9866943)
      23/7/2021,16:10:13,(-0.02325439, -0.07202148, 0.9644775)
      23/7/2021,16:10:13,(-0.0223999, -0.07232666, 0.9429321)
      23/7/2021,16:10:13,(-0.0402832, -0.07226563, 0.9412842)
      23/7/2021,16:10:13,(-0.01452637, -0.07678223, 0.9453125)
      23/7/2021,16:10:13,(-0.008178711, -0.08996582, 0.9555054)
      23/7/2021,16:10:13,(-0.03857422, -0.08209229, 0.9738159)
      

      total data collected value is 275.

      Please someone check it and correct me where i am doing it error.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Chandan Verma
        last edited by

        @Chandan-Verma see https://forum.pycom.io/topic/6963/pytrack-s-accelerometer-sampling-rate/4 for a discussion on the topic.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom