Hello,
I want to send data to Arduino through Bluetooth, then the data displayed on OLED, but I don't know
how to write the code. My code can let my message displayed on serial monitor, but the OLED has no
respond.
Here's my code ;
String comdata = "";Â Â
#include <Adafruit_ssd1306syp.h>
#define SDA_PIN 8
#define SCL_PIN 9
Adafruit_ssd1306syp display(SDA_PIN,SCL_PIN);
void setup()
{
  Serial.begin(9600);
  delay(1000);
  display.initialize();
}
void loop()
{
  while (Serial.available() > 0)Â
  {
    comdata += char(Serial.read());
    delay(2);
  }
  if (comdata.length() > 0)
  {
    Serial.println(comdata);
    comdata = "";
  }
  display.drawLine(0, 0, 127, 63,WHITE);
  display.update();
  delay(100);
  display.clear();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println(comdata);
  delay(2000);
}
Thanks!