Created
April 22, 2014 08:21
-
-
Save pepf/11169913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
// Blueduino comunicate with BLE module through pin11, pin12 as soft serial. | |
SoftwareSerial mySerial(11, 12); //RX,TX | |
String tmp; | |
void setup() { | |
// Start soft serial | |
mySerial.begin(9600); | |
}; | |
void loop() { | |
// Read soft serial | |
while (mySerial.available() > 0) { | |
tmp += char(mySerial.read()); | |
delay(2); | |
} | |
// If it got data from soft serial port then send them back to sender, to see if connection works | |
if(tmp.length() > 0) { | |
sendString(tmp); | |
tmp = ""; | |
} | |
} | |
void sendString(String str) { | |
for(int i=0; i<str.length(); i++) { | |
char c = str.charAt(i); | |
mySerial.write(c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BRO I WANT search bar plugin which shuld search from my web site and also want google custom search plugin will u please give me