I have NewSoftSerial.h and NewSoftSerial.cpp in the same folder as my sketch.
The sketch is thus.
#include <NewSoftSerial.h>
int incomingByte = 0; // for incoming serial data
NewSoftSerial bluetooth(2, 3);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
Serial.flush();
//enter command mode
Serial.println("$$$");
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
//read the incoming byte:
incomingByte = Serial.read();
//say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, BYTE);
}
}
What am I doing wrong that I get these errors?
trainremotesketch.cpp:1:27: error: NewSoftSerial.h: No such file or directory trainremotesketch:3: error: 'NewSoftSerial' does not name a type