'DZ292'에 해당되는 글 1건

  1. 2016.10.05 DZ292 Laser Receiver Module (DZ292) [S035]

DZ292 Laser Receiver Module (DZ292) [S035]



https://www.youtube.com/watch?v=iPmirgi-yPs


* GitHubhttps://github.com/rdiot/rdiot-s035.git


* Specs

PCB size:1.52*2.22cm

work voltage:5V

Output:

output high level when receive laser signal;

output low level when not receive laser signal.


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int laserPin = 2; // Laser

int laserRcvPin = 7; // Laser Receiver


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(laserPin,OUTPUT);

  pinMode(laserRcvPin,INPUT);


  digitalWrite(laserPin, HIGH);

  delay(1000);


  lcd.clear();

}


void loop()

  lcd.setCursor(0,0);

  lcd.print("S035:DZ292 LaserRCV");


  int rcv = digitalRead(laserRcvPin);


  lcd.setCursor(0,2);

  lcd.print("laser value=" + (String)rcv);


  if(rcv == 1)

  {

    lcd.setCursor(0,3);

    lcd.print("laser detected");

  }

  else

  {  

    lcd.setCursor(0,3);

    lcd.print("                    ");

  }

}

'3) Actuator > Laser' 카테고리의 다른 글

Laser+LED 2 in 1 module [D048]  (0) 2016.10.05
Red Laser Cross Line Module + [D037]  (0) 2016.10.05
Red Laser Line Module - [D036]  (0) 2016.10.05
650nm Laser Diode Module (KY-008) [D004]  (0) 2016.10.05
Red Laser Point Linear Module [D079]  (0) 2016.09.05
Posted by RDIoT
|