Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
carlscicC

carlscic

@carlscic
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Controlling Blinds.com RF Dooya Motors with Arduino and Vera
    carlscicC carlscic

    @petewill what I'm trying to do is send 5 codes. Right now the 433 transmitter will broadcast the codes together, one after the other without any delay which the receiver won't recognize.

    433audio.PNG

    I already have a written program to control these blinds with a stepper motor to open and close but since they have a built-in motor for shades angle it would be an upgrade!

    My Project

  • Controlling Blinds.com RF Dooya Motors with Arduino and Vera
    carlscicC carlscic

    @petewill I've managed to get the binary code with Audacity quite easy but got stuck as for each button pressed sends out a combination of codes.

    Just for the open, always the same code in binary, 0111000000001100100011001110000100011110 twice and then 0111000000001100100011001110000100010001 three times.

    //Define Variables
    #define SEND_DATA 3 //Data pin for RF Transmitter
    #define ZERO_HIGH 376 //Delay for the high part of a 0 in microseconds
    #define ZERO_LOW 648 //Delay for the low part of a 0 in microseconds
    #define ONE_HIGH 713 //Delay for the high part of a 1 in microseconds
    #define ONE_LOW 306 //Delay for the low part of a 1 in microseconds
    
    int startUp = 1;
    
    unsigned char standardBits1 = 0b01110000; //sequence with "0b" prefix
    unsigned char standardBits2 = 0b00001100;
    unsigned char standardBits3 = 0b10001100;
    unsigned char standardBits4 = 0b11100001;
    unsigned char standardBits5 = 0b00011110;
    unsigned char standardBits6 = 0b00010001;
    int steps = 1;
    
    //0111000000001100100011001110000100011110  x2
    //0111000000001100100011001110000100010001  x3
    
    void setup() {
       
       Serial.begin(9600);
     
    }
    
    void loop() 
    {
     
      if(startUp == 1)
      {
        
    
      oneBits(standardBits1);
      oneBits(standardBits2);
      oneBits(standardBits3);
      oneBits(standardBits4);
      oneBits(standardBits6);
    
      twoBits(standardBits1);
      twoBits(standardBits2);
      twoBits(standardBits3);
      twoBits(standardBits4);
      twoBits(standardBits5); 
    
      startUp = 1;          //to keep repeating
      delayMicroseconds(5000);
      }
    
    }
    
    void oneBits(unsigned char bits){
        
        unsigned char k;
        int delayTime;
        for(k=0;k<8;k++) {
          int highTime;
          int lowTime;
          delayTime = ((bits>>(7-k)) & 1 ? 1 : 0); 
          
          if (delayTime == 1){
            highTime = ONE_HIGH;
            lowTime = ONE_LOW;
          }
          else {
            highTime = ZERO_HIGH;
            lowTime = ZERO_LOW;
            digitalWrite(SEND_DATA, HIGH);
            delayMicroseconds(highTime);
            digitalWrite(SEND_DATA, LOW);    
            delayMicroseconds(lowTime);
            }
        }
        
    
    }
    void PAUSE()
    {
    delayMicroseconds(1650);
    }
    
    
    void twoBits(unsigned char bits)
    {
    
        unsigned char l;
        int delayTime;
        for(l=0;l<8;l++)
            {
              
           
          int highTime;
          int lowTime;
          delayTime = ((bits>>(7-l)) & 1 ? 1 : 0); 
        
          if (delayTime == 1){
            highTime = ONE_HIGH;
            lowTime = ONE_LOW;
          }
          else {
            highTime = ZERO_HIGH;
            lowTime = ZERO_LOW;
            }      
          
            digitalWrite(SEND_DATA, HIGH);
            delayMicroseconds(highTime);
            digitalWrite(SEND_DATA, LOW);    
            delayMicroseconds(lowTime);
          }
            }   
    

    I'm seeing the 'results' back on Audacity since the code is set on a loop. Not to complicate more I'm just using 2 different codes but they are broadcasted to each other.

    Is there anything I could do to separate them as any delay in between the processes won't work??

    Thanks

    Carl

    My Project
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular