Go Down

Topic: Serial problems (Read 520 times) previous topic - next topic


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.

* Button
* by DojoDave <http://www.0j0.org>
* Turns on and off a light emitting diode(LED) connected to digital  
* pin 13, when pressing a pushbutton attached to pin 7.
* http://www.arduino.cc/en/Tutorial/Button

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?íb????b??b¾?b´?b??b?ïb??1¿?"??b¿?b´?b??b?ïb?Åb??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  :(


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.

Go Up