Skip to content

Instantly share code, notes, and snippets.

@penpencool
Last active June 22, 2018 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penpencool/c79e42bfff713ce769c6e9cefe5edca0 to your computer and use it in GitHub Desktop.
Save penpencool/c79e42bfff713ce769c6e9cefe5edca0 to your computer and use it in GitHub Desktop.
/*
ตัวอย่างโคด ArduinoAll LJ18A3-8-Z
สายสีน้ำเงิน - GND
สายสีน้ำตาล - 5V
สายสีดำ - 7
*/
void setup() {
Serial.begin(9600);
Serial.println("ArduinoAll Example LJ18A3-8-Z");
}
void loop() {
int detect = digitalRead(7);
if (detect == 1) {
Serial.println("Found");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment