Welcome! Log In Create A New Profile

Advanced

Problem programming serial

Posted by pieppiep 
Problem programming serial
March 19, 2010 03:52PM
Hi

I've got the electronics and steppermotor parts but waiting on the rest to come in by mail.
Now I'm playing with my reprap motherboard v1.2, writing little test programs to play with the steppermotors.
When I try to add communication to my program via the serial monitor it seems to crash.

Example code :

void setup()
{
  Serial.begin(9600);
  Serial.println("Hello world!");
}

void loop()
{
  delay(500);
  Serial.print("a");
  
  if (Serial.available())
  {
    char c = Serial.read();
    Serial.print("b");
  }
}

The serial monitor is getting filled with a's but when I send something the receiving of a's stops.
Does anyone know what I'm doing wrong and how I can just receive a 'b' character when I send something to the device?

I'm using Arduino 0018 on ubuntu 9.10 and I have added the configuration for the sanguino board and selected it.

Regards,
Jeroen
Re: Problem programming serial
March 20, 2010 02:21PM
Small update, if I change the board type to 'Arduino Diecimila, Duemilanove, or Nano w/ ATmega168' and connect my computer to the extruder controller I receive a's on the serial port and when I send something I receive b's back.
Anyone knows what I'm doing wrong with motherboard?
Re: Problem programming serial
March 20, 2010 03:33PM
I found the problem.
The sanguino wasn't correctly installed so I did it again and now the little test program is working.

The installation instructions I used are :

Updated Arduino 0018 Installation Instructions

1. Unzip the Sanguino software file. It contains some folders that need to be copied into the Arduino software directory.
2. copy sanguino-software-1.x/cores/sanguino TO arduino-0018/hardware/sanguino/cores/sanguino
3. copy arduino-0018/hardware/arduino/cores/arduino/main.cpp TO /arduino-0018/hardware/sanguino/cores/sanguino
4. copy sanguino-software-1.x/bootloaders/atmega644p TO /arduino-0018/hardware/sanguino/bootloaders/
5. copy all the folders in sanguino-software-1.x/libraries/ TO arduino-0018/hardware/libraries/ overwriting the existing libraries.
6. copy the sanguino-software-1.x/boards.txt file TO arduino-0018/hardware/sanguino WITHOUT making any changes to it
7. Restart Arduino
Sorry, only registered users may post in this forum.

Click here to login