TAILIEUCHUNG - Practical Arduino Cool Projects for Open Source Hardware- P6

Practical Arduino Cool Projects for Open Source Hardware- P6: A schematic or circuit diagram is a diagram that describes the interconnections in an electrical or electronic device. In the projects presented in Practical Arduino, we’ve taken the approach of providing both a photograph and/or line drawing of the completed device along with a schematic. While learning to read schematics takes a modest investment of your time, it will prove useful time and time again as you develop your projects. With that in mind, we present a quick how-to in this section | CHAPTER 2 APPLIANCE REMOTE CONTROL else if val 2 Pulse the 2nd button Output 2 ON digitalWrite output2 HIGH delay buttonPressTime digitalWrite output2 LOW Output 2 OFF else if val 3 Pulse the 3rd button Output 3 ON digitalWrite output3 HIGH delay buttonPressTime digitalWrite output3 LOW Output 3 OFF else if val 4 Pulse the 4th button Output 4 ON digitalWrite output4 HIGH delay buttonPressTime digitalWrite output4 LOW Output 4 OFF else if val 5 Pulse the 5th button Output 5 ON digitalWrite output5 HIGH delay buttonPressTime digitalWrite output5 Low Output 5 OFF else if val 6 Pulse the 6th button Output 6 ON digitalWrite output6 HIGH delay buttonPressTime digitalWrite output6 LOW Output 6 OFF else if val 7 Pulse the 7th button Output 7 ON digitalWrite output7 HIGH delay buttonPressTime digitalWrite output7 LOW Output 7 OFF else if val 8 Pulse the 8th button Output 8 ON digitalWrite output8 HIGH delay buttonPressTime digitalWrite output8 Low Output 8 OFF 29 CHAPTER 2 APPLIANCE REMOTE CONTROL One subtlety that may not be apparent on first inspection of the code above is what sort of data is being examined in the series of if comparisons. You ll notice that the variable that holds the data from the serial port is of type byte which is not a numeric type it could actually be any character at all. Each if condition is comparing the data in the variable val with a string in quotes such as 1 or 2 not with the actual number 1 or 2. If that s beyond you right now don t worry about it. Things like variable types will become second nature as you spend more time working with Arduino. Once you ve loaded the sketch in the Arduino IDE plug your Arduino into the USB port select the port from Tools Serial Port select your Arduino board type from Tools Boards click verify to .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.