Go Down

Topic: How to Serial.print in Putty? (Read 984 times) previous topic - next topic

Kelevra86

Hello everybody,

i wrote a Programm with Bluetooth-Communication. Everythings good, but at the beginning of the Programm I want to Print some short instructions for further users.
When I open that in PUTTY the Serial.println will not ne shown.

Code: [Select]

void setup()
{
  Serial.begin(9600);
  Serial.println("Hello");
  Serial.println("Instruction 1");
  Serial.println("Instruction 2");
}

void loop()
{ // somethings here
}


Any Idea how I can made these Strings visible?

Greetings
TK

Msquare

That should work if the USB cable is connected, the Putty is set to the Serial port that the USB driver creates, and at 9600 baud.

Kelevra86

Yes, but I want to control it via Bluetooth.
It seems, that the 3 strings are getting lost somewhere. But why? And how can I fix it?

cjdelphi

#3
Apr 04, 2012, 07:34 am Last Edit: Apr 04, 2012, 08:11 am by cjdelphi Reason: 1
Those 3 strings are being sent via the usb port.

I presume you have bluetooth setup eg if your bluetooth serial line is connected to pins 2 and 3 (or whatever) (send/recv)

mySerial(2, 3); //send/recv (SoftSerial any kind)

//setup
{
Serial.begin(9600);
MySerial.begin(9600);  //blueooth
}



//loop

{
 if (mySerial.available())
 {
   c = (char)mySerial.read();
    mySerial.print(c);
 }
}


etc etc.

cjdelphi

mySerial.println("This will be sent to bluetooth....");

Use SoftSerial or the new library, both work good, i've had issues sending AT commands but i'm sure i'll work it out, default is 9600bps.

Go Up