Go Down

Topic: #include <RCSwitch.h> (Read 308 times) previous topic - next topic

jmfoottit

New to Arduino sketches that have #include



Downloaded and extracted files from:
https://code.google.com/p/rc-switch/

Placed them in my "Sketchbook Location" folder (Arduino Uno R3)
Tried to open ReceiveDemo_Simple


/*
 Simple example for receiving
 
 http://code.google.com/p/rc-switch/
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

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

void loop() {
 if (mySwitch.available()) {
   
   int value = mySwitch.getReceivedValue();
   
   if (value == 0) {
     Serial.print("Unknown encoding");
   } else {
     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();
 }
}

tried to compile and get the following error....

Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Uno"

Build options changed, rebuilding all

ReceiveDemo_Simple.cpp.o: In function `setup':
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:13: undefined reference to `RCSwitch::enableReceive(int)'
ReceiveDemo_Simple.cpp.o: In function `loop':
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:17: undefined reference to `RCSwitch::available()'
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:19: undefined reference to `RCSwitch::getReceivedValue()'
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:25: undefined reference to `RCSwitch::getReceivedValue()'
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:27: undefined reference to `RCSwitch::getReceivedBitlength()'
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:30: undefined reference to `RCSwitch::getReceivedProtocol()'
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:33: undefined reference to `RCSwitch::resetAvailable()'
ReceiveDemo_Simple.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files (x86)\Arduino/ReceiveDemo_Simple.pde:9: undefined reference to `RCSwitch::RCSwitch()'
collect2.exe: error: ld returned 1 exit status
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.


Help! please

jmfoottit

YOU BEAUTY!

thanks so much!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy