Page 231 - เอกสารประกอบการสอนวิชาไมโครคอนโทรลเลอร์เบื้องต้น
P. 231

เอกสารประกอบการสอนวิชาไมโครคอนโทรลเลอร์เบื้องต้น    47



                   Circuit
























                   Schematic


























               Code

                              /*
                              *  Read input from push button for control status of LED.

                              *  Modify from button (http://www.arduino.cc/en/Tutorial/button)

                              * File : Button_LED. Ino
                              */

                       #define LED_PIN 11                  // choose the pin for the LED
                       #define IN_PIN 7                    // choose the input pin (for a pushbutton)

                       int val = 0;

               void setup ()
                       {




               หน่วยที่ 4 ฟังก์ชั่นพื้นฐานของ Arduino และการควบคุมหลอดไฟ LED                                 เรียบเรียงโดยครูทันพงษ์  ภู่รักษ์
   226   227   228   229   230   231   232   233   234   235   236