CDS5MM~CDS20MM Value [S003~S006]
https://www.youtube.com/watch?v=660-OrdtU4E
*GitHub : https://github.com/rdiot/rdiot-s003.git
* Contents
- Connect
A0, A1, A2, A3
- Key Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // LCD2004
int sensorPin1 = A0;
int sensorPin2 = A1;
int sensorPin3 = A2;
int sensorPin4 = A3;
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("start LCD2004");
}
void loop()
{
int rate1 = analogRead(sensorPin1);
int rate2 = analogRead(sensorPin2);
int rate3 = analogRead(sensorPin3);
int rate4 = analogRead(sensorPin4);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("[1]CDS05MM=" + (String)rate1);
lcd.setCursor(0,1);
lcd.print("[2]CDS10MM=" + (String)rate2);
lcd.setCursor(0,2);
lcd.print("[3]CDS15MM=" + (String)rate3);
lcd.setCursor(0,3);
lcd.print("[4]CDS20MM=" + (String)rate4);
delay(200);
}
'2) Sensor > CDS_Photocell' 카테고리의 다른 글
Load CDS sensor type values into DB by calling server API [P001] (0) | 2016.09.08 |
---|---|
Auto On Off Photo Switch (AS-10-220) [S157] (0) | 2016.09.08 |
BH1750 Digital Light intensity Sensor Module (GY-302) [S085] (0) | 2016.09.08 |
Photo Resistor Module (KY-018) [S002] (0) | 2016.09.08 |
Mini Photocell (FIT0180) [S001] (0) | 2016.09.08 |