Error compiling sketch: 'Canbus' was not declaired in this scope.

Hi All,

Set up:

Arduino Mega 2560
SKPang CAN-bus shield www.skpang.co.uk
I'm using the example included in this zip file http://skpang.googlecode.com/files/Canbus_v4.zip

I'm an experienced Electronics Technician with a fair amount of experience logging and reading CAN data using available CAN tools like NeoFire and P-CAN but I'm new to programming and for now I'm just trying to compile the example sketch and clear all the errors. Hopefully this will be a good exercise for me to learn how to properly include libraries, then I'll move to on other areas that give me trouble as I progress. Ultimately I'm looking to build a CAN-bus data logger to read CAN traffic on a vehicle.

I'm trying to compile an example sketch and I keep running into the same errors which I believe are Library related (I've attached a screen shot showing the Arduino file structure). I've spent about a week reading forum posts trying to get familiar with the proper way to include libraries and I'm pretty sure I'm placing them in the correct place. I've also gone through all the .c .cpp and .h files and replaced all the #include <Wprogram.h> with #include <Arduino.h> and I'm still running into the error:

'Canbus' was not declared in this scope.

see attached screen shot for all the errors:

I'm having trouble with including the code. I get the message : The message exceeds the maximum allowed length (9500 characters).
when I try to post so I'll try to post it to the next reply

You have not installed the Canbus library correctly.
It looks like you are on a Mac, do got to documents, there you will find an Arduino folder, open it up, then open the libraries folder. Drag the zip file into that folder and unzip it. Then delete the zip file and restart the arduino IDE.

Then you should be able to run the examples.

OK so the sketch is too long for one post so here is the first half

/* Welcome to the ECU Reader project. This sketch uses the Canbus library.
It requires the CAN-bus shield for the Arduino. This shield contains the MCP2515 CAN controller and the MCP2551 CAN-bus driver.
A connector for an EM406 GPS receiver and an uSDcard holder with 3v level convertor for use in data logging applications.
The output data can be displayed on a serial LCD.

The SD test functions requires a FAT16 formated card with a text file of WRITE00.TXT in the card.


SK Pang Electronics www.skpang.co.uk
v4.0 04-03-12 Updated for Arduino 1.0
v3.0 21-02-11  Use library from Adafruit for sd card instead.

*/

#include <SD.h>        /* Library from Adafruit.com */
//#include <SdFatUtil.h>
#include <SoftwareSerial.h>
#include "Canbus.h"


Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

SoftwareSerial sLCD =  SoftwareSerial(3, 6); /* Serial LCD is connected on pin 14 (Analog input 0) */
#define COMMAND 0xFE
#define CLEAR   0x01
#define LINE0   0x80
#define LINE1   0xC0


/* Define Joystick connection */
#define UP     A1
#define RIGHT  A2
#define DOWN   A3
#define CLICK  A4
#define LEFT   A5

  
char buffer[512];  //Data will be temporarily stored to this buffer before being written to the file
char tempbuf[15];
char lat_str[14];
char lon_str[14];

int read_size=0;   //Used as an indicator for how many characters are read from the file
int count=0;       //Miscellaneous variable

int D10 = 10;

int LED2 = 8;
int LED3 = 7;

// store error strings in flash to save RAM
#define error(s) error_P(PSTR(s))

void error_P(const char* str) {
  PgmPrint("error: ");
  SerialPrintln_P(str);
  
  clear_lcd();
  sLCD.print("SD error");
  
  if (card.errorCode()) {
    PgmPrint("SD error: ");
    Serial.print(card.errorCode(), HEX);
    
    Serial.print(',');
    Serial.println(card.errorData(), HEX);
   
  }
  while(1);
}

SoftwareSerial mySerial =  SoftwareSerial(4, 5);

#define COMMAND 0xFE
//#define powerpin 4

#define GPSRATE 4800
//#define GPSRATE 38400


// GPS parser for 406a
#define BUFFSIZ 90 // plenty big
//char buffer[BUFFSIZ];
char *parseptr;
char buffidx;
uint8_t hour, minute, second, year, month, date;
uint32_t latitude, longitude;
uint8_t groundspeed, trackangle;
char latdir, longdir;
char status;
uint32_t waypoint = 0;
 
