Arduino to Pure Data (on WIndows 10)

Hey Forum,
I have been trying to get my Arduino working with Pure Data via Serial for the last couple Days but so far no success :frowning:

My Goal is to connect a couple sensors to my Arduino (Poti, Lightsensor, touch,...) and to control various parameters in Pure Data (i.e. Volume, Pitch,...).

First I simply connected a Poti to my Arduino UNO to do a analog.Read and to then send that value with serial.write. Then I wanted to read that data with the 'comport' message box in Pure Data. That didn't work. After a bit of research I found out that there was a Problem with Windows 10, where the comport command doesn't work properly (I also heard it has been fixed recently but couldn't figure out how)

Next I tried to use the PDuino 0.5
I used the StandardFirmata example
Here I got stuck compiling the Code. First I had to change the WProgram.h to Arduino.h in the libraries (Firmata.h and so on) since Wprogram.h is apparently out of use now.
Now I get an ERROR that BYTE was not declared in this scope. I'll post the error message below.

How can I fix this? OR does anyone have a tip or a better/easier way to communicate from arduino to Pure Data?

The Error:

Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In function 'void sendValueAsTwo7bitBytes(int)':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:32:35: error: 'BYTE' was not declared in this scope

   Serial.print(value & B01111111, BYTE); // LSB

                                   ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In function 'void startSysex()':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:38:29: error: 'BYTE' was not declared in this scope

   Serial.print(START_SYSEX, BYTE);

                             ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In function 'void endSysex()':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:43:27: error: 'BYTE' was not declared in this scope

   Serial.print(END_SYSEX, BYTE);

                           ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In member function 'void FirmataClass::printVersion()':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:82:32: error: 'BYTE' was not declared in this scope

   Serial.print(REPORT_VERSION, BYTE);

                                ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In member function 'void FirmataClass::printFirmwareVersion()':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:104:35: error: 'BYTE' was not declared in this scope

     Serial.print(REPORT_FIRMWARE, BYTE);

                                   ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In member function 'void FirmataClass::sendAnalog(byte, int)':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:270:46: error: 'BYTE' was not declared in this scope

   Serial.print(ANALOG_MESSAGE | (pin & 0xF), BYTE);

                                              ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In member function 'void FirmataClass::sendDigitalPort(byte, int)':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:301:53: error: 'BYTE' was not declared in this scope

   Serial.print(DIGITAL_MESSAGE | (portNumber & 0xF),BYTE);

                                                     ^

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp: In member function 'void FirmataClass::sendSysex(byte, byte, byte*)':

C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp:311:25: error: 'BYTE' was not declared in this scope

   Serial.print(command, BYTE);

                         ^

exit status 1

Thanks for your replies in Advance!

Serial.print() with the BYTE parameter has been replaced by Serial.write() in recent versions of the IDE so

  Serial.print(value & B01111111, BYTE); // LSB

should be

  Serial.write(value & B01111111); // LSB

Thanks it worked :slight_smile: