LoginSignup
0
0

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

Last updated at Posted at 2023-12-28

参考

目的
ADCのテスト

o_cop883.jpg

o_cop884.jpg

主な変更箇所


Serial. を Serial_ にした。

1000 を 660 にした。

A0 を PB0 にした。

プログラム



//S_SER_NJL7502_STM8_1

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


//初期化
void setup()
{

  //シリアルの初期化
  Serial_begin(9600);

} //setup


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

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

  //s=250;

  //温度の表示
  Serial_println_u( (long)((long)s * (long)660) >> 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