Hello, I'm new to this forum and hopefully someone can help me.
I'm building a RepRap printer and now I have a problem with the software.
If I compile the GCode_Interpreter.pde I get several errors, see below,
GCode_Interpreter.pde:-1: error: 'char word [128]' redeclared as different kind of symbol
/Applications/Algemeen/Programma/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:88: error: previous declaration of 'typedef unsigned int word'
GCode_Interpreter.cpp: In function 'void loop()':
GCode_Interpreter.pde:-1: error: expected unqualified-id before '[' token
GCode_Interpreter.pde:-1: error: expected primary-expression before ',' token
GCode_Interpreter.cpp: In function 'void init_process_string()':
GCode_Interpreter.pde:-1: error: expected unqualified-id before '[' token
The other 4 PDE 's files -init, extruder, process-string and stepper-control are present.
I use Arduino 1.0 and Duemilanove 168, other sketches work fine.
Thanks in advance
Here the Sketch I downloaded from the RepRap site:
// Arduino G-code Interpreter
// v1.0 by Mike Ellery - initial software (mellery@gmail.com)
// v1.1 by Zach Hoeken - cleaned up and did lots of tweaks (hoeken@gmail.com)
// v1.2 by Chris Meighan - cleanup / G2&G3 support (cmeighan@gmail.com)
// v1.3 by Zach Hoeken - added thermocouple support and multi-sample temp readings. (hoeken@gmail.com)
#include <HardwareSerial.h>
//our command string
#define COMMAND_SIZE 128
char word[COMMAND_SIZE];
byte serial_count;
int no_data = 0;
void setup()
{
//Do startup stuff here
Serial.begin(19200);
Serial.println("start");
//other initialization.
init_process_string();
init_steppers();
init_extruder();
}
void loop()
{
char c;
//keep it hot!
extruder_manage_temperature();
//read in characters if we got them.
if (Serial.available() > 0)
{
c = Serial.read();
no_data = 0;
//newlines are ends of commands.
if (c != '\n')
{
word[serial_count] = c;
serial_count++;
}
}
//mark no data.
else
{
no_data++;
delayMicroseconds(100);
}
//if theres a pause or we got a real command, do it
if (serial_count && (c == '\n' || no_data > 100))
{
//process our command!
process_string(word, serial_count);
//clear command.
init_process_string();
}
//no data? turn off steppers
if (no_data > 1000)
disable_steppers();
}
GCode_Interpreter.pde (1.29 KB)