Hi I'm 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. DIYDrones.com
Works with Ardupilot Mega Hardware (GPS on Serial Port1)
*/
#include
#include
#include
FastSerialPort0(Serial);
FastSerialPort1(Serial1);
AP_GPS_MTK gps(&Serial1);
#define T6 1000000
#define T7 10000000
void setup()
{
Serial.begin(38400);
Serial1.begin(38400);
stderr = stdout;
gps.print_errors = true;
Serial.println("GPS MTK library test");
gps.init(); // GPS Initialization
delay(1000);
}
void loop()
{
delay(20);
gps.update();
if (gps.new_data) {
Serial.print("gps:");
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);
Serial.println();
gps.new_data = 0; // We have readed the data
}
}
I get some errors:
processing.app.SketchException: unexpected char 'i'
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:353)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:197)
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
C:\AVR\Arduino_stuff\arduino-1.0-windows\arduino-1.0\libraries\AP_Math
So I think the location is right.
What's going on here?
Tags:
Permalink Reply by Joachim on April 9, 2012 at 7:22am AP_Math.h: No such file or directory
Solved it. After adding:
#include <AP_Math.h>
I don't have the slightest clue why this brilliant nerd who developed the code omited that line...
Some of those example sketches haven't been updated in a while and the underlying libraries have changed. Thanks for the fix, which I've added.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.24 members
1289 members
248 members
57 members
87 members
© 2013 Created by Chris Anderson.
Powered by
