just some reformatting - no code changes
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
#include <Arduino.h>
|
||||
#include <IRrecv.h>
|
||||
#include <IRsend.h>
|
||||
#include <IRremoteESP8266.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <IRac.h>
|
||||
#include <IRrecv.h>
|
||||
#include <IRremoteESP8266.h>
|
||||
#include <IRsend.h>
|
||||
#include <IRtext.h>
|
||||
#include <IRutils.h>
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
|
||||
const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2).
|
||||
IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message.
|
||||
|
||||
@@ -30,7 +28,6 @@ const uint16_t kMinUnknownSize = 12;
|
||||
IRrecv irrecv(kRecvPin, kCaptureBufferSize, kTimeout, true);
|
||||
decode_results results; // Somewhere to store the results
|
||||
|
||||
|
||||
// Update these with values suitable for your network.
|
||||
const char *ssid = "JoNelsDarlings";
|
||||
const char *password = "Paris2016";
|
||||
@@ -46,7 +43,6 @@ char msg[MSG_BUFFER_SIZE];
|
||||
int value = 0;
|
||||
|
||||
void setup_wifi() {
|
||||
|
||||
delay(10);
|
||||
// We start by connecting to a WiFi network
|
||||
Serial.println();
|
||||
@@ -157,13 +153,10 @@ void setup() {
|
||||
#endif // DECODE_HASH
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
|
||||
|
||||
irsend.begin();
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
if (!client.connected()) {
|
||||
reconnect();
|
||||
}
|
||||
@@ -195,14 +188,11 @@ void loop() {
|
||||
theSrc = resultToSourceCode(&results);
|
||||
Serial.println(theSrc.c_str());
|
||||
|
||||
|
||||
bool isPub = client.publish(String(room_name + "/ReceivedIR").c_str(), theSrc.c_str());
|
||||
bool isPub = client.publish(String(room_name + "/ReceivedIR").c_str(),
|
||||
theSrc.c_str());
|
||||
if (isPub)
|
||||
Serial.println("PUBLISHED");
|
||||
else
|
||||
Serial.println("PUBLISH FAILED");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user