Skip to content

VEML6070

Nishikori Koji edited this page Feb 24, 2022 · 3 revisions

VEML6070

UV光センサ

コードURL: https://github.com/gfd-dennou-club/iotex-esp32-mrubyc/blob/master/mrblib/models/veml6070.rb

サンプルコード: https://github.com/gfd-dennou-club/iotex-esp32-mrubyc/blob/master/example/master.rb.veml6070

コンストラクタ

VEML6070.new(i2c)

  • i2c : I2Cクラスのオブジェクト

example

i2c = I2C.new(22, 21)
veml6070 = VEML6070.new(i2c)

初期化

VEML6070.init()

example

veml6070.init

UVデータの取得

VEML6070.get_uv()

example

uv = veml6070.get_uv

UVデータをUVインデックスに変換

VEML6070.get_uv_index()

example

uv_index = veml6070.get_uv_index