ArduinoGeneral

Help Needed (Addressing KeyFobs for Project)

userHead Account cancelled 2018-06-19 02:15:23 2198 Views0 Replies
Hello I just purchased the 315Mhz RF Shield For Arduino and three of the 315MHz (Metal) Remote Wireless Keyfobs as well. I am using the Arduino Uno and I am hoping that I will be able to use the 3 different key fobs to each send their own specific signal to the Uno. My thought is that the Arduino would know button 1 was pressed from one key fob, button 2 was pressed from another, and button 3 was or wasn’t (or something to that effect). I think this is possible because I inquired on your main site and received a response but I am having trouble addressing the keyfobs. I'm not sure of what I am supposed to do. Should I open the keyfob and try to solder something? or can I do this task with just the Arduino code itself? Below is a sample coding idea of how I think it might look but I'm still not too sure. Any help is greatly appreciated. Thank you!

SKU's of the products:
SKU:FIT0355 and SKU:TEL0075


Sample idea code:

int D1 = 8; //keyfob1
int D2 = 9; //keyfob2
int D3 = 10; //keyfob

void setup() {
Serial.begin(9600);
pinMode(D3, INPUT);
pinMode(D2, INPUT);
pinMode(D1, INPUT);
}

void loop() {
if (((digitalRead(D1) == HIGH) && (digitalRead(D2) == HIGH)) || ((digitalRead(D1) == HIGH) && (digitalRead(D3) == HIGH)) || ((digitalRead(D2) == HIGH) && (digitalRead(D3) == HIGH))){
Serial.println("something");
}

if (((digitalRead(D1) == LOW) && (digitalRead(D2) == LOW)) || ((digitalRead(D1) == LOW) && (digitalRead(D3) == LOW)) || ((digitalRead(D2) == LOW) && (digitalRead(D3) == LOW))){
Serial.println("something else");
}

if ((digitalRead(D1) == LOW) && (digitalRead(D2) == LOW) && (digitalRead(D2) == LOW)){
Serial.println("something different");
}

if ((digitalRead(D1) == HIGH) && (digitalRead(D2) == HIGH) && (digitalRead(D2) == HIGH)){
Serial.println("something different");
}
}