problemas con printByte

tengo una seeeduino USB y he instalado el soft arduino 0015, el problema que tengo es con la función printByte():

ejemplo:
void printNewLine() {
printByte(13);
printByte(10);
}

error:
In function 'void printNewLine()':
error: 'printByte' was not declared in this scope In function 'void loop()':

Lo mismo ocurre con printString(), etc.
por las dudas estoy bajando una versión previa (0014).
gracias

PrintByte se usa para comunicar con el puerto serie
Entonces debe ser algo así:
Serial.printByte (255):

Saludos

/BlueIcaro

tengo s mismo problema con el codigo que viene en Pd_Firmware.pde
Todas las partes que tienen printByte, me las marca como error:\

#define SET_PIN_ZERO_TO_IN 130 // set digital pin 0 to INPUT
#define SET_PIN_ONE_TO_IN 131 // set digital pin 1 to INPUT
#define SET_PIN_TWO_TO_IN 132
#define SET_PIN_THREE_TO_IN 133
#define SET_PIN_FOUR_TO_IN 134
#define SET_PIN_FIVE_TO_IN 135
#define SET_PIN_SIX_TO_IN 136
#define SET_PIN_SEVEN_TO_IN 137
#define SET_PIN_EIGHT_TO_IN 138
#define SET_PIN_NINE_TO_IN 139
#define SET_PIN_TEN_TO_IN 140
#define SET_PIN_ELEVEN_TO_IN 141
#define SET_PIN_TWELVE_TO_IN 142
#define SET_PIN_THIRTEEN_TO_IN 143

#define DISABLE_DIGITAL_INPUTS 150
#define ENABLE_DIGITAL_INPUTS 151 // enable reporting of digital inputs
/* 152-159 // UNUSED /
#define DISABLE_ALL_ANALOG_INS 160 // disable reporting on all analog ins
#define ENABLE_ONE_ANALOG_IN 161 // enable reporting for 1 analog in (0)
#define ENABLE_TWO_ANALOG_INS 162 // enable reporting for 2 analog ins (0,1)
#define ENABLE_THREE_ANALOG_INS 163 // enable reporting for 3 analog ins (0-2)
#define ENABLE_FOUR_ANALOG_INS 164 // enable reporting for 4 analog ins (0-3)
#define ENABLE_FIVE_ANALOG_INS 165 // enable reporting for 5 analog ins (0-4)
#define ENABLE_SIX_ANALOG_INS 166 // enable reporting for 6 analog ins (0-5)
/
167-199 // UNUSED /
#define SET_PIN_ZERO_TO_OUT 200 // set digital pin 0 to OUTPUT
#define SET_PIN_ONE_TO_OUT 201 // set digital pin 1 to OUTPUT
#define SET_PIN_TWO_TO_OUT 202 // set digital pin 2 to OUTPUT
#define SET_PIN_THREE_TO_OUT 203
#define SET_PIN_FOUR_TO_OUT 204
#define SET_PIN_FIVE_TO_OUT 205
#define SET_PIN_SIX_TO_OUT 206
#define SET_PIN_SEVEN_TO_OUT 207
#define SET_PIN_EIGHT_TO_OUT 208
#define SET_PIN_NINE_TO_OUT 209
#define SET_PIN_TEN_TO_OUT 210
#define SET_PIN_ELEVEN_TO_OUT 211
#define SET_PIN_TWELVE_TO_OUT 212
#define SET_PIN_THIRTEEN_TO_OUT 213
/
214-228 // UNUSED /
#define OUTPUT_TO_DIGITAL_PINS 229 // next two bytes set digital output data
/
230-249 // UNUSED /
#define DISABLE_PWM 250 // next byte sets pin # to disable
#define ENABLE_PWM 251 // next two bytes set pin # and duty cycle
#define DISABLE_SOFTWARE_PWM 252 // next byte sets pin # to disable
#define ENABLE_SOFTWARE_PWM 253 // next two bytes set pin # and duty cycle
#define SET_SOFTWARE_PWM_FREQ 254
/
252-254 // UNUSED */
#define INPUT_CYCLE_MARKER 255

#define TOTAL_DIGITAL_PINS 14

#define PWM 2
#define SOFTPWM 3

// maximum number of post-command data bytes
#define MAX_DATA_BYTES 2
// this flag says the next serial input will be data
byte waitForData = 0;
byte executeMultiByteCommand = 0; // command to execute after getting multi-byte data
byte storedInputData[MAX_DATA_BYTES] = {0,0}; // multi-byte data

boolean firstInputByte = false;
int digitalPinStatus;

int pwmStatus;
int softPwmStatus;

