Uploading code from command prompt or Max/Msp?

Hey all.

I’m relatively new to Arduino and I’m still learning, so please bear with me. :wink:

My goal is to be able to upload code to Arduino from Max/Msp without leaving the max-environment. To that end I was planning to use DOShack (max/msp java-object that i found) to acces the command prompt and compile/upload from there.

Now I have been trying to upload a sketch to my Arduino Duemilanove from the command prompt (win Xp) using the batch files supplied at:

arduino.cc/playground/Code/WindowsCommandLine
(sorry not allowed to post links yet)

but I can’t seem to get it working.

This is the sketch (extremely simple for testing purposes)
It reads a Phidget Touch-Switch connected to Analog input 5.

int sensorPin = 5;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print("Read sensor input: ");
  Serial.println(analogRead(sensorPin));
  delay(10);
}

And this is what happens when i try it:
(added the directory contents for the sake of clarity)
(I hope)

D:\Frontman_E-mic\Arduino\TouchSwitchTest>dir
Volume in drive D is DATA
Volume Serial Number is 143F-F6C8

Directory of D:\Frontman_E-mic\Arduino\TouchSwitchTest

09-02-2010 15:48 .
09-02-2010 15:48 …
09-02-2010 15:48 361 TouchSwitchTest.pde
1 File(s) 361 bytes
2 Dir(s) 101.385.637.888 bytes free

D:\Frontman_E-mic\Arduino\TouchSwitchTest>abuild touchswitchtest.pde

The system cannot find the path specified.
.\obj\touchswitchtest.pde.cpp:1:22: error: WProgram.h: No such file or directory

.\obj\touchswitchtest.pde.cpp: In function ‘void setup()’:
.\obj\touchswitchtest.pde.cpp:16: error: ‘Serial’ was not declared in this scope

.\obj\touchswitchtest.pde.cpp: In function ‘void loop()’:
.\obj\touchswitchtest.pde.cpp:21: error: ‘Serial’ was not declared in this scope

.\obj\touchswitchtest.pde.cpp:22: error: ‘analogRead’ was not declared in this s
cope
.\obj\touchswitchtest.pde.cpp:23: error: ‘delay’ was not declared in this scope
abuild.bat: *** ERROR: cannot compile .\obj\touchswitchtest.pde.cpp using comman
d:
abuild.bat: *** ERROR: avr-g++ -c -g -Os “-IC:\arduino-0018\hardware\cores\ardui
no” -I"D:\Frontman_E-mic\Arduino\TouchSwitchTest\obj" -mmcu=atmega168 -DF_CPU=1
6000000 -DABUILD_BATCH=1 -fno-exceptions .\obj\touchswitchtest.pde.cpp -o.\obj\t
ouchswitchtest.pde.cpp.o

"The system cannot find the path specified."This happens whatever I do…at first I thought it reffered to my sketch but I’m not so sure anymore since changing directory does nothing to resolve this.

I have followed all instructions given as much as I could.(adding system variables)
I don’t think I would need to adapt the code, though I might be wrong. I don’t quite understand the way it’s explained.

I have been considering that the batch files are simply outdated by update’s to the Arduino IDE but I really don’t know.

My entire (school)project hinges on the abbility to upload code from Max/Msp so any help would be much appreciated. :slight_smile:
I hope I’m being clear enough…and that it’s not something REALLY obvious that I just can’t see :wink:

Thnx in Advance, Gustav