0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ArduinoUno: 光センサ・モジュールを使う

0
Last updated at Posted at 2021-07-19

Arduino の光センサ・モジュールを使う方法です。

A0 に 光センサ・モジュール
I2C に Grove-LCD RGB Backlight v4.0
を接続します。
IMG_20210719_154849.jpg

image.png

light/light.ino
#include "rgb_lcd.h"
rgb_lcd lcd;

int val = 0;

void setup() {
	lcd.begin(16,2);
	lcd.setRGB(0, 255, 255);
}

void loop() {
    val = analogRead(A0);
    lcd.setCursor(0,0);
    lcd.print ("val = " + String(val) + "      ");
    delay(500);   
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?