Stap 3: IR-commando versturen naar a/c
#include "IRremote.h"
IRsend irsend;
VOID Setup
{
Serial.begin(9600);
}
int khz = 38; NB deze standaardwaarde desgewenst naar de juiste modulatie frequentie wijzigen
ON en 2O C ° met 1 FAN warmte
unsigned heat[] = {3000,3000,3000,4400,550,1600,600,550,550,1650,550,550,550,550,550,1650,550,550,550,1650,500,550,550,1650,550,550,550,500,600,500,600,550,550,550,550,1650,500,550,550,600,500,1700,500,550,550,550,550,550,550,600,500,550,550,550,550,550,550,550,550,1650,550,1650,550,1650,500,1650,550,1650,550,550,550,550,550,550,550,550,550,1650,550,1650,550,500,550,550,550,1700,500,1650,550,550,550,500,600,550,550,550,550,550,550,550,550,550,550,1650,500,1700,500,550,550,550,550,550,550,550,550,550,550,600,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,500,550,1700,500,550,550,550,550,550,550,1650,550};
UIT de a/c
unsigned OFF[] = {3100,2900,2950,4400,700,1500,700,400,700,1500,700,400,650,450,550,1650,550,550,650,1500,600,500,600,1600,600,500,600,500,600,450,650,450,600,550,550,550,550,550,550,600,500,1600,600,500,600,500,600,550,550,500,600,500,600,550,550,550,550,1600,600,500,600,500,600,500,550,1650,550,1600,600,500,600,500,600,550,550,550,550,1600,600,1600,550,550,550,550,550,1650,550,1600,600,550,550,500,600,500,600,550,550,550,550,500,600,500,600,1600,600,1600,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,500,600,550,550,550,550,500,600,500,600,500,600,1600,600,500,600,1600,550,550,550,1600,600,550,550,550,550};
ON en 23° met 2 FAN koud
unsigned cold[] = {3050,3000,3000,4400,550,1600,600,550,550,1650,550,550,550,550,550,1650,550,500,600,1600,550,550,550,1650,550,1650,550,1650,550,550,550,550,550,500,600,1600,550,550,550,550,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,500,600,1650,500,550,550,600,500,1700,500,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,550,550,500,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,550,550,550,550,550,550,550,550,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1600,600,550,550};
ON en 20 C ° met 1 FAN warmte en SWING
unsigned heat_with_swing[] = {3000,3000,3000,4400,550,1650,550,500,600,1600,600,500,600,500,600,1600,550,550,550,1650,550,500,600,1600,600,550,550,550,550,550,550,1600,600,500,600,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,550,550,1600,550,550,550,600,500,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,550,550,550,550,1600,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,550,550,550,550,550,550,550,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,1650,500,1650,550,550,550,1700,500};
ON en 23° met 2 FAN koude en SWING
unsigned cold_with_sqwing[] = {2950,3050,2950,4400,550,1600,600,550,550,1650,550,550,550,550,550,1600,600,500,600,1600,550,500,600,1650,550,1650,550,1600,600,500,600,1600,600,500,600,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,500,600,550,550,500,600,1650,550,550,550,1600,600,500,600,1600,550,1600,600,500,600,500,600,550,550,500,600,1650,550,1600,600,500,600,500,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,500,600,500,600,500,600,500,600,500,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,1600,600,1600,550,550,600,500,550,550,550,550,550};
void loop {}
irsend.sendRaw (warmte, sizeof(heat)/sizeof(int), khz);
delay(10000);
irsend.sendRaw (OFF, sizeof(OFF)/sizeof(int),khz);
delay(10000);
}
Als we gingen uit de airconditioner thuis werken, zijn wij goed op weg om het project te voltooien!
Zoals eerder aangegeven, is het noodzakelijk te gebruiken twee Arduino, één die de webserver beheert, de andere die de communicatie met de air conditioner verzorgt.
Voor de verbinding van de twee Arduino op een correcte manier wordt zorg moet worden genomen om de onderstaande afbeelding.
Op het apparaat dat is aangesloten op de Ethernet-Shield is nodig om het programma waarmee de naam van AC_Webpage_Controller.ino, terwijl nell'Arduino die het IR commando's stuurt te laden, moet u het programma waarmee de naam van AC_Sender_Code.ino laden. Kunt u de software op mijn Github repo https://github.com/jackbell16/AC-Progetto-Arduino/tree/master/Arduino_Code
Nu dat we hebben voltooid het laadproces, we gewoon moet doen wat werk ter verbetering van het project, het nuttigst, is toegankelijk vanaf een externe webserver te maken. Om te doen dat we "de deuren open moeten" van onze router voor het correct routeren van aanvragen die zijn gedaan buiten ons lokale netwerk.
Het moet worden vermeld dat in de versie van de code op Github gemeld, geen beveiliging op gebruikersniveau wachtwoord, om een beetje te vereenvoudigen is ' het project. Echter, met enkele wijzigingen aan de code AC_Webpage_Controller.ino, kunt u deze functie ook implementeren.