Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is not supported at present. Please extend your EasyEDA usage duration and try again.
Editor Version×
Standard
1.Easy to use and quick to get started
2.The process supports design scales of 300 devices or 1000 pads
3.Supports simple circuit simulation
4.For students, teachers, creators
Profession
1.Brand new interactions and interfaces
2.Smooth support for design sizes of over 5,000 devices or 10,000 pads
3.More rigorous design constraints, more standardized processes
with this sheild u can controll a 2 relays using an IR remote.BELOW IS THE CODE. AND NOTE,(IF THE REMOTE CORDIATES ARE DIFFERENT COMPARING TO THE ONE IN THE CODE,SIMPLY GO TO EXAMPLES>IR REMOTE>IR RECIV_DUMP. ONCE U GET THE NUMBERS U CAN TYPTE IT IN UR CODE.
________________THE CODE____________________
/*
* 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
int RECV_PIN = 10;
int RELAY_PIN = 6;
int RELAY_PIN2 = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
// decode_results *results = (decode_results *)v
void dump(decode_results *results) {
int count = results->rawlen;
}
void setup()
{
pinMode(RELAY_PIN, OUTPUT);
pinMode(RELAY_PIN2,OUTPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
int on = 0;
unsigned long last = millis();
#define BUTTON_1 0xFF30CF
#define BUTTON_2 0xFF18E7
#define BUTTON_3 0xFF7A85
#define BUTTON_0 0xFF6897
#define BUTTON_OK 0xFF629D
void loop() {
if (irrecv.decode(&results)) {
if (results.value == BUTTON_2)
{
on = !on;
digitalWrite(RELAY_PIN, on ? HIGH : LOW);
digitalWrite(13, on ? HIGH : LOW);
dump(&results);
if (results.value == BUTTON_1)
{
on = !on;
digitalWrite(RELAY_PIN2, on ? HIGH : LOW);
digitalWrite(13, on ? HIGH : LOW);
dump(&results);
}
if (results.value == BUTTON_OK)
{
on = !on;
digitalWrite(RELAY_PIN2, on ? HIGH : LOW);
digitalWrite(RELAY_PIN, on ? HIGH : LOW);
digitalWrite(13, on ? HIGH : LOW);
dump(&results);
}
irrecv.resume(); // Receive the next value
}
}
Forked project will be set private in personal workspace. Do you continue?
Clone
Project
The Pro editor is about to be opened to save as. Do you want to continue?
private message
Send message to felectronet
Delete
Comment
Are you sure to delete the comment?
Report
ARDUINO IR HOME AUTOMATION SYSTEM SHEILD copy
No Profile
Announcer: felectronet
Creation time: 2019-01-11 23:03:12
Published time:
2019-01-11 23:03:13
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
Submitted successfully! The review result can be viewed in the personal
center, review notification.
Kind tips
Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is
not supported at present. Please extend your EasyEDA usage duration and try again.
Share
Project
Copy
Copy
Scan the QR code and open it on the mobile terminal