]>
vault307.fbx.one Git - random.git/blob - photocellCounter.py
1 #!/usr/bin/env micropython
2 from machine
import ADC
, Pin
4 from machine
import RTC
13 def readLight(photoGP
):
15 light
=photoRes
.read_u16()
16 light
=round(light
/65535*100,2)
19 file=open('photoLog.txt','w')
21 file.write("light: "+str(readLight(photoPIN
))+"%"+ str(rtc
.datetime())+"\n")
23 print("light: " + str(readLight(photoPIN
)) +"%")