This is my first time using Arduino IDE, and this is my code: I am trying to use the SendDemo sketch from RCSwitch on my NodeMCU board (ESP-12E), with the following configuration,
- Select; Tools -> Board: -> (Select the board of your choice). 'Generic ESP8266 Module'
- Select; Tools -> Flash Mode: -> 'DIO'
- Select; Tools -> Flash Frequency: -> '40MHz'
- Select; Tools -> CPU Frequency: -> '80 MHz'
- Select; Tools -> Flash Size: -> '512K (64K SPIFFS)'
- Select; Tools -> Debug Port: -> 'Disabled'
- Select; Tools -> Debug Level: -> 'None'
- Select; Tools -> Reset Method: -> 'ck'
- Select; Tools -> Upload Speed: -> '115200'
I keep receiving the error, xtensa-lx106-elf-g++: error: unrecognized command line option '-std=gnu++17' exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module).
What should I do?
/*
Example for different sending methods
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
// Transmitter is connected to Arduino Pin #10
mySwitch.enableTransmit(10);
// Optional set protocol (default is 1, will work for most outlets)
// mySwitch.setProtocol(2);
// Optional set pulse length.
// mySwitch.setPulseLength(320);
// Optional set number of transmission repetitions.
// mySwitch.setRepeatTransmit(15);
}
void loop() {
/* See Example: TypeA_WithDIPSwitches */
mySwitch.switchOn("11111", "00010");
delay(1000);
mySwitch.switchOff("11111", "00010");
delay(1000);
/* Same switch as above, but using decimal code */
mySwitch.send(5393, 24);
delay(1000);
mySwitch.send(5396, 24);
delay(1000);
/* Same switch as above, but using binary code */
mySwitch.send("010100010001010100110011");
delay(1000);
mySwitch.send("010100010001010100110011");
delay(1000);
/* Same switch as above, but tri-state code */
mySwitch.sendTriState("00000FFF0F0F");
delay(1000);
mySwitch.sendTriState("00000FFF0FF0");
delay(1000);
delay(20000);
}