I am making a mood lamp.
Triggering it with IFTTT.
Here is the code
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#define RED A4
#define GREEN 3
#define BLUE 6
WidgetLED led(V1);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";
void setup()
{
/* put your setup code here, to run once:
USE PWM PINS(D3,5,6,9,10,11) FOR ANALOG OUTPUT
A4 for RED
D3 for GREEN
D6 for BLUE
Set one pin each for a trigger word
OUTPUTS
D2 for HAPPY(yellow)
D4 for SAD(purple)
D7 for angry(red)
D8 for elation(orange)
A2 FOR BLUE
D3 FOR GREEN
*/
pinMode(2, INPUT); // trigger for happy(yellow)
pinMode(4, INPUT); // trigger for sad(purple)
pinMode(7, INPUT); // trigger for angry(red)
pinMode(8, INPUT); // trigger for elation(orange)
pinMode(A2,INPUT); // trigger for blue
pinMode(A3,INPUT); // trigger for green
pinMode(RED, OUTPUT); // RED CONNECTION
pinMode(GREEN, OUTPUT); // GREEN CONNECTION
pinMode(BLUE, OUTPUT); // BLUE CONNECTION
Serial.begin(9600);
Blynk.begin(auth);
// You can also specify server.
// For more options, see BoardsAndShields/Arduino_Ethernet_Manual example
//Blynk.begin(auth, "your_server.com", 8442);
//Blynk.begin(auth, IPAddress(192,168,1,100), 8888);
}
void loop()
{
Blynk.run();
int y = digitalRead(2);
int p = digitalRead(4);
int r = digitalRead(7);
int o = digitalRead(8);
int b = analogRead(A2);
int g = analogRead(A3);
if (y!=0)
{
analogWrite(RED, 255); // COLOR COMBINATION FOR YELLOW
analogWrite(GREEN,153);
analogWrite(BLUE,0);
}
if (p!=0)
{
analogWrite(RED,102); // COLOR COMBINATION FOR PURPLE
analogWrite(BLUE,153);
analogWrite(GREEN,0);
}
if (r!=0)
{
analogWrite(RED,255); // COLOR COMBINATION FOR RED
analogWrite(GREEN,0);
analogWrite(BLUE,0);
}
if (o!=0)
{
analogWrite(RED,255); // COLOR COMBINATION FOR ORANGE
analogWrite(GREEN,153);
analogWrite(BLUE,0);
}
if (b!= 0)
{
analogWrite(RED,0); // COLOR COMBINATION FOR BLUE
analogWrite(GREEN,0);
analogWrite(BLUE,255);
}
if(g!=0)
{
analogWrite(RED,0); // COLOR COMBINATION FOR GREEN
analogWrite(GREEN,255);
analogWrite(BLUE,0);
led.on();
}
}
After this in the serial monitor it shows flood error. Can someone tell me how to get out off this?