Created
June 12, 2018 09:07
-
-
Save penpencool/a23adf3334031cae07885b0a70d17a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example By ArduinoAll | |
int ledPin = 13; // ต่อ LED กับขา 13 | |
int inPin = 7; // ต่อกับเซนเซอร์สาย OUTPUT/สีดำ | |
int val = 0; | |
void setup() | |
{ | |
pinMode(ledPin, OUTPUT); | |
pinMode(inPin, INPUT); | |
} | |
void loop() | |
{ | |
val = digitalRead(inPin); // อ่านค่าจากเซนเซอร์ | |
digitalWrite(ledPin, val); // แสดงค่าออก LED | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment