Serial problems

I think i have a serial command problem over the TX pin.

When I use this Sketch and I press the button I get really strange outputs on my serial screan.


int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status

void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
digitalWrite(inputPin, HIGH);
pinMode(inputPin, INPUT); // declare pushbutton as input

void loop(){
val = digitalRead(inputPin); // read input value
if (val == LOW) { // check if the input is HIGH
digitalWrite(ledPin, LOW); // turn LED OFF
} else {
digitalWrite(ledPin, HIGH); // turn LED ON

??b¼?b??b?íb?? ??b??b´?b?îb?Åb??
??b¿?b¼?b?? ??
??b??b´?b?îb?åb??b?? ??

What’s the problem here.

Thanks in advance.


Sorry it works, I burned a Lilypad code on a Diecimila board :frowning:

I was just going to suggest that it's a baud rate problem, but you've confirmed it. The different clock speeds of the two boards would account for the behaviour in the serial monitor.