mirror of
https://github.com/supleed2/ELEC60013-ES-CW1.git
synced 2024-11-10 01:35:50 +00:00
Update main.py
This commit is contained in:
parent
84d18b2764
commit
123e092d4c
4
main.py
4
main.py
|
@ -1,4 +1,5 @@
|
||||||
from lis3dh import *
|
from lis3dh import *
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
print("Raspberry Pi Zero W, up and running!")
|
print("Raspberry Pi Zero W, up and running!")
|
||||||
bus = smbus2.SMBus(1)
|
bus = smbus2.SMBus(1)
|
||||||
|
@ -6,7 +7,8 @@ accel = lis3dh(bus,2,10)
|
||||||
|
|
||||||
print("LIS3DH initiated successfully!")
|
print("LIS3DH initiated successfully!")
|
||||||
|
|
||||||
f = open("output.txt","x")
|
name = "output_"+datetime.now()+".txt"
|
||||||
|
f = open(name,"x")
|
||||||
print("X","Y","Z", file=f)
|
print("X","Y","Z", file=f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue