Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-A8S]--#01-KC868-A8S_433_receive_code
#1
Lightbulb 
[Arduino IDE demo source code for KC868-A8S]--#01-KC868-A8S_433_receive_code
Code:
/* RF-receive code for KC868-A8S*/
/*If receive the RF single,the LED will be turn the color to "0xff00ff"*/
/*install library RCSwitch and Adafruit_NeoPixel*/

#include <RCSwitch.h>  //Install library "rcswitch"
#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel rgb_display = Adafruit_NeoPixel(130,12,NEO_GRB + NEO_KHZ800);
//The WS2812 rgb LED is connect to IO12    RGB_LED number is 1
RCSwitch mySwitch = RCSwitch();
void setup() {
  Serial.begin(9600);
  rgb_display.begin();
  mySwitch.enableReceive(digitalPinToInterrupt(16));  //receive PIN IO16
}

void loop() {

if (mySwitch.available()) {
    Serial.print("Received ");
    Serial.println( mySwitch.getReceivedValue() );
    rgb_display.setPixelColor((1)-1,(0xff00ff));
    rgb_display.setBrightness(100);
    rgb_display.show();
  }
    mySwitch.resetAvailable();   
}
   


Attached Files
.zip   433-decode.zip (Size: 777 bytes / Downloads: 250)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)