Prepare for Merge

This commit is contained in:
Aadi Desai 2022-03-01 16:42:12 +00:00
parent eb0e171a88
commit ba771c7606
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9
3 changed files with 2 additions and 628 deletions

5
.gitignore vendored
View file

@ -152,7 +152,4 @@ cython_debug/
#.idea/ #.idea/
# VSCode # VSCode
.vscode/ .vscode/
# Matlab files
.m

38
main.py
View file

@ -1,37 +1 @@
from lis3dh import * print("Raspberry Pi Zero W, up and running!")
from datetime import datetime
import signal
import sys
import RPi.GPIO as GPIO
print("Raspberry Pi Zero W, up and running!")
bus = smbus2.SMBus(1)
accel = lis3dh(bus,2,1)
print("LIS3DH initiated successfully!")
INT1 = 18
INT2 = 17
def signal_handler(sig,frame):
GPIO.cleanup()
sys.exit(0)
def int1_callback(channel):
# do something here
GPIO.setmode(GPIO.BCM)
# # Data logging
# now = datetime.now()
# date_time = now.strftime("%d_%m_%Y_%H_%M_%S")
# name = "output_"+date_time+".txt"
# f = open(name,"x")
# print("X","Y","Z", file=f)
# f.close()
while True:
[X,Y,Z] = accel.readAll()
print("X: ",X,"\tY: ",Y,"\t Z: ",Z,"\n")
# with open(name,"a") as f:
# print(X,Y,Z, file=f)

View file

@ -1,587 +0,0 @@
X Y Z
0.09375 0.03125 1.03125
0.03125 -0.015625 1.03125
0.046875 0.015625 1.015625
0.0625 0.015625 1.03125
0.0625 0.0 1.03125
0.125 0.0 1.0
0.046875 0.015625 1.03125
0.046875 0.015625 1.046875
0.0625 0.015625 1.03125
0.046875 0.015625 0.90625
0.046875 0.015625 0.890625
0.0625 0.03125 0.984375
0.046875 0.015625 1.03125
0.046875 0.015625 1.03125
0.0625 0.015625 1.03125
0.0625 0.015625 1.03125
0.03125 0.03125 1.03125
0.0625 0.015625 1.015625
0.03125 0.0 1.03125
0.046875 0.015625 1.03125
0.03125 -0.015625 1.078125
0.0625 0.015625 1.03125
0.046875 0.015625 1.03125
0.0625 0.015625 1.03125
0.0625 0.03125 0.984375
0.03125 -0.015625 1.03125
0.0625 0.0 1.015625
0.046875 0.0 1.015625
0.0625 0.03125 1.0
0.0625 0.015625 1.03125
0.03125 0.0 1.03125
0.046875 0.03125 0.953125
0.015625 0.015625 1.03125
0.0625 0.015625 1.03125
0.046875 0.015625 1.03125
0.046875 0.0 1.0625
0.03125 0.015625 1.03125
0.046875 0.015625 1.03125
0.03125 0.015625 1.03125
0.015625 -0.015625 1.078125
0.015625 0.03125 1.03125
0.046875 0.015625 1.03125
0.09375 -0.015625 0.9375
0.046875 0.015625 1.03125
0.0625 0.015625 1.03125
0.046875 0.0 1.015625
0.046875 0.015625 1.015625
0.046875 0.0 1.015625
0.046875 0.015625 1.015625
0.046875 0.015625 1.0
0.0625 -0.03125 1.078125
0.0625 0.03125 1.03125
0.046875 0.015625 1.0625
0.0625 0.015625 0.953125
0.0625 0.015625 1.03125
0.0625 0.015625 1.015625
0.0625 0.015625 1.0
0.078125 0.015625 0.9375
0.0625 0.015625 1.03125
0.046875 0.0 1.03125
0.0625 0.015625 1.046875
0.046875 -0.015625 1.03125
0.0625 0.015625 1.046875
0.0625 0.0 1.046875
0.046875 0.0 1.0
0.046875 0.03125 1.03125
0.03125 0.0 1.03125
0.046875 0.0 0.9375
0.0625 0.015625 1.109375
0.046875 0.0 1.03125
0.0625 0.015625 1.046875
0.046875 0.0 1.03125
0.046875 0.015625 1.109375
0.0625 0.015625 1.015625
0.03125 -0.015625 1.03125
0.015625 0.0 0.921875
0.0625 0.03125 1.015625
0.0625 0.015625 1.03125
0.0625 0.015625 1.03125
0.046875 0.0 1.03125
0.078125 0.015625 1.03125
0.0625 0.0 1.046875
0.046875 0.015625 1.046875
0.03125 -0.015625 1.078125
0.046875 0.0 1.03125
0.046875 0.015625 1.03125
0.046875 -0.015625 0.953125
0.046875 0.015625 1.015625
0.0625 0.0 1.03125
0.046875 0.0 0.953125
0.046875 0.015625 1.03125
0.046875 0.0 1.046875
0.046875 0.015625 1.03125
0.046875 0.015625 1.046875
0.0625 -0.421875 0.96875
-0.15625 0.09375 1.0625
-0.03125 0.109375 1.171875
0.0 0.046875 1.171875
0.09375 0.078125 1.0625
0.109375 0.234375 1.09375
0.1875 0.3125 1.125
0.234375 0.296875 1.0
0.328125 0.390625 0.90625
0.3125 0.46875 0.71875
0.34375 0.546875 0.59375
0.375 0.703125 0.609375
0.25 0.765625 0.453125
0.234375 0.75 0.359375
0.140625 0.65625 0.265625
0.0625 0.703125 0.328125
0.0 0.859375 0.390625
0.0625 0.875 0.359375
0.21875 0.921875 0.4375
0.21875 0.984375 0.703125
0.390625 0.75 0.78125
0.5 0.671875 0.796875
0.375 0.640625 0.875
0.25 0.5625 0.84375
0.234375 0.578125 0.796875
0.234375 0.703125 0.828125
0.328125 0.609375 0.78125
0.25 0.609375 0.71875
0.109375 0.9375 0.734375
0.015625 0.84375 0.828125
0.140625 0.625 0.84375
0.265625 0.578125 0.78125
0.390625 0.390625 0.8125
0.359375 0.578125 0.796875
0.34375 0.703125 0.84375
0.359375 0.375 0.765625
0.515625 -0.40625 0.53125
0.40625 -0.71875 0.59375
0.390625 -0.390625 0.828125
0.375 -0.640625 0.671875
0.375 -1.328125 0.421875
0.25 -0.984375 0.234375
0.09375 -0.921875 0.046875
0.140625 -1.0625 -0.078125
-0.015625 -0.890625 -0.265625
0.015625 -0.9375 -0.09375
-0.34375 -0.828125 -0.0625
-0.296875 -0.84375 -0.4375
-0.1875 -0.9375 -0.5
-0.265625 -0.78125 -0.578125
-0.234375 -0.796875 -0.453125
-0.4375 -0.796875 -0.546875
-0.3125 -0.859375 -0.5
-0.25 -1.109375 -0.46875
0.0 -0.890625 -0.421875
-0.296875 -0.828125 -2.0
-0.25 -0.578125 -0.59375
-0.3125 -0.703125 -0.75
-0.15625 -0.390625 -0.5625
-0.015625 -0.296875 -0.703125
0.15625 -0.46875 -0.796875
0.203125 -0.515625 -0.71875
0.40625 -0.578125 -0.484375
0.140625 -0.265625 -0.359375
0.078125 -0.703125 -0.609375
0.015625 -0.625 -0.4375
-0.234375 -0.78125 -0.265625
-0.25 -0.828125 -0.453125
-0.15625 -0.859375 -0.359375
-0.03125 -0.796875 -0.046875
0.09375 -1.109375 0.5625
-0.125 -0.6875 0.46875
-0.140625 -0.546875 0.84375
-0.21875 -0.4375 0.875
-0.359375 -0.390625 0.734375
-0.40625 -0.34375 0.84375
-0.421875 -0.34375 0.71875
-0.421875 -0.46875 0.890625
-0.4375 -0.421875 0.703125
-0.21875 -0.5625 1.078125
-0.21875 -0.625 0.6875
-0.484375 -0.59375 0.375
-0.703125 -0.703125 0.4375
-0.40625 -0.609375 0.375
-0.546875 -0.796875 0.65625
-0.6875 -0.9375 0.578125
-0.484375 -0.609375 0.4375
-0.4375 -0.703125 0.421875
-0.5 -0.609375 0.421875
-0.4375 -0.5 0.5625
-0.40625 -0.390625 0.234375
-0.234375 -0.25 0.3125
-0.328125 -1.1875 0.59375
-0.265625 -0.9375 0.796875
0.046875 -0.921875 0.625
-0.015625 -0.984375 0.75
0.03125 -0.734375 0.65625
0.03125 -0.8125 0.640625
0.03125 -0.765625 0.75
0.0 -0.875 0.703125
-0.015625 -0.640625 0.59375
-0.046875 -0.734375 0.609375
-0.078125 -0.6875 0.640625
0.046875 -0.546875 0.640625
-0.09375 -0.65625 0.765625
0.0625 -0.875 1.0
-0.140625 -0.78125 0.9375
0.15625 -0.875 0.59375
-0.015625 -0.71875 0.796875
0.125 -0.609375 0.53125
0.140625 -0.5625 0.5625
0.09375 -0.71875 0.71875
0.0625 -1.09375 0.75
-0.09375 -1.0 0.796875
0.15625 -0.703125 0.5
0.1875 -0.5 0.53125
0.125 -0.671875 0.59375
-0.046875 -0.8125 0.71875
0.3125 -1.0 0.671875
0.28125 -0.5625 0.40625
0.296875 -0.8125 0.484375
0.28125 -0.890625 0.5625
0.265625 -0.75 0.609375
0.234375 -0.8125 0.578125
0.25 -0.828125 0.5
0.28125 -0.828125 0.609375
0.3125 -1.015625 0.5625
0.21875 -0.75 0.6875
0.09375 -0.671875 0.484375
0.0625 -0.640625 0.609375
-0.09375 -0.78125 0.65625
-0.03125 -0.828125 0.59375
-0.046875 -0.65625 0.71875
-0.0625 -0.6875 0.65625
-0.109375 -0.671875 0.578125
-0.234375 -0.703125 0.515625
-0.328125 -0.75 0.53125
-0.375 -0.78125 0.515625
-0.40625 -0.828125 0.40625
-0.359375 -0.703125 0.5
-0.34375 -0.6875 0.4375
-0.3125 -0.671875 0.59375
-0.3125 -0.671875 0.625
-0.3125 -0.640625 0.640625
-0.421875 -0.75 0.6875
-0.3125 -0.59375 0.75
-0.34375 -0.71875 0.6875
-0.296875 -0.5 0.796875
-0.28125 -0.609375 0.6875
-0.25 -0.546875 0.765625
-0.1875 -0.546875 0.75
-0.203125 -0.59375 0.765625
-0.265625 -0.6875 0.8125
-0.125 -0.59375 0.625
-0.171875 -0.5 0.828125
-0.171875 -0.59375 0.8125
-0.09375 -0.59375 0.796875
-0.140625 -0.765625 0.765625
-0.09375 -0.859375 0.75
-0.015625 -0.75 0.625
-0.078125 -0.71875 0.671875
-0.046875 -0.765625 0.625
0.0 -0.640625 0.65625
-0.03125 -0.796875 0.640625
0.015625 -0.625 0.765625
-0.0625 -0.625 0.828125
0.015625 -0.515625 0.90625
0.0625 -0.546875 0.8125
0.0 -0.53125 0.984375
0.03125 -0.671875 0.859375
0.015625 -0.5 0.828125
0.078125 -0.5625 0.90625
0.078125 -0.578125 0.96875
0.0625 -0.46875 0.828125
0.015625 -0.515625 0.890625
0.0625 -0.53125 0.796875
0.109375 -0.4375 0.890625
0.125 -0.578125 0.84375
0.4375 -0.703125 0.84375
0.28125 -0.671875 0.78125
-0.125 -0.765625 0.71875
-0.046875 -0.796875 0.84375
0.265625 -0.625 0.609375
0.359375 -0.546875 0.5
0.5625 -0.640625 0.59375
0.25 -0.734375 0.6875
0.28125 -0.875 0.546875
0.265625 -0.84375 0.578125
0.328125 -0.78125 0.515625
0.359375 -0.71875 0.671875
0.59375 -0.890625 0.71875
0.609375 -0.421875 0.625
0.5625 -0.59375 0.5
0.5625 -0.625 0.5
0.484375 -0.5625 0.6875
0.34375 -0.78125 0.65625
0.3125 -0.796875 0.78125
0.484375 -0.828125 0.625
0.40625 -0.859375 0.671875
0.359375 -1.03125 0.390625
0.328125 -0.890625 0.859375
0.421875 -0.765625 0.78125
0.421875 -0.46875 0.203125
0.1875 -0.515625 0.65625
0.359375 -0.734375 0.453125
0.203125 -0.71875 0.640625
0.09375 -0.828125 0.65625
0.21875 -1.03125 0.84375
0.046875 -0.890625 0.71875
-0.1875 -0.734375 0.84375
-0.125 -0.796875 0.9375
0.0 -1.0625 0.703125
0.15625 -0.890625 0.6875
0.0625 -0.765625 0.71875
-0.046875 -0.71875 0.46875
-0.125 -0.578125 0.515625
-0.25 -0.515625 0.578125
-0.21875 -0.5 0.703125
-0.234375 -0.5 0.8125
-0.25 -0.5 0.953125
-0.109375 -0.765625 0.75
-0.03125 -0.6875 0.8125
0.0 -0.65625 0.828125
-0.015625 -0.671875 0.8125
-0.015625 -0.9375 0.53125
-0.125 -0.828125 0.546875
-0.046875 -0.828125 0.421875
-0.109375 -0.90625 0.3125
-0.1875 -0.828125 0.40625
-0.390625 -0.890625 0.5
-0.25 -0.890625 0.390625
-0.078125 -0.609375 0.53125
0.015625 -0.59375 0.46875
-0.09375 -0.515625 0.484375
-0.15625 -0.90625 0.515625
-0.046875 -1.0 0.375
-0.046875 -1.265625 0.234375
-0.015625 -0.921875 0.296875
-0.109375 -0.78125 0.234375
0.078125 -1.0 0.28125
0.0 -1.046875 0.078125
0.09375 -0.90625 0.203125
0.0 -0.953125 0.171875
0.015625 -0.953125 0.203125
-0.0625 -1.109375 0.078125
0.15625 -0.984375 0.1875
0.328125 -0.890625 -0.09375
0.453125 -0.796875 0.1875
0.453125 -0.78125 -0.1875
0.578125 -0.71875 -0.03125
1.15625 -1.375 -1.578125
0.59375 -0.40625 -0.125
1.046875 -0.375 -0.046875
1.015625 -0.359375 0.0625
1.078125 -0.078125 0.1875
1.078125 -0.0625 0.140625
1.015625 0.078125 0.109375
0.921875 -0.046875 0.078125
1.0 -0.046875 -0.015625
1.0 -0.015625 0.109375
1.046875 0.15625 0.09375
0.953125 0.109375 0.125
0.953125 0.078125 0.125
0.984375 0.078125 0.109375
1.015625 0.078125 0.15625
0.890625 0.109375 0.0625
0.890625 0.234375 0.1875
0.953125 0.015625 0.09375
1.03125 0.0625 0.1875
0.984375 -0.046875 0.109375
0.984375 -0.0625 0.1875
0.890625 0.15625 -0.046875
1.015625 -0.046875 0.40625
0.984375 -0.015625 0.296875
0.796875 0.078125 0.3125
0.875 0.015625 0.390625
0.859375 -0.078125 0.5
1.265625 0.21875 0.46875
0.9375 0.109375 -0.0625
0.90625 0.078125 0.21875
0.90625 0.015625 0.171875
0.921875 0.015625 0.28125
1.09375 -0.0625 0.1875
1.25 0.0625 -0.0625
0.75 0.40625 0.140625
0.953125 0.0625 0.125
0.8125 0.046875 0.1875
0.90625 0.0625 0.3125
0.796875 0.078125 0.390625
1.3125 0.078125 0.125
0.984375 0.296875 -0.09375
0.96875 0.0625 0.03125
1.03125 0.109375 0.09375
0.984375 0.140625 0.0625
0.9375 0.109375 0.09375
0.953125 0.09375 0.078125
0.984375 0.171875 0.046875
1.03125 0.140625 0.015625
0.953125 0.171875 -0.015625
0.984375 0.234375 -0.09375
0.78125 0.328125 -0.03125
1.046875 0.234375 0.03125
1.578125 0.25 0.578125
0.546875 -0.0625 0.234375
0.859375 0.109375 0.203125
0.859375 0.28125 0.140625
0.78125 0.25 0.03125
1.609375 0.234375 0.109375
1.5 -0.21875 0.21875
0.6875 0.140625 0.125
1.015625 0.078125 0.15625
0.921875 0.125 -0.015625
0.8125 0.296875 -0.1875
1.21875 0.203125 0.34375
1.25 0.0625 0.375
0.671875 -0.125 0.390625
1.0 0.125 0.265625
0.921875 0.015625 0.28125
0.921875 0.203125 0.03125
0.9375 0.0625 0.046875
0.921875 0.140625 0.0625
0.984375 0.15625 0.09375
0.9375 0.078125 0.015625
0.9375 0.09375 0.015625
0.984375 0.078125 0.03125
0.984375 0.046875 0.0625
0.859375 0.1875 -0.015625
0.9375 0.046875 0.4375
0.953125 0.171875 0.234375
0.765625 0.046875 0.234375
0.875 0.09375 0.421875
0.96875 0.0625 0.4375
1.171875 0.34375 -0.09375
0.84375 0.375 -0.125
0.921875 -0.109375 0.125
0.828125 0.140625 0.171875
1.0 -0.015625 0.4375
1.0625 -0.046875 0.046875
0.953125 0.53125 -0.0625
1.078125 0.03125 -0.0625
0.671875 -0.015625 0.15625
0.890625 -0.09375 0.375
1.25 0.34375 0.03125
0.78125 0.109375 0.15625
0.75 0.203125 -0.015625
0.953125 0.1875 0.140625
0.96875 0.171875 0.109375
0.953125 0.09375 0.140625
0.96875 0.1875 0.15625
0.96875 0.078125 0.09375
0.9375 0.03125 0.078125
0.9375 0.25 0.140625
0.90625 0.25 0.078125
0.875 0.265625 0.0625
0.96875 0.421875 0.0
0.96875 0.109375 0.359375
0.96875 0.046875 0.4375
0.8125 0.234375 0.21875
0.765625 0.296875 0.0625
0.859375 0.5 0.109375
1.59375 -0.015625 -0.203125
1.515625 -0.109375 0.359375
0.71875 0.125 0.15625
0.984375 0.1875 0.109375
1.0 0.140625 0.078125
0.8125 0.28125 -0.171875
1.296875 0.4375 0.234375
1.046875 0.171875 0.484375
0.890625 -0.09375 0.4375
0.71875 0.140625 0.234375
0.9375 0.25 0.25
0.828125 0.15625 0.234375
1.421875 0.5 0.296875
0.65625 0.0625 0.15625
1.015625 0.328125 0.109375
0.875 0.265625 0.171875
0.953125 0.1875 0.21875
0.984375 0.296875 0.125
0.9375 0.125 0.28125
0.96875 0.328125 0.15625
0.921875 0.21875 0.109375
0.953125 0.3125 0.125
0.921875 0.25 0.15625
0.9375 0.265625 0.171875
0.953125 0.234375 0.1875
0.921875 0.25 0.1875
0.9375 0.25 0.1875
0.9375 0.234375 0.1875
0.9375 0.25 0.1875
0.9375 0.265625 0.171875
0.921875 0.25 0.109375
0.9375 0.234375 0.203125
1.015625 0.265625 0.171875
0.9375 0.234375 0.09375
1.0 0.21875 0.171875
0.953125 0.140625 0.15625
0.984375 0.140625 0.078125
0.984375 0.015625 0.046875
0.90625 -0.03125 0.09375
0.984375 -0.015625 0.0
1.0 -0.0625 -0.03125
1.0 -0.21875 -0.21875
0.78125 -0.359375 -0.15625
0.953125 -0.578125 -0.328125
0.90625 -0.484375 -0.359375
0.9375 -1.21875 -1.59375
0.765625 -0.5625 -0.515625
0.671875 -0.53125 -0.8125
0.625 -0.5625 -0.515625
0.90625 -0.796875 0.515625
0.4375 -0.4375 -0.359375
0.609375 -0.65625 -0.15625
0.484375 -0.734375 0.359375
0.734375 -0.90625 0.203125
0.28125 -1.171875 0.1875
-0.015625 -0.984375 0.0625
0.046875 -1.046875 0.09375
0.40625 -1.109375 0.171875
0.578125 -0.875 -0.078125
0.3125 -0.84375 -0.09375
0.078125 -0.75 0.0
0.078125 -0.734375 0.125
-0.1875 -0.890625 0.53125
-0.46875 -0.46875 1.234375
-0.359375 -0.203125 1.140625
-0.359375 -0.046875 0.859375
-0.078125 -0.484375 1.171875
-0.203125 0.125 0.890625
0.015625 -0.03125 1.125
-0.21875 -0.171875 0.203125
0.0 -0.0625 0.65625
0.03125 -0.015625 0.96875
-0.015625 -0.015625 1.03125
0.03125 0.0 1.015625
0.03125 0.0 1.015625
0.03125 0.0 0.9375
0.046875 0.0 1.03125
0.046875 0.0 1.015625
0.03125 0.015625 1.03125
0.046875 0.0 1.046875
0.046875 0.015625 1.015625
0.046875 0.0 0.984375
0.046875 0.015625 1.015625
0.046875 0.0 1.03125
0.046875 0.015625 1.03125
0.0 0.0 0.984375
0.046875 0.015625 1.03125
0.03125 0.015625 1.03125
0.046875 0.0 1.03125
0.046875 0.0 1.015625
0.046875 0.0 1.03125
0.046875 0.0 1.03125
0.03125 0.0 1.03125
0.03125 0.015625 1.03125
-0.03125 0.015625 0.96875
0.046875 0.0 1.03125
0.03125 0.0 1.03125
0.046875 0.015625 1.03125
0.03125 0.015625 1.015625
0.03125 0.0 1.03125
0.03125 -0.015625 1.03125
0.03125 0.015625 1.015625
0.046875 0.0 1.03125
-0.0625 0.0 0.984375
0.03125 0.0 1.03125
0.03125 0.015625 1.015625
0.015625 0.0 1.046875
0.046875 0.0 1.046875
0.046875 0.0 1.03125
0.046875 -0.015625 1.015625
0.03125 0.015625 1.03125
0.046875 0.015625 1.03125
0.03125 0.0 0.921875
0.046875 0.015625 1.03125
0.03125 0.0 1.03125
0.03125 0.0 1.015625
0.03125 -0.015625 1.03125
0.03125 0.0 1.03125
0.03125 0.0 1.015625
0.03125 0.046875 1.109375
0.046875 0.015625 1.046875
0.03125 0.03125 1.03125
0.046875 0.03125 1.015625
0.03125 0.0 1.03125
0.046875 0.015625 1.015625
-0.015625 0.0 1.03125
0.046875 0.015625 1.03125
0.03125 0.0 0.953125
0.03125 0.015625 1.046875
0.046875 0.015625 1.03125
0.03125 0.0 0.90625
0.03125 0.0 1.015625