Pages: [1]   Go Down
Author Topic: How to Serial.print in Putty?  (Read 687 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 25
Posts: 1147
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2115
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 04, 2012, 01:11:42 am by cjdelphi » Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2115
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: