Hi everybody
Here is my sketch. All the ’ blink_writes’ are doing fine.
The problem is reading data, coming from a RF receiver. I would like to see a code on V7 (see Blynk_read(v7)
I tried receiving the data without blink and that works fine, with blink no value on V7. I the app I switched value on’ push’
Am I doing something wrong ???
#define BLYNK_PRINT Serial// Comment this out to disable prints and save space
#include <OneWire.h>
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <NewRemoteTransmitter.h>//nodig voor KAKU
#include <RCSwitch.h>//nodig voor Promax
#include <SimpleTimer.h>
int waarde=0;
int ledstatus=0;
int value;
char auth[] = “xxx”;// Je Blynk auth code.
#define W5100_CS 10
#define SDCARD_CS 4
SimpleTimer timer;
NewRemoteTransmitter transmitter(3256158, 10, 255 ,1);
RCSwitch mySwitch = RCSwitch();
void bewegingStatus(void);
void setup()
{
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH);
Serial.begin(9600);
Blynk.begin(auth);
pinMode(9,OUTPUT);// +spanning voor de RF transmitter
pinMode(7,OUTPUT);
mySwitch.enableTransmit(10);
mySwitch.enableReceive(0);//dit is D2
}
BLYNK_WRITE(V1)
{
if (param.asInt()){
digitalWrite(9,HIGH);
mySwitch.send(1381717,24);
digitalWrite(9,LOW);
}
else {
digitalWrite(9,HIGH);
mySwitch.send(1381716,24);
digitalWrite(9,LOW);
}
}
BLYNK_WRITE(V2)
{
if (param.asInt()){
digitalWrite(9,HIGH);
mySwitch.send(1394007,24);
digitalWrite(9,LOW);
}
else {
digitalWrite(9,HIGH);
mySwitch.send(1394004,24);
digitalWrite(9,LOW);
}
}
BLYNK_WRITE(V3)
{
if (param.asInt()){
digitalWrite(9,HIGH);
mySwitch.send(1397077,24);
digitalWrite(9,LOW);
}
else {
digitalWrite(9,HIGH);
mySwitch.send(1397076,24);
digitalWrite(9,LOW);
}
}
BLYNK_WRITE(V4)
{
if (param.asInt()){
digitalWrite(9,HIGH);
mySwitch.send(1397845,24);
digitalWrite(9,LOW);
}
else {
digitalWrite(9,HIGH);
mySwitch.send(1397844,24);
digitalWrite(9,LOW);
}
}
BLYNK_WRITE(V6)//KAKU
{
if (param.asInt()){
digitalWrite(9,HIGH);
transmitter.sendUnit(1,true);
digitalWrite(9,LOW);
}
else {
digitalWrite(9,HIGH);
transmitter.sendUnit(1,false);
digitalWrite(9,LOW);
}
}
BLYNK_READ(V7)
{
if (mySwitch.available()){
int value=mySwitch.getReceivedValue();
Serial.println(value);}
{
Blynk.virtualWrite(V7,value);
}
}
void loop()
{
Blynk.run();
}