Newbie prob

Hi I’ new here. For tinkering I run Processing 1.5.1 and Arduino 1.0. I’m trying to test some bunches of code but I think I do some very basics wrong…
For example: When I load GPS_MTK_test.pde which is

// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
	Example of GPS MTK library.
	Code by Jordi Munoz and Jose Julio.

	Works with Ardupilot Mega Hardware (GPS on Serial Port1)
#include <FastSerial.h>
#include <AP_Common.h>
#include <AP_GPS.h>


AP_GPS_MTK gps(&Serial1);
#define T6 1000000
#define T7 10000000

void setup()
    stderr = stdout;
    gps.print_errors = true;

    Serial.println("GPS MTK library test");
    gps.init();	 // GPS Initialization
void loop()
    if (gps.new_data) {
        Serial.print(" Lat:");
        Serial.print((float)gps.latitude / T7, DEC);
        Serial.print(" Lon:");
        Serial.print((float)gps.longitude / T7, DEC);
        Serial.print(" Alt:");
        Serial.print((float)gps.altitude / 100.0, DEC);
        Serial.print(" GSP:");
        Serial.print(gps.ground_speed / 100.0);
        Serial.print(" COG:");
        Serial.print(gps.ground_course / 100.0, DEC);
        Serial.print(" SAT:");
        Serial.print(gps.num_sats, DEC);
        Serial.print(" FIX:");
        Serial.print(gps.fix, DEC);
        Serial.print(" TIM:");
        Serial.print(gps.time, DEC);
        gps.new_data = 0; // We have readed the data

I get some errors: unexpected char ‘i’
and many more

I asked google but haven’t found an satisfieing answer to the prob. Does this unexpected char ‘i’ error thing come from outside of the code or something?

After that I loaded the same file GPS_MTK_test.pde to the Arduino IDE. Do I have to worry about the .pde extension here? Anyway, I get:
AP_Math.h: No such file or directory

Hmm. But this very AP_Math.h is in
So I think the location is right.

What’s going on here?

For example: When I load GPS_MTK_test.pde which is

Arduino sketch files with 1.0 have the extension .ino. All libraries that come with examples for Arduino 1.0 use the .ino extension.

Where did you get this non-1.0 compatible sketch?

I get some errors: unexpected char 'i' at at and many more

That's an Arduino sketch. It would be very surprising if Processing did compile it.

Hi, thanks for your response. This code is from the ardupilot project. So you think when it is not with .ino extension then it's not an Arduino project at all...? Well, all files of the ardupilot project come with either .h, .cpp or .pde. You are right. I looked on the processing IDE and haven't found an upload button... But why is the extension as it is?

The Arduino IDE was based on the Processing one. The pde extension came from Processing, and was also used by the pre-1.0 Arduino IDE. The extension was changed for the 1.0 IDE to remove the confusion.

It's quite possible that the Ardupilot sketches haven't been updated for IDE 1.0 and are still using the pde extension.

AP_Math.h: No such file or directory

Solved it. After adding:

#include <AP_Math.h>

to that, it was compilable.

#include <FastSerial.h>
#include <AP_Common.h>
#include <AP_GPS.h>

I don’t have the slightest clue why this brilliant nerd who developed the code omited that line…