boolean digitalInputsEnabled = true;
byte analogInputsEnabled = 6;

byte analogPin;
int analogData;

void transmitDigitalInput(byte startPin) {
byte i;
byte digitalPin;
// byte digitalPinBit;
byte transmitByte = 0;
byte digitalData;

for(i=0;i<7;++i) {
digitalPin = i+startPin;
/* digitalPinBit = OUTPUT << digitalPin;
// only read the pin if its set to input
if(digitalPinStatus & digitalPinBit) {
digitalData = 0; // pin set to OUTPUT, don't read
}
else if( (digitalPin >= 9) && (pwmStatus & (1 << digitalPin)) ) {
digitalData = 0; // pin set to PWM, don't read
}
if( !(digitalPinStatus & (1 << digitalPin)) ) {
digitalData = (byte) digitalRead(digitalPin);
transmitByte = transmitByte + ((1 << i) * digitalData);
}
}
printByte(transmitByte);
}

void setPinMode(int pin, int mode) {
if(mode == INPUT) {
digitalPinStatus = digitalPinStatus &~ (1 << pin);
pwmStatus = pwmStatus &~ (1 << pin);
pinMode(pin,INPUT);
}
else if(mode == OUTPUT) {
digitalPinStatus = digitalPinStatus | (1 << pin);
pwmStatus = pwmStatus &~ (1 << pin);
pinMode(pin,OUTPUT);
}
else if( (mode == PWM) && (pin >= 9) && (pin <= 11) ) {
digitalPinStatus = digitalPinStatus | (1 << pin);
pwmStatus = pwmStatus | (1 << pin);
pinMode(pin,OUTPUT);
}
}

void setSoftPwm (int pin, byte pulsePeriod) {
byte i;
/* for(i=0; i<7; ++i) {
mask = 1 << i;
if(digitalPinStatus & mask) {
digitalWrite(i, inputData & mask);
}
}
}

void setSoftPwmFreq(byte freq) {
}

void disSoftPwm(int pin) {
//throw pin low

}
void checkForInput() {
if(serialAvailable()) {
while(serialAvailable()) {
processInput( (byte)serialRead() );
}
}
}
void processInput(byte inputData) {
int i;
int mask;

// a few commands have byte(s) of data following the command
if( waitForData > 0) {
waitForData--;
storedInputData[waitForData] = inputData;
}
else if(executeMultiByteCommand) {
//we got everything
switch(executeMultiByteCommand) {
case ENABLE_PWM:
setPinMode(storedInputData[1],PWM);
analogWrite(storedInputData[1], storedInputData[0]);
break;
case DISABLE_PWM:
setPinMode(storedInputData[0],INPUT);
break;
}
executeMultiByteCommand = 0;
}

else if(inputData < 128) {
if(firstInputByte) { //
for(i=0; i<7; ++i) {
mask = 1 << i;
if(digitalPinStatus & mask) {
digitalWrite(i, inputData & mask);
}
}
firstInputByte = false;
}
else { //
// output data for pins 7-13
for(i=7; i<TOTAL_DIGITAL_PINS; ++i) {
mask = 1 << i;
if( (digitalPinStatus & mask) && !(pwmStatus & mask) && !(softPwmStatus & mask) ) {
digitalWrite(i, inputData & (mask >> 7));
}
}
}
}
else {
switch (inputData) {
case SET_PIN_ZERO_TO_IN: // set digital pins to INPUT
case SET_PIN_ONE_TO_IN:
case SET_PIN_TWO_TO_IN:
case SET_PIN_THREE_TO_IN:
case SET_PIN_FOUR_TO_IN:
case SET_PIN_FIVE_TO_IN:
case SET_PIN_SIX_TO_IN:
case SET_PIN_SEVEN_TO_IN:
case SET_PIN_EIGHT_TO_IN:
case SET_PIN_NINE_TO_IN:
case SET_PIN_TEN_TO_IN:
case SET_PIN_ELEVEN_TO_IN:
case SET_PIN_TWELVE_TO_IN:
case SET_PIN_THIRTEEN_TO_IN:
setPinMode(inputData - SET_PIN_ZERO_TO_IN, INPUT);
break;
case SET_PIN_ZERO_TO_OUT: // set digital pins to OUTPUT
case SET_PIN_ONE_TO_OUT:
case SET_PIN_TWO_TO_OUT:
case SET_PIN_THREE_TO_OUT:
case SET_PIN_FOUR_TO_OUT:
case SET_PIN_FIVE_TO_OUT:
case SET_PIN_SIX_TO_OUT:
case SET_PIN_SEVEN_TO_OUT:
case SET_PIN_EIGHT_TO_OUT:
case SET_PIN_NINE_TO_OUT:
case SET_PIN_TEN_TO_OUT:
case SET_PIN_ELEVEN_TO_OUT:
case SET_PIN_TWELVE_TO_OUT:
case SET_PIN_THIRTEEN_TO_OUT:
setPinMode(inputData - SET_PIN_ZERO_TO_OUT, OUTPUT);
break;
case DISABLE_DIGITAL_INPUTS: // all digital inputs off
digitalInputsEnabled = false;
break;
case ENABLE_DIGITAL_INPUTS: // all digital inputs on
digitalInputsEnabled = true;
break;
case DISABLE_ALL_ANALOG_INS: // analog input off
case ENABLE_ONE_ANALOG_IN: // analog 0 on
case ENABLE_TWO_ANALOG_INS: // analog 0,1 on
case ENABLE_THREE_ANALOG_INS: // analog 0-2 on
case ENABLE_FOUR_ANALOG_INS: // analog 0-3 on
case ENABLE_FIVE_ANALOG_INS: // analog 0-4 on
case ENABLE_SIX_ANALOG_INS: // analog 0-5 on
analogInputsEnabled = inputData - DISABLE_ALL_ANALOG_INS;
break;
case ENABLE_PWM:
waitForData = 2; // 2 bytes needed (pin#, dutyCycle)
executeMultiByteCommand = inputData;
break;
case DISABLE_PWM:
waitForData = 1; // 1 byte needed (pin#)
executeMultiByteCommand = inputData;
break;
case SET_SOFTWARE_PWM_FREQ:
waitForData = 1; // 1 byte needed (pin#)
executeMultiByteCommand = inputData;
break;
case ENABLE_SOFTWARE_PWM:
waitForData = 2;
executeMultiByteCommand = inputData;
brreak;
case DISABLE_SOFTWARE_PWM:
waitForData = 1; // 1 byte needed (pin#)
executeMultiByteCommand = inputData;
break;
case OUTPUT_TO_DIGITAL_PINS: // bytes to send to digital outputs
firstInputByte = true;
break;
}
}
}
void setup() {
byte i;

beginSerial(19200);
for(i=0; i<TOTAL_DIGITAL_PINS; ++i) {
setPinMode(i,OUTPUT);
}
}
void loop() {
checkForInput();

// read all digital pins, in enabled
if(digitalInputsEnabled) {
transmitDigitalInput(0);
checkForInput();
transmitDigitalInput(7);
checkForInput();
}
else if(analogInputsEnabled) {
// filler bytes, since the first thing sent is always the digitalInputs
printByte(0);
printByte(0);
checkForInput();
}

/* get analog in, for the number enabled
*/
for(analogPin=0; analogPin<analogInputsEnabled; ++analogPin) {
analogData = analogRead(analogPin);

printByte(analogData % 128);
printByte(analogData >> 7); byte
checkForInput();
}

/* end with the cycle marker, if any of the inputs are enabled */
if( digitalInputsEnabled || analogInputsEnabled) {
printByte(255);
}
}

es largo el codigo asi que elimine varios comentarios.
este debe funcioar con arduino.pd para Pd

if( digitalInputsEnabled || analogInputsEnabled)

aunque cambie printByte por Serial.printByte()
no funciono

Serial.print(0x55,BYTE); //intenta esto

Buenas noches, un saludo desde Mexico. :slight_smile:

Fijense que yo tambien tengo este mismo problema acabo de adquirir una tarjeta Arduino Duemilanove ATMEGA328

y la conecte a mi usb y ya hecho prender el foquito de hello world.
y varias cosas, pero ahora quiero conectarme al Pure data, el problema es el mismo de los compañeros.

Este es el archivo del codigo. de mi Pd_firmware en mi Arduino 0018
Este es el error.

error: 'printByte' was not declared in this scope

y se colorea en el codigo de arriba en anaranjado esto.
printByte(transmitByte);

en la ventana de consola la negra dice esto:

In function 'void transmitDigitalInput(byte)':
error: 'printByte' was not declared in this scope In function 'void loop()':

Link de captura de fondo.
http://www.miguelmonroy.com.mx/temp/fondo.jpg
Link del codigo.
http://www.miguelmonroy.com.mx/temp/Pd_firmware



lo que no entiendo es donde poner el Serial.print(0x55,BYTE); ?

muchas gracias por sus ayudas y espero poder que alguien me ayude para asi distribuir esta ayuda a los otros compañeros un abrazo.

Gracias a una amiga pude solucionar esto.

un abrazo a la comunidad.

http://www.miguelmonroy.com.mx/temp/Pd_firmware.pde

espero les pueda servir.

alguien me puede explicar por que pasa ese problema?