Hi SherryL ,
The information printed in the Serial Monitor can't be caught to be used or stored in a variable. The data you receive from the Android device has to be stored prior to be printed in the Serial Monitor. I haven't tried the Bluetooth guide you pointed but in the bt_test sample code provided in the SPP library, the data printed in the Serial Monitor is the one gotten from the ssp.getBuf() method, so that data is the one you should print in the OLED screen.
is there code to send "const char *i = spp.getBuf();" to system("./home/root/pong/helloworld_aa");?
I also tried to add oled code to bt_test in Arduino. but it fails. is it maybe Arduino code isn't compatible with Oled code?
According to the code you posted, you are printing the content of the ssp.getBuf() in the Serial Monitor twice with the Serial.println() statement. You are not sending the data to the OLED screen.
By checking the Sparkfun guide about the OLED screen, you should use the line oled.print(char); to draw a character in the screen or the line oled.write(char *); to draw an array of characters. You have to modify your OLED code to do that.
The OLED example is written in C++, so it is not Arduino compatible. On the other hand, Sparkfun provides all the libraries needed. You could check them and try to write the same OLED example but using the Arduino IDE instead. You can try to add the libraries provided by Sparkfun to the Arduino IDE. Some Arduino libraries are written in C++ so the OLED libraries might compile in the Arduino IDE. If it works you can merge it with the bt_test, which is an Arduino sketch too.
I noticed that you opened two threads about this same topic:
Since the original question of this thread has been answered, please continue replying in the other ones. You will receive an answer in each one soon.