A python library for accessing the VEML6070 digital UV light sensor from Vishay
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
510 B

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