1
0
mirror of https://github.com/cmur2/python-veml6070.git synced 2024-07-24 17:02:19 +02:00
python-veml6070/demo.py

16 lines
510 B
Python
Raw Normal View History

2019-12-18 19:44:10 +01:00
#!/usr/bin/env python
2016-05-29 23:13:04 +02:00
import veml6070
ALL_INTEGRATION_TIMES = [
veml6070.INTEGRATIONTIME_1_2T, veml6070.INTEGRATIONTIME_1T, veml6070.INTEGRATIONTIME_2T, veml6070.INTEGRATIONTIME_4T
]
2016-05-29 23:13:04 +02:00
if __name__ == '__main__':
2018-03-14 23:17:54 +01:00
veml = veml6070.Veml6070()
for i in ALL_INTEGRATION_TIMES:
2018-03-14 23:17:54 +01:00
veml.set_integration_time(i)
uv_raw = veml.get_uva_light_intensity_raw()
uv = veml.get_uva_light_intensity()
print("Integration Time setting %d: %f W/(m*m) from raw value %d" % (i, uv, uv_raw))