Hello, i need turn my A/C ON/OFF with blynk and simple two buttons.
if i remove this part of code ON function is working
BLYNK_WRITE(V1)
{
int statBUTTONB = param.asInt();
if(statBUTTONB == 1)
{
irsend.sendRaw(offa, sizeof(offa) / sizeof(offa[0]),khz);
}
}
But if i leave it there blynk is simply offline. What i do wrong? It may be due
_Sketch uses 19946 bytes (61%) of program storage space. Maximum is 32256 bytes._
_Global variables use 2007 bytes (97%) of dynamic memory, leaving 41 bytes for local variables. Maximum is 2048 bytes._
**Low memory available, stability problems may occur.**
or not?
This is whole not working code but imo it should work.
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <IRremote.h>
IRsend irsend;
int khz=38;
unsigned int offa[] = {4468, 4340, 572, 1616, 572, 528, 568, 1624, 568, 1620, 572, 528, 568, 528, 576, 1616, 564, 536, 572, 528, 568, 1624, 568, 532, 572, 524, 572, 1620, 572, 1616, 564, 532, 576, 1620, 572, 528, 576, 1616, 564, 1624, 568, 1620, 572, 1616, 576, 524, 572, 1620, 572, 1616, 572, 1624, 568, 532, 564, 532, 604, 496, 572, 524, 572, 1620, 568, 528, 568, 532, 576, 1620, 620, 1568, 572, 1616, 568, 532, 572, 524, 572, 528, 568, 528, 568, 532, 572, 528, 568, 532, 576, 520, 608, 1588, 572, 1616, 572, 1616, 568, 1620, 572, 1620, 568, 5240, 4436, 4380, 572, 1620, 572, 524, 572, 1620, 568, 1620, 572, 528, 568, 528, 568, 1624, 568, 532, 572, 528, 568, 1624, 568, 528, 568, 532, 576, 1612, 568, 1624, 568, 528, 568, 1628, 572, 528, 568, 1620, 572, 1616, 576, 1612, 568, 1620, 572, 528, 568, 1624, 576, 1616, 576, 1620, 572, 524, 572, 528, 564, 532, 576, 524, 572, 1616, 576, 524, 572, 528, 568, 1628, 572, 1616, 564, 1624, 568, 532, 564, 532, 572, 524, 572, 528, 568, 532, 576, 524, 572, 528, 568, 528, 576, 1620, 572, 1616, 564, 1624, 568, 1620, 572, 1620, 572};
unsigned int cold[] = {4468, 4344, 576, 1616, 564, 532, 576, 1620, 572, 1616, 576, 524, 572, 528, 568, 1620, 568, 532, 564, 536, 572, 1624, 568, 528, 576, 524, 572, 1616, 568, 1624, 568, 528, 576, 1620, 572, 528, 568, 532, 576, 1616, 576, 1616, 572, 1616, 568, 1620, 572, 1620, 572, 1620, 568, 1628, 564, 1624, 568, 532, 596, 500, 604, 496, 600, 500, 596, 504, 592, 508, 600, 500, 596, 1592, 600, 500, 596, 504, 600, 496, 600, 500, 596, 504, 604, 496, 600, 1596, 596, 504, 600, 1592, 600, 1588, 604, 1588, 592, 1596, 596, 1592, 600, 1592, 568, 5244, 4476, 4344, 596, 1596, 596, 500, 596, 1600, 604, 1584, 596, 504, 592, 504, 600, 1588, 596, 504, 600, 504, 592, 1600, 592, 504, 604, 496, 600, 1588, 604, 1584, 596, 504, 604, 1592, 596, 504, 592, 508, 600, 1592, 600, 1588, 604, 1584, 596, 1592, 600, 1592, 600, 1592, 600, 1592, 600, 1592, 600, 496, 600, 500, 592, 508, 600, 496, 600, 500, 596, 504, 600, 500, 596, 1592, 600, 500, 596, 504, 592, 504, 604, 496, 600, 500, 596, 504, 600, 1596, 596, 500, 596, 1596, 596, 1596, 596, 1592, 600, 1588, 604, 1584, 596, 1596, 564, 41416, 224};
char auth[] = "323********************"; //blynk token
void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
//Blynk.virtualWrite(V0, 0);
//Blynk.virtualWrite(V1, 0);
//Blynk.syncAll();
}
BLYNK_WRITE(V0)
{
int statBUTTON = param.asInt();
if(statBUTTON == 1)
{
irsend.sendRaw(cold, sizeof(cold) / sizeof(cold[0]),khz);
}
}
BLYNK_WRITE(V1)
{
int statBUTTONB = param.asInt();
if(statBUTTONB == 1)
{
irsend.sendRaw(offa, sizeof(offa) / sizeof(offa[0]),khz);
}
}
void loop()
{
Blynk.run();
}
please help me im out of ideas blynk is OFFLINE with this code. Using Arduino UNO with ethernet shield.IR led is on PIN D3 nothing more is connected.