rcswitch 'receive demo advanced' and ''receive demo simple' in arduino examples

Thread Starter

denison

Joined Oct 13, 2018
330
Cannot get the results to show up in the serial monitor. Another person has had the same problem. Several answers to his problem but I think the best is this.
" rc switch library relies on transmitting device using a sc2262 or equivalent data encoding chip."
I am trying to decode a transmission from a remote control of a mains power switch. So I guess that I may need to take the transmitter apart to have a look.
I added another line to the code to print '5' but even that did not show up on the serial monitor. I am using com3 which works ok for all the arduino sketches I have created on the nano board.
I am using the rxn3-b receiver module. It shows the numbers 434 and 315. I suppose this means for receiving transmissions of 434mhz and 315mhz. The transmitter is a 433mhz type.
Anybody know how to make this example work? Never had any problem with any of the other arduino examples.
Anybody know of a gadget which displays remote control transmission codes? An oscilloscope I suppose. But what about something simpler?
 

djsfantasi

Joined Apr 11, 2010
9,163
“COM3:” may not be the assigned COM port on your computer. Check “Ports” under “Tools” in the Arduino IDE for available comm ports. Also, you can use Device Manager to check for the available ports.

Those examples are installed with the device libraries, so everyone doesn’t have them. Using CODE tags (under the ellipsis icon on the top bar), please attach the two example sketches.
 

Thread Starter

denison

Joined Oct 13, 2018
330
“COM3:” may not be the assigned COM port on your computer. Check “Ports” under “Tools” in the Arduino IDE for available comm ports. Also, you can use Device Manager to check for the available ports.

Those examples are installed with the device libraries, so everyone doesn’t have them. Using CODE tags (under the ellipsis icon on the top bar), please attach the two example sketches.
Can't attach file the way you suggest. Here is the simple demo example copied;
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
}

void loop() {
if (mySwitch.available()) {

Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );

mySwitch.resetAvailable();
}
}
 

djsfantasi

Joined Apr 11, 2010
9,163
You didn’t respond with the Comm port you’re connected to. Every time you plug in an Arduino board, the port may change.
 

djsfantasi

Joined Apr 11, 2010
9,163
I have com3 port. This never changes every time I plug in.
Ok. I apologize for bringing it up again. It’s just that I don’t believe it. The Arduino IDE’s USB driver is known for changing the port often. You did check the port from the Port option in the Tools drop down menu, didn’t you?
 

Thread Starter

denison

Joined Oct 13, 2018
330
Ok. I apologize for bringing it up again. It’s just that I don’t believe it. The Arduino IDE’s USB driver is known for changing the port often. You did check the port from the Port option in the Tools drop down menu, didn’t you?
Yes I did. There is no option to change the port in the tools drop down menu.
 

djsfantasi

Joined Apr 11, 2010
9,163
Yes I did. There is no option to change the port in the tools drop down menu.
Then you aren't using the Arduino IDE.
Or maybe it doesn't recognize what is attached to it.
But in that latter case, the Port option is there, just disabled.


Capture.JPG

Another option is that you don't have the Arduino Nano hooked uo properly.
I can't tell with the information you've supplied. Show a screenshot like mine.
And add a connection picture and/or block diagram.
 
Last edited:

Thread Starter

denison

Joined Oct 13, 2018
330
Then you aren't using the Arduino IDE.
Or maybe it doesn't recognize what is attached to it.
But in that latter case, the Port option is there, just disabled.


View attachment 226803

Another option is that you don't have the Arduino Nano hooked uo properly.
I can't tell with the information you've supplied. Show a screenshot like mine.
And add a connection picture and/or block diagram.
I have made many sketches on my nano. They have all worked on com3. The port has never changed as you suggest.
 

djsfantasi

Joined Apr 11, 2010
9,163
I have made many sketches on my nano. They have all worked on com3. The port has never changed as you suggest.
Ok, I’m out! You obviously have very special hardware only available in your part of the country. Because, checking the Arduino forums, most of the world has problems relating to the port changing. It’s a known bug that Arduino is working on.

But since you have “special” hardware, I can’t help.

Good luck!
 
Top