Hello, my name is Stavros.
I' m getting started with arduino Duemilanove for a project with Max/msp.I got the script to upload on the board.It is a simple message script with arduino 0012.Unfortunately, i get an error while compiling.I have posted below the .pde file and the error message,if you can help me solve it.
#include <SimpleMessageSystem.h>
void setup()
{
Serial.begin(9600);
}
void loop()
{
if (messageBuild() > 0)
{
switch (messageGetChar ())
{
case 'r' :
readpins ();
break;
case 'w' :
writepin ();
}
}
}
void readpins ()
{
switch (messageGetChar())
{
case 'd' :
messageSendChar('d');
for (char i=2;i<14;i++)
{
messageSendInt (digitalRead (i));
}
messageEnd();
break;
case 'a' :
messageSendChar('a');
for (char i=0;i<6;i++)
{
messageSendInt (analogRead (i));
}
messageEnd();
}
}
void writepin()
{
int pin;
int state;
switch (messageGetChar())
{
case 'a' :
pin = messageGetInt();
state = messageGetInt();
pinMode(pin, OUTPUT);
analogWrite(pin, state);
break;
case 'd' :
pin = messageGetInt();
state = messageGetInt();
pinMode (pin, OUTPUT);
digitalWrite(pin, state);
}
}
Error :
In function 'void loop()':
error: 'messageBuild' was not declared in this scope In function 'void readpins()':
In function 'void writepin()':
Thank you in advance.