shield CAN et OBD 2

D'accord, voyons, mais c'est pareil avec tous les sketchs utilisant cette librairie. sur mon mac avec l'IDE 1.0.5
J'ai essayé avec la "NewSoftwareSerial", ça ne marche pas non plus.

Voici le code :

/*
  6-8-10
  Aaron Weiss
  SparkFun Electronics
  
  Example GPS Parser based off of arduiniana.org TinyGPS examples.
  
  Parses NMEA sentences from an EM406 running at 4800bps into readable 
  values for latitude, longitude, elevation, date, time, course, and 
  speed. 
  
  For the SparkFun GPS Shield. Make sure the switch is set to DLINE.
  
  Once you get your longitude and latitude you can paste your 
  coordinates from the terminal window into Google Maps. Here is the 
  link for SparkFun's location.  
  http://maps.google.com/maps?q=40.06477,+-105.20997
  
  Uses the NewSoftSerial library for serial communication with your GPS, 
  so connect your GPS TX and RX pin to any digital pin on the Arduino, 
  just be sure to define which pins you are using on the Arduino to 
  communicate with the GPS module. 
  
  REVISIONS:
  1-14-12 Arduino 1.0+ Compatible
  1-17-11 
    changed values to RXPIN = 2 and TXPIN = to correspond with
    hardware v14+. Hardware v13 used RXPIN = 3 and TXPIN = 2.
  
*/ 

// In order for this sketch to work, you will need to download 
// TinyGPS library from arduiniana.org and put them 
// into the hardware->libraries folder in your ardiuno directory.
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include <SPI.h> // Arduino SPI Library
#include <MCP2515.h>  // CAN bus

// Pin definitions specific to how the MCP2515 is wired up.
#define CS_PIN    10
#define INT_PIN    2

// Create CAN object with pins as defined
MCP2515 CAN(CS_PIN, INT_PIN);

Frame message;      // Fin déclarations CAN


// Define which pins you will use on the Arduino to communicate with your 
// GPS. In this case, the GPS module's TX pin will connect to the 
// Arduino's RXPIN which is pin 3.
#define RXPIN 4      //  sur shield CAN
#define TXPIN 5      //  sur shield CAN
//Set this value equal to the baud rate of your GPS
#define GPSBAUD 4800

// Create an instance of the TinyGPS object
TinyGPS gps;
// Initialize the NewSoftSerial library to the pins you defined above
SoftwareSerial uart_gps(RXPIN, TXPIN);

// This is where you declare prototypes for the functions that will be 
// using the TinyGPS library.
void getgps(TinyGPS &gps);

// In the setup function, you need to initialize two serial ports; the 
// standard hardware serial port (Serial()) to communicate with your 
// terminal program an another serial port (NewSoftSerial()) for your 
// GPS.
void setup()
{
  // This is the serial rate for your terminal program. It must be this 
  // fast because we need to print everything before a new sentence 
  // comes in. If you slow it down, the messages might not be valid and 
  // you will likely get checksum errors.
  Serial.begin(115200);
  //Sets baud rate of your GPS
  
 // SETUP CAN ******* 
  
  Serial.println("Initializing ...");

  // Set up SPI Communication
  // dataMode can be SPI_MODE0 or SPI_MODE3 only for MCP2515
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);
  SPI.begin();

  // Initialise MCP2515 CAN controller at the specified speed and clock frequency
  // In this case 125kbps with a 16MHz oscillator
  // (Note:  This is the oscillator attached to the MCP2515, not the Arduino oscillaltor)
  int baudRate=CAN.Init(250,16);
  if(baudRate>0) {
    Serial.println("MCP2515 Init OK ...");
    Serial.print("Baud Rate (kbps): ");
    Serial.println(baudRate,DEC);
  } 
  else {
    Serial.println("MCP2515 Init Failed ...");
  }
  Serial.println("Ready ...");  
  
 // FIN SETUP CAN *******   
  uart_gps.begin(GPSBAUD);
  
  Serial.println("");
  Serial.println("GPS Shield QuickStart Example Sketch v12");
  Serial.println("       ...waiting for lock...           ");
  Serial.println("");
}

// This is the main loop of the code. All it does is check for data on 
// the RX pin of the ardiuno, makes sure the data is valid NMEA sentences, 
// then jumps to the getgps() function.
//   ***********************************************************************************
void loop()
{
  while(uart_gps.available())     // While there is data on the RX pin...
  {
      int c = uart_gps.read();    // load the data into a variable...
      if(gps.encode(c))           // if there is a new valid sentence...
      {
        getgps(gps);              // then grab the data.
      }
  }
//   ------------------------------------------------------------------------------------
  //  CAN ***  Bernard ETIENNE  16/06/13
  byte priorite = 3;
  long PGN = 128259;     // Speed (Water Reference) 0-200 MPH
  byte source = 35;      // Airmar = 35
  long adresse = priorite * 67108864 + PGN * 256 + source;
  
 // float knots = 7.3;                  // *****  Test Origine 
  float knots = (gps.f_speed_knots());  // *****  Test Origine remplacé par SOG gps
  long vitesse = 51.444 * knots;        // ( 1852 / 3600 ) * 100
  byte speed1 = ( vitesse & 0b1111111100000000 ) >> 8;
  byte speed2 =   vitesse & 0b0000000011111111;
  
  // message.id = 637 * 2^18 + 66339 = 167052067;
  // message.id = 0x9F50323;
  message.id = adresse;         // Adresse composée emetteur (speedo)
  message.ide = 1;
  message.dlc = 8;              // Nbre d'octets de données
  message.data[0] = 0;          // ID sonde  (pas d'ident)
  message.data[1] = speed2;     // data vitesse partie entier   1 àctet
  message.data[2] = speed1;     // data vitesse partie décimale 1 octet        
  message.data[3] = 255; 
  message.data[4] = 255;  
  message.data[5] = 255;
  message.data[6] = 255;
  message.data[7] = 255;

  if(CAN.Read(CANINTF) & TX0IF)
  {
    Serial.println("Buffer TX0 empty : loading");
    CAN.LoadBuffer(TXB0, message);
    delayMicroseconds(500);
    CAN.BitModify(CANINTF,0b00000100,0);
    delayMicroseconds(500);

    Serial.print("CANINTF : ");
    Serial.println(CAN.Read(CANINTF), BIN);
  }

  if ( ! ( CAN.Read(CANINTF) & TX0IF ) )
  {
    CAN.SendBuffer(TXB0);
    delayMicroseconds(500);
    Serial.print("Sending ID : ");
    Serial.print((message.id & 0b11111111111000000000000000000)>>18);
    Serial.print(" - EID : ");
    Serial.print(message.id & 0b00000000000111111111111111111);
    Serial.print(" - Priority : ");
    Serial.print((message.id & 0b11100000000000000000000000000)>>26, BIN);
    Serial.print(" - PGN : ");
    Serial.print((message.id & 0b00011111111111111111100000000)>>8);
    Serial.print(" - Source : ");
    Serial.println(message.id & 0b00000000000000000000011111111);

    Serial.print("CANINTF : ");
    Serial.println(CAN.Read(CANINTF), BIN);
  }


  /*
  Serial.print("Sending ID : ");
  Serial.print(message.id, HEX);
  Serial.print(" ");
  Serial.print(message.id>>18);
  Serial.print(" ");
  Serial.println(message.id & 0b00000000000111111111111111111);
  CAN.LoadBuffer(TXB0, message);
  delay(10);
  CAN.SendBuffer(TXB0);
  */
  
  delay(200);
  //  FIN CAN ***
}
//   ***********************************************************************************
// The getgps function will get and print the values we want.
void getgps(TinyGPS &gps)
{
  // To get all of the data into varialbes that you can use in your code, 
  // all you need to do is define variables and query the object for the 
  // data. To see the complete list of functions see keywords.txt file in 
  // the TinyGPS and NewSoftSerial libs.
  
  // Define the variables that will be used
  float latitude, longitude;
  // Then call this function
  gps.f_get_position(&latitude, &longitude);
  // You can now print variables latitude and longitude
  Serial.print("Lat/Long: "); 
  Serial.print(latitude,5); 
  Serial.print(", "); 
  Serial.println(longitude,5);
  
  // Same goes for date and time
  int year;
  byte month, day, hour, minute, second, hundredths;
  gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
  // Print data and time
  Serial.print("Date: ");  Serial.print(day, DEC); Serial.print("/"); 
  Serial.print(month, DEC); Serial.print("/"); Serial.print(year);
  Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":"); 
  Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC); 
  // Serial.print("."); Serial.println(hundredths, DEC);
  // Since month, day, hour, minute, second, and hundr  
  // Here you can print the altitude and course values directly since 
  // there is only one value for the function
  Serial.println();
  Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());  
  // Same goes for course
  Serial.print("Course (degrees): "); Serial.println(gps.f_course()); 
  // And same goes for speed
  Serial.print("Speed(knots): "); Serial.println(gps.f_speed_knots());
  Serial.println();
  
  // Here you can print statistics on the sentences.
  unsigned long chars;
  unsigned short sentences, failed_checksum;
  gps.stats(&chars, &sentences, &failed_checksum);
  //Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
  //Serial.println(); Serial.println();
}