Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <Ethernet.h>
- #include <BlynkSimpleEthernet.h>
- #include <IRremote.h>
- // You should get Auth Token in the Blynk App.
- // Go to the Project Settings (nut icon).
- char auth[] = "--REDACTED--";
- #define W5100_CS 10
- #define SDCARD_CS 4
- const int switchPin = 7;
- int delayPeriod = 500;
- int i;
- IRsend irsend;
- EthernetClient client;
- byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
- byte ip[] = { 192, 168, 0, 177 };
- char server[] = "blynk-cloud.com";
- void setup()
- {
- // Debug console
- Serial.begin(9600);
- Ethernet.begin(mac, ip);
- pinMode(SDCARD_CS, OUTPUT);
- digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
- Blynk.begin(auth);
- // You can also specify server:
- //Blynk.begin(auth, "blynk-cloud.com", 8442);
- //Blynk.begin(auth, IPAddress(192,168,1,100), 8442);
- // Set Switch pin as Input
- pinMode(switchPin, INPUT);
- }
- void loop()
- {
- int buttonState = 0;
- Blynk.run();
- // You can inject your own code or combine it with other sketches.
- // Check other examples on how to communicate with Blynk. Remember
- // to avoid delay() function!
- // Set button state depending upon switch position
- buttonState = digitalRead(switchPin);
- // If button is pressed send power code command
- if (buttonState == HIGH) {
- // NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
- // Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
- int khz = 38; //NB Change this default value as neccessary to the correct modulation frequency
- unsigned int Signal_0_0[] = {4550, 4400, 600, 1650, 550, 1650, 600, 1650, 550, 550, 600, 500, 600, 550, 550, 550, 600, 500, 600, 1650, 600, 1600, 600, 1650, 550, 550, 600, 500, 600, 550, 600, 500, 600, 500, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 500, 600, 500, 600, 500, 600, 550, 600, 1600, 600, 500, 650, 1600, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 650, 1600, 600}; //AnalysIR Batch Export - RAW
- irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0) / sizeof(int), khz); //AnalysIR Batch Export - RAW
- // AnalysIR IR Protocol: RAW, Key:
- // Add a small delay before repeating
- delay(200);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment