Kết quả 11 đến 13 của 13
Chủ đề: hướng dẫn dùm mình đồ án này với
-
03-05-2016, 05:47 PM #11
Junior Member
- Ngày tham gia
- Jan 2016
- Bài viết
- 0
Gửi bởi lowpass
-
03-05-2016, 07:50 PM #12
Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi RyuKat
-
03-06-2016, 03:45 AM #13
Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Code lấy mã phím remote: dùng code theo mặc định của thư viện IR remote master
Mã:/* * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com */ #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } }
mã code của phím cuối cùng remote PANASONIC thu được là 0XD28EF217
) chèn thêm đoạn code sau:
Mã:/* * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com */ #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { pinMode(10, OUTPUT); Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); if (results.value == 0XD28EF217) { if(digitalRead(10) == LOW) { digitalWrite(10, HIGH);} else { digitalWrite(10, LOW);} } delay(100); irrecv.resume(); // Receive the next value } }
Taxi sân bay giá rẻ, Nội Bài đi...
Hôm nay, 03:09 PM in Rao vặt tổng hợp