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.

Arduino UNOとNJL7502Lでなんちゃってluxをシリアル出力(明るさ)

Last updated at Posted at 2023-12-26

Arduino UNOとNJL7502Lでなんちゃってluxをシリアル出力(明るさ)

x約2Vで約400luxにならないといけないがたんに電圧の200倍にする

目的
adcのテスト用

構成
Arduino UNO
NJL7502L

2V → 400lux
3.3V → 660lux
5V → 1000lux

3.3V
(s * 660)>>10

5V
(s * 1000)>>10

o_cop876.jpg

o_cop877.jpg

o_cop878.jpg

o_cop879.jpg

o_cop880.jpg



//S_SER_NJL7502_UNO_1

//インクルド
#include <Arduino.h>


//初期化
void setup()
{

  //シリアルの初期化
  Serial.begin(9600);

} //setup


//メインループ
void loop()
{

  //アナログ値の読み込み
  int s = analogRead(A0);

  //s=250;

  //温度の表示
  Serial.println( (long)((long)s * (long)1000) >> 10 );

  //1秒の待ち
  delay(1000);

} //loop


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?