A python library for accessing the VEML6070 digital UV light sensor from Vishay

demo.py 476B

12345678910111213
  1. import veml6070
  2. if __name__ == '__main__':
  3. veml = veml6070.Veml6070()
  4. for i in [veml6070.INTEGRATIONTIME_1_2T,
  5. veml6070.INTEGRATIONTIME_1T,
  6. veml6070.INTEGRATIONTIME_2T,
  7. veml6070.INTEGRATIONTIME_4T]:
  8. veml.set_integration_time(i)
  9. uv_raw = veml.get_uva_light_intensity_raw()
  10. uv = veml.get_uva_light_intensity()
  11. print "Integration Time setting %d: %f W/(m*m) from raw value %d" % (i, uv, uv_raw)