Hello guys,
Sorry fornot updating for two weeks, my PC crashed lost almost all the files and I was also kinda stressed.. Trying to redo a lot stuffs, have been busy too..
Here comes this week's update......
So this blog covers the Bluetooth part, Sending Data Collected by Launchpad to Intel Edison.But first we need to make them speak.
I'll be using the cheap HC-05 Bluetooth modules for this purpose.
The Reason : The Bluetooth booster pack had some UID issues when connecting to the Edison. On the other side I tried to configure the Edison to receive the Bluetooth Data but now lost all the documentations.
Most of you guys would know about the HC-05, I've a plenty of them lying around.
Testing the Modules.
The Setup
HC-05 Launchpad
Tx P3.2
Rx P3.3
5V 5V
GND GND
Don't mind those push buttons, they are dummy 
The Test Code:
Just in case to test the
The same works for both the Edison(Arduino IDE) and Launchpad (Energia IDE)
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
}
char recvChar;
void loop() {
if(Serial1.available())
{
recvChar = Serial1.read();
Serial.print(recvChar);
Serial.println();
}
}
I had this android app written using MITapp Inventor long ago for some other purpose, but came handy for testing these modules. There are plenty of Apps like this in the store.
and Test results were both the modules worked.
Whats Next?We need to make two Bluetooth Radios to talk, so we need to make one of the HC-05 as Master and the other as slave,this can be done by entering into the AT mode. There are a lot of tutorials out there for this process, but I'm gonna skip them.
I just used a USB to UART chip from FTDI and configured them.
For now one module is configured as Master and bind to the other one.
Sending data from Energia to Edison:
The Setup:
One hooked up with Launchpad another with Edison
HC-05 Launchpad Edison in Arduino Breakout
Tx P3.2 0
Rx P3.3 1
5V 5V 5V
GND GND GND
The code for Launchpad is same as the test code, for the Edison alone I've added a few lines, so that it can log the data into a text file. fopen() and fprintf() functions came in handy.
Edison Code:
FILE* fp;
char recvChar;
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
system("echo T-shirt > /log.txt");
}
void loop() {
fp=fopen("/log.txt","a");
if(Serial.available())
{
recvChar = Serial.read();
Serial1.print(recvChar);
}
if(Serial1.available())
{
recvChar = Serial1.read();
Serial.print(recvChar);
fprintf(fp,"%c",recvChar);
}
fclose(fp);
}This data for now is the one I'm entering in the SerialMonitor of Energia IDE but this actually will be the data collected from the Sensors in the upcoming blog.
Sent a "Hello" from LaunchPad to Edison








Top Comments
-
e14phil
-
Cancel
-
Vote Up
+2
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
e14phil
-
Cancel
-
Vote Up
+2
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children