443M衣架遥控arduino代码备档

Posted Hanf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了443M衣架遥控arduino代码备档相关的知识,希望对你有一定的参考价值。

byte up[65] = {0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1};
byte lm[65] = {0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1};
byte dn[65] = {0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,1,0,1,1,1,1};

void RFControl(byte output[]){
    digitalWrite(p_led, HIGH);
    for(int r = 0; r < 4; r++){
      //start
      digitalWrite(p_opt, HIGH);delayMicroseconds(5120);
      digitalWrite(p_opt, LOW); delayMicroseconds(580);
  
      for(int i = 0; i< 65; i++){
        if(output[i] == 0){        //0
          digitalWrite(p_opt, HIGH);delayMicroseconds(190);
          digitalWrite(p_opt, LOW); delayMicroseconds(580);
        }
        else{        //1
          digitalWrite(p_opt, HIGH);delayMicroseconds(580);
          digitalWrite(p_opt, LOW); delayMicroseconds(190);
        }
      }
    }
    digitalWrite(p_led, LOW);
}

//调用
RFControl(up); //上升
RFControl(lm); //开关灯
RFControl(dn); //下降

 

以上是关于443M衣架遥控arduino代码备档的主要内容,如果未能解决你的问题,请参考以下文章

进阶之路(中级篇) - 018 基于arduino的简易版智能衣架

CASE步进IR遥控器和Arduino

用米思齐(mixly)或者Arduino制作红外线遥控灯

基于Arduino智能控制(时钟模块,光敏,红外遥控)

基于Arduino智能控制(时钟模块,光敏,红外遥控)

ESP8266+红外模块制作万能网路遥控器