void setup() {
  Serial.begin(GPSRATE);
  mySerial.begin(GPSRATE);
  pinMode(LED2, OUTPUT); 
  pinMode(LED3, OUTPUT); 
 
  digitalWrite(LED2, LOW);
  pinMode(UP,INPUT);
  pinMode(DOWN,INPUT);
  pinMode(LEFT,INPUT);
  pinMode(RIGHT,INPUT);
  pinMode(CLICK,INPUT);

  digitalWrite(UP, HIGH);       /* Enable internal pull-ups */
  digitalWrite(DOWN, HIGH);
  digitalWrite(LEFT, HIGH);
  digitalWrite(RIGHT, HIGH);
  digitalWrite(CLICK, HIGH);
  
  
  Serial.begin(9600);
  Serial.println("ECU Reader");  /* For debug use */
  
  sLCD.begin(9600);              /* Setup serial LCD and clear the screen */
  clear_lcd();
 
  sLCD.print("D:CAN  U:GPS");
  sLCD.write(COMMAND);
  sLCD.write(LINE1); 
  sLCD.print("L:SD   R:LOG");
  
  while(1)
  {
    
    if (digitalRead(UP) == 0){
      Serial.println("gps");
      sLCD.print("GPS");
      gps_test();
    }
    
    if (digitalRead(DOWN) == 0) {
      sLCD.print("CAN");
      Serial.println("CAN");
      break;
    }
    
    if (digitalRead(LEFT) == 0) {
    
      Serial.println("SD test");
      sd_test();
    }
    
    if (digitalRead(RIGHT) == 0) {
    
      Serial.println("Logging");
      logging();
    }
    
  }
  
  clear_lcd();
  
  if(Canbus.init(CANSPEED_500))  /* Initialise MCP2515 CAN controller at the specified speed */
  {
    sLCD.print("CAN Init ok");
  } else
  {
    sLCD.print("Can't init CAN");
  } 
   
  delay(1000); 

}
 

void loop() {
 
  if(Canbus.ecu_req(ENGINE_RPM,buffer) == 1)          /* Request for engine RPM */
  {
    sLCD.write(COMMAND);                   /* Move LCD cursor to line 0 */
    sLCD.write(LINE0);
    sLCD.print(buffer);                         /* Display data on LCD */
   
    
  } 
  digitalWrite(LED3, HIGH);
   
  if(Canbus.ecu_req(VEHICLE_SPEED,buffer) == 1)
  {
    sLCD.write(COMMAND);
    sLCD.write(LINE0 + 9);
    sLCD.print(buffer);
   
  }
  
  if(Canbus.ecu_req(ENGINE_COOLANT_TEMP,buffer) == 1)
  {
    sLCD.write(COMMAND);
    sLCD.write(LINE1);                     /* Move LCD cursor to line 1 */
    sLCD.print(buffer);
   
   
  }
  
  if(Canbus.ecu_req(THROTTLE,buffer) == 1)
  {
    sLCD.write(COMMAND);
    sLCD.write(LINE1 + 9);
    sLCD.print(buffer);
     file.print(buffer);
  }  
//  Canbus.ecu_req(O2_VOLTAGE,buffer);
     
   
   digitalWrite(LED3, LOW); 
   delay(100); 
   
   

}


void logging(void)
{
  clear_lcd();
  
  if(Canbus.init(CANSPEED_500))  /* Initialise MCP2515 CAN controller at the specified speed */
  {
    sLCD.print("CAN Init ok");
  } else
  {
    sLCD.print("Can't init CAN");
  } 
   
  delay(500);
  clear_lcd(); 
  sLCD.print("Init SD card");  
  delay(500);
  clear_lcd(); 
  sLCD.print("Press J/S click");  
  sLCD.write(COMMAND);
  sLCD.write(LINE1);                     /* Move LCD cursor to line 1 */
   sLCD.print("to Stop"); 
  
  // initialize the SD card at SPI_HALF_SPEED to avoid bus errors with
  // breadboards.  use SPI_FULL_SPEED for better performance.
  if (!card.init(SPI_HALF_SPEED,9)) error("card.init failed");
  
  // initialize a FAT volume
  if (!volume.init(&card)) error("volume.init failed");
  
  // open the root directory
  if (!root.openRoot(&volume)) error("openRoot failed");

  // create a new file
  char name[] = "WRITE00.TXT";
  for (uint8_t i = 0; i < 100; i++) {
    name[5] = i/10 + '0';
    name[6] = i%10 + '0';
    if (file.open(&root, name, O_CREAT | O_EXCL | O_WRITE)) break;
  }
  if (!file.isOpen()) error ("file.create");
  Serial.print("Writing to: ");
  Serial.println(name);
  // write header
  file.writeError = 0;
  file.print("READY....");
  file.println();  

  while(1)    /* Main logging loop */
  {
     read_gps();
     
     file.print(waypoint++);
     file.print(',');
     file.print(lat_str);
     file.print(',');
     file.print(lon_str);
     file.print(',');
      
    if(Canbus.ecu_req(ENGINE_RPM,buffer) == 1)          /* Request for engine RPM */
      {
        sLCD.write(COMMAND);                   /* Move LCD cursor to line 0 */
        sLCD.write(LINE0);
        sLCD.print(buffer);                         /* Display data on LCD */
        file.print(buffer);
         file.print(',');
    
      } 
      digitalWrite(LED3, HIGH);
   
      if(Canbus.ecu_req(VEHICLE_SPEED,buffer) == 1)
      {
        sLCD.write(COMMAND);
        sLCD.write(LINE0 + 9);
        sLCD.print(buffer);
        file.print(buffer);
        file.print(','); 
      }
      
      if(Canbus.ecu_req(ENGINE_COOLANT_TEMP,buffer) == 1)
      {
        sLCD.write(COMMAND);
        sLCD.write(LINE1);                     /* Move LCD cursor to line 1 */
        sLCD.print(buffer);
         file.print(buffer);
       
      }
      
      if(Canbus.ecu_req(THROTTLE,buffer) == 1)
      {
        sLCD.write(COMMAND);
        sLCD.write(LINE1 + 9);
        sLCD.print(buffer);
         file.print(buffer);
      }  
    //  Canbus.ecu_req(O2_VOLTAGE,buffer);
       file.println();  
  
       digitalWrite(LED3, LOW); 
 
       if (digitalRead(CLICK) == 0){  /* Check for Click button */
           file.close();
           Serial.println("Done");
           sLCD.write(COMMAND);
           sLCD.write(CLEAR);
     
           sLCD.print("DONE");
          while(1);
        }

  }
 
 
 
 
}
     

void sd_test(void)
{
 clear_lcd(); 
 sLCD.print("SD test"); 
 Serial.println("SD card test");
   
     // initialize the SD card at SPI_HALF_SPEED to avoid bus errors with
  // breadboards.  use SPI_FULL_SPEED for better performance.
  if (!card.init(SPI_HALF_SPEED,9)) error("card.init failed");
  
  // initialize a FAT volume
  if (!volume.init(&card)) error("volume.init failed");
  
  // open root directory
  if (!root.openRoot(&volume)) error("openRoot failed");
  // open a file
  if (file.open(&root, "LOGGER00.CSV", O_READ)) {
    Serial.println("Opened PRINT00.TXT");
  }
  else if (file.open(&root, "WRITE00.TXT", O_READ)) {
    Serial.println("Opened WRITE00.TXT");    
  }
  else{
    error("file.open failed");
  }
  Serial.println();
  
  // copy file to serial port
  int16_t n;
  uint8_t buf[7];// nothing special about 7, just a lucky number.
  while ((n = file.read(buf, sizeof(buf))) > 0) {
    for (uint8_t i = 0; i < n; i++) Serial.print(buf[i]);

And here is the second half

  }
 clear_lcd();  
 sLCD.print("DONE"); 

  
 while(1);  /* Don't return */ 
    

}
void read_gps(void)
{
 uint32_t tmp;

  unsigned char i;
  unsigned char exit = 0;
  
  
  while( exit == 0)
  { 
    
   readline();
 
  // check if $GPRMC (global positioning fixed data)
   if (strncmp(buffer, "$GPRMC",6) == 0) {
     
        digitalWrite(LED2, HIGH);
        
        // hhmmss time data
        parseptr = buffer+7;
        tmp = parsedecimal(parseptr); 
        hour = tmp / 10000;
        minute = (tmp / 100) % 100;
        second = tmp % 100;
        
        parseptr = strchr(parseptr, ',') + 1;
        status = parseptr[0];
        parseptr += 2;
          
        for(i=0;i<11;i++)
        {
          lat_str[i] = parseptr[i];
        }
        lat_str[12] = 0;
      //  Serial.println(" ");
      //  Serial.println(lat_str);
       
        // grab latitude & long data
        latitude = parsedecimal(parseptr);
        if (latitude != 0) {
          latitude *= 10000;
          parseptr = strchr(parseptr, '.')+1;
          latitude += parsedecimal(parseptr);
        }
        parseptr = strchr(parseptr, ',') + 1;
        // read latitude N/S data
        if (parseptr[0] != ',') {
          
          latdir = parseptr[0];
        }
        
        // longitude
        parseptr = strchr(parseptr, ',')+1;
      
        for(i=0;i<12;i++)
        {
          lon_str[i] = parseptr[i];
        }
        lon_str[13] = 0;
        
        //Serial.println(lon_str);
   
        longitude = parsedecimal(parseptr);
        if (longitude != 0) {
          longitude *= 10000;
          parseptr = strchr(parseptr, '.')+1;
          longitude += parsedecimal(parseptr);
        }
        parseptr = strchr(parseptr, ',')+1;
        // read longitude E/W data
        if (parseptr[0] != ',') {
          longdir = parseptr[0];
        }
        
    
        // groundspeed
        parseptr = strchr(parseptr, ',')+1;
        groundspeed = parsedecimal(parseptr);
    
        // track angle
        parseptr = strchr(parseptr, ',')+1;
        trackangle = parsedecimal(parseptr);
    
        // date
        parseptr = strchr(parseptr, ',')+1;
        tmp = parsedecimal(parseptr); 
        date = tmp / 10000;
        month = (tmp / 100) % 100;
        year = tmp % 100;
        
       
        digitalWrite(LED2, LOW);
        exit = 1;
       }
       
  }   

}

      
      

void gps_test(void){
  uint32_t tmp;
  uint32_t lat;
  unsigned char i;
  
  while(1){
  
   readline();
  
  // check if $GPRMC (global positioning fixed data)
  if (strncmp(buffer, "$GPRMC",6) == 0) {
    
    // hhmmss time data
    parseptr = buffer+7;
    tmp = parsedecimal(parseptr); 
    hour = tmp / 10000;
    minute = (tmp / 100) % 100;
    second = tmp % 100;
    
    parseptr = strchr(parseptr, ',') + 1;
    status = parseptr[0];
    parseptr += 2;
      
    for(i=0;i<11;i++)
    {
      lat_str[i] = parseptr[i];
    }
    lat_str[12] = 0;
     Serial.println("\nlat_str ");
     Serial.println(lat_str);
   
  
    // grab latitude & long data
    // latitude
    latitude = parsedecimal(parseptr);
    if (latitude != 0) {
      latitude *= 10000;
      parseptr = strchr(parseptr, '.')+1;
      latitude += parsedecimal(parseptr);
    }
    parseptr = strchr(parseptr, ',') + 1;
    // read latitude N/S data
    if (parseptr[0] != ',') {
      
      latdir = parseptr[0];
    }
    
    //Serial.println(latdir);
    
    // longitude
    parseptr = strchr(parseptr, ',')+1;
  
    for(i=0;i<12;i++)
    {
      lon_str[i] = parseptr[i];
    }
    lon_str[13] = 0;
    
    Serial.println(lon_str);
   
  
    longitude = parsedecimal(parseptr);
    if (longitude != 0) {
      longitude *= 10000;
      parseptr = strchr(parseptr, '.')+1;
      longitude += parsedecimal(parseptr);
    }
    parseptr = strchr(parseptr, ',')+1;
    // read longitude E/W data
    if (parseptr[0] != ',') {
      longdir = parseptr[0];
    }
    

    // groundspeed
    parseptr = strchr(parseptr, ',')+1;
    groundspeed = parsedecimal(parseptr);

    // track angle
    parseptr = strchr(parseptr, ',')+1;
    trackangle = parsedecimal(parseptr);

    // date
    parseptr = strchr(parseptr, ',')+1;
    tmp = parsedecimal(parseptr); 
    date = tmp / 10000;
    month = (tmp / 100) % 100;
    year = tmp % 100;
    
    Serial.print("\nTime: ");
    Serial.print(hour, DEC); Serial.print(':');
    Serial.print(minute, DEC); Serial.print(':');
    Serial.print(second, DEC); Serial.print(' ');
    Serial.print("Date: ");
    Serial.print(month, DEC); Serial.print('/');
    Serial.print(date, DEC); Serial.print('/');
    Serial.println(year, DEC);
    
    sLCD.write(COMMAND);
    sLCD.write(0x80);
    sLCD.print("La");
   
    Serial.print("Lat"); 
    if (latdir == 'N')
    {
       Serial.print('+');
       sLCD.print("+");
    }
    else if (latdir == 'S')
    {  
       Serial.print('-');
       sLCD.print("-");
    }
     
    Serial.print(latitude/1000000, DEC); Serial.write('\°'); Serial.print(' ');
    Serial.print((latitude/10000)%100, DEC); Serial.print('\''); Serial.print(' ');
    Serial.print((latitude%10000)*6/1000, DEC); Serial.print('.');
    Serial.print(((latitude%10000)*6/10)%100, DEC); Serial.println('"');
    
    
    
    sLCD.print(latitude/1000000, DEC); sLCD.write(0xDF); sLCD.print(' ');
    sLCD.print((latitude/10000)%100, DEC); sLCD.print('\''); //sLCD.print(' ');
    sLCD.print((latitude%10000)*6/1000, DEC); sLCD.print('.');
    sLCD.print(((latitude%10000)*6/10)%100, DEC); sLCD.print('"');
    
    sLCD.write(COMMAND);
    sLCD.write(0xC0);
    sLCD.print("Ln");
   
      
    Serial.print("Long: ");
    if (longdir == 'E')
    {
       Serial.print('+');
       sLCD.print('+');
    }
    else if (longdir == 'W')
    { 
       Serial.print('-');
       sLCD.print('-');
    }
    Serial.print(longitude/1000000, DEC); Serial.write('\°'); Serial.print(' ');
    Serial.print((longitude/10000)%100, DEC); Serial.print('\''); Serial.print(' ');
    Serial.print((longitude%10000)*6/1000, DEC); Serial.print('.');
    Serial.print(((longitude%10000)*6/10)%100, DEC); Serial.println('"');
    
    sLCD.print(longitude/1000000, DEC); sLCD.write(0xDF); sLCD.print(' ');
    sLCD.print((longitude/10000)%100, DEC); sLCD.print('\''); //sLCD.print(' ');
    sLCD.print((longitude%10000)*6/1000, DEC); sLCD.print('.');
    sLCD.print(((longitude%10000)*6/10)%100, DEC); sLCD.print('"');
     
  }
  
 //   Serial.println("Lat: ");
 //   Serial.println(latitude);
  
 //   Serial.println("Lon: ");
 //   Serial.println(longitude);
  }



}

void readline(void) {
  char c;
  
  buffidx = 0; // start at begninning
  while (1) {
      c=mySerial.read();
      if (c == -1)
        continue;
  //    Serial.print(c);
      if (c == '\n')
        continue;
      if ((buffidx == BUFFSIZ-1) || (c == '\r')) {
        buffer[buffidx] = 0;
        return;
      }
      buffer[buffidx++]= c;
  }
}
uint32_t parsedecimal(char *str) {
  uint32_t d = 0;
  
  while (str[0] != 0) {
   if ((str[0] > '9') || (str[0] < '0'))
     return d;
   d *= 10;
   d += str[0] - '0';
   str++;
  }
  return d;
}

void clear_lcd(void)
{
  sLCD.write(COMMAND);
  sLCD.write(CLEAR);
}

See this line:-

#include "Canbus.h"

See the first line in the errors you posted.
It told you the compiler could not find the file because it is not in the correct place.

@Grumpy_Mike

I can certainly see why it looks like a MAC in the screenshot but I'm actually running Windows7 64bit

@Grumpy_Mike

Thanks! I had assumed that's what it meant

There is a file named Canbus.h in the Canbus folder, so again I'll make the assumption that the folder is in the wrong location?

I'd just like to say "wow the response from this post was FAST!"

I post this in hops to get a dialog going over the weekend. I'm actually getting ready to leave work shortly so I wont be able to respond until later this evening.

Drayden:
OK so the sketch is too long for one post so here is the first half ...

You can add attachments to posts:

Also read this:

http://arduino.cc/en/Guide/Libraries

Try moving the Canbus folder from C:\Arduino\arduino-1.0.4\My Sketches\ to C:\Arduino\arduino-1.0.4\libraries\

If that doesn't work move it back...

FWIW I've also seen brackets around library names in the define statement. So, you might want to try these four permutations:

  • Canbus folder in My Sketches with #include "Canbus.h" (This appears to be what you have already tried)
  • Canbus folder in My Sketches with #include <Canbus.h>
  • Canbus folder in libraries with #include <Canbus.h>
  • Canbus folder in libraries with #include "Canbus.h"

See which of these permutations work.

Edit: corrected my copy-and-paste work...

Where the file should be is in the libraries that is inside the My Sketches folder. So just move it one folder down.

Thanks Grumpy_Mike!

I moved the CAN folder down one level to:

C:\Arduino\arduino-1.0.4\My Sketches\libraries

I then tried all four "permutations" as you suggested and if I open the .ino file from the drop down menu (open or examples) within the Arduino IDE, I receive errors when I try to compile. The sketch will compile if the CAN folder is in C:\Arduino\arduino-1.0.4\My Sketches\libraries and I open the .ino directly from windows explorer, but not in C:\Arduino\arduino-1.0.4\libraries\

I must tell you that I suspect not only my OS (win7 64), but also this particular laptop. I have to routinely uninstall drivers when switching between tools that was never a problem with my other pc. Also, I have a sketch that compiles every time no matter where I put it on my xp machine, but when I tried to run it on this win7 64 laptop, it will only run if I place it in C:\Arduino\arduino-1.0.4\My Sketches\libraries and then only if I run the .ino from windows explorer

It's a bit frustrating but at least I have a method that compiles the sketch. I was able to upload it to the Arduino Mega with the spark fun skpang CAN-bus shield and see it run "partially" using serial monitor and I'm beginning to understand whats going on in the code a piece at a time. Which is what my goal was in the first place.

This does answer some questions but leave some still. As I said earlier, I did a lot of reading before posting and below is the info I've gathered. I'd like to confirm or dispel what I've read on the forum to help clear up some confusion. Baring my issue with the laptop I'm having, let's assume the OS is working fine:

There are two library locations utilized by the Aarduino IDE.

  1. The Core library is located in the libraries folder where ever the Arduino folder is located. In my case it's; C:\Arduino\arduino-1.0.4\libraries.
  2. The User loaded libraries are in the libraries folder located in the sketches folder. This folder can be named whatever as long as its selected as the "sketch" folder within the Arduino IDE (file>preferences>sketchbook location). In my case I named a folder Sketches and put it in the Arduino folder for simplicity. C:\Arduino\arduino-1.0.4\My Sketches.
Also read this:

http://arduino.cc/en/Guide/Libraries

I did read this, it's one of the first items I read about the issue and it's confusing because it lacks any mention of user loaded libraries being located in the sketchbook folder location. In fact the forum posts are the only place I've found info on user loaded libraries. Unless I'm mistaken there is no official documentation on the subject.

syntax question:

The use of <> as opposed to " " is still unclear to me. From what I can tell <> surrounding a library file i.e. <Canbus.h> denotes a library located in the core Arduino library and " " as in "Canbus.h" denotes a library located in the user loaded folder.

Is this just convention in order to add clarity to the programmer or does the IDE actually handle this syntax differently for the two cases? I don't trust my setup enough to work out the answer by trial and error. On this laptop it doesn't make a difference which syntax I use.

I'm going to try this same sequence on my xp machine at home once I have a chance. For now I'm on to the next steps trying to understand how this sketch functions.

Thank you for your help, it made for some good tinkering for a few hours yesterday!

There are two library locations utilized by the Aarduino IDE.

  1. The Core library is located in the libraries folder where ever the Arduino folder is located. In my case it's; C:\Arduino\arduino-1.0.4\libraries.
  2. The User loaded libraries are in the libraries folder located in the sketches folder. This folder can be named whatever as long as its selected as the "sketch" folder within the Arduino IDE (file>preferences>sketchbook location). In my case I named a folder Sketches and put it in the Arduino folder for simplicity. C:\Arduino\arduino-1.0.4\My Sketches.

What is going to happen to your sketches when 1.0.5 is released? The sketch folder is generally NOT placed in a location that you might want to delete.

What is going to happen to your sketches when 1.0.5 is released? The sketch folder is generally NOT placed in a location that you might want to delete.

Your correct, and I had considered this but decided it would be easy enough to just move the sketch folder when I'm ready to update the IDE and then move it back when I'm finnished. Because of my work it's just less complicated for me to keep them in the C:\Arduino... branch.

Now that I'm looking at it, I guess I could just move the sketch folder up one level to reside along side the arduino-1.0.x folder. Then I'd have the folder in the C:\Arduino branch and be able to update the IDE without moving things around.

@PaulS

Thanks for the advice!

Does this look better?

I still can only compile the sketch if I open the .ino file from windows explorer. I still get multiple errors when I open the file from the IDE.

That's how I have my Arduino sketches and 6 versions of the IDE structured.