Go Down

Topic: I keep getting ÿ on my Serial Terminal? (Read 7468 times) previous topic - next topic

danpe

Oct 06, 2011, 01:42 pm Last Edit: Oct 06, 2011, 03:15 pm by Danpe Reason: 1
Hey,

I keep getting ÿ on the Serial Terminal, here is my build:

Arduino Duemlinove + Sparkfun WiFly Shield.

I'm communication with the WiFly using a C# .NET based application on my PC that connectes to the WiFly shield using AdHoc connection, opening Socket and start transmitting using TCP

Code: [Select]
this.Soc = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

The arduino has this loop:

Code: [Select]

void setup()
{
Serial.begin(9600);
       Serial.println("Initializing...");
       SpiSerial.begin();
       Serial.println("Ready.");
}
void loop()
{
   while(SpiSerial.available() > 0) {
     byte b = SpiSerial.read();
     char c = char(b);
     Serial.print(c);
   }
}  


When i print the char i get ÿ...



Any ideas why this heppends ?

SurferTim

That is how a terminal displays 255 (-1).

danpe


That is how a terminal displays 255 (-1).



So i just solved it with
Code: [Select]
if(c != (char)-1) but still, any idea why this heppends ?

SurferTim

It seems that the available() function is not working correctly. That is the response I get from client.read() if client.available() returns 0. That is the read() function returning "no characters available".

robtillaart


What is the signature of SpiSerial ?   does SPiSerial.Available returns a byte or an int ?

Have a link to the library?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up