Last active
October 17, 2019 14:39
-
-
Save fxprime/7dd49600db72ee2cef1391c35545826e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| www.arduinoNa.com | |
| ตัวอย่างcodeสำหรับเซนเซอร์ตรวจจับเปลวไฟ 5 หัว | |
| **/ | |
| void setup() { | |
| //เริ่มสื่อสารระหว่างคอมกับarduinoด้วยความเร็ว 115200 bps | |
| Serial.begin(115200); | |
| } | |
| void loop() { | |
| // อ่านค่าเซนเซอร์จาก analog A0 - A4: | |
| int flameSens[5] = {analogRead(A0), analogRead(A1), analogRead(A2), analogRead(A3), analogRead(A4)}; | |
| Serial.print(flameSens[0]);Serial.print(","); | |
| Serial.print(flameSens[1]);Serial.print(","); | |
| Serial.print(flameSens[2]);Serial.print(","); | |
| Serial.print(flameSens[3]);Serial.print(","); | |
| Serial.println(flameSens[4]); | |
| delay(50); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment