Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * = potentially a hit on another surface than the pellets in the hopper
- 44 2018-10-17 11:08:39
- 33 2018-10-17 11:24:40 *
- 41 2018-10-17 11:25:00
- 49 2018-10-17 12:01:03
- 42 2018-10-17 12:01:23
- 36 2018-10-17 13:41:49 *
- 340376 2018-10-17 13:43:09 ???
- 40 2018-10-17 13:43:29
- 33 2018-10-17 14:06:50 *
- 40 2018-10-17 14:07:10
- 32 2018-10-17 14:56:13 *
- 40 2018-10-17 14:56:33
- 30 2018-10-17 15:24:35 *
- 39 2018-10-17 15:24:55
- 32 2018-10-17 15:56:57 *
- 41 2018-10-17 15:57:17
- 35 2018-10-17 16:34:59 *
- 41 2018-10-17 16:35:39
- 33 2018-10-17 17:33:42 *
- 41 2018-10-17 17:34:02
- 49 2018-10-17 18:00:44
- 41 2018-10-17 18:04:44
- 49 2018-10-17 18:11:25
- 42 2018-10-17 18:12:25
- 52 2018-10-17 18:39:46
- 44 2018-10-17 18:40:06
- 36 2018-10-17 18:57:48 *
- 42 2018-10-17 18:58:08
- 69 2018-10-17 19:39:10
- 41 2018-10-17 19:39:30
- 68 2018-10-17 19:41:10
- 41 2018-10-17 19:41:30
- 48 2018-10-17 21:22:16
- 41 2018-10-17 21:27:56
- 48 2018-10-17 23:55:45
- 340385 2018-10-18 00:00:26 ???
- 45 2018-10-18 00:00:46
- 36 2018-10-18 00:31:48 *
- 44 2018-10-18 00:32:08
- 36 2018-10-18 01:02:49 *
- 44 2018-10-18 01:03:09
- 52 2018-10-18 06:28:29
- 44 2018-10-18 06:35:09
- 37 2018-10-18 07:48:54 *
- 44 2018-10-18 07:49:34
- 340395 2018-10-18 08:13:15 ???
- 46 2018-10-18 08:13:35
- #function to calculate deviation between current and previously read value
- def deviation(x,y):
- diff = abs(float(x)-float(y))
- avg = (float(x)+float(y))/2
- return (diff/avg)
- distance = int(round(duration*34000/2))
- if (distance != lastread):
- dev = deviation(lastread,distance)
- if (dev > allowableError):
- #save last entry, only if deviation is big enough.
- lastread = distance
- saveData(distance)
- print str(distance) + "tt" + str(datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'))
Add Comment
Please, Sign In to add comment