wii motion and nunchuk :~

buenas, he podido hacer funcionar los dispositivos por separados,
pero juntos no he podido.ahi le dejos los codes.desde ya muchas gracias por su ayuda.

/////Code nunchuk

#include <Wire.h> // Necesario para trabajar con el bus I2C
#include <utility\twi.h> // Necesario para la constante CPU_FREQ
 
void setup()
{
  Serial.begin(9600); // Inicializamos el puerto serie a una velocidad baja para que se puedan ver los datos
  Wire.begin(); // Inicializamos la librería wire para trabajar con I2C
  TWBR = ((CPU_FREQ / 400000L) - 16) / 2; // Configuramos el I2C para el modo Fast (400Kb/s)
 
  // Inicializamos el nunchuk sin encriptación  
  Wire.beginTransmission(0x52);
  Wire.send(0xF0);
  Wire.send(0x55);
  Wire.endTransmission();
 
  Wire.beginTransmission(0x52);
  Wire.send(0xFB);
  Wire.send(0x00);
  Wire.endTransmission();
}
 
void loop ()
{
  uint8_t buffer[6];
 
  // Pedimos que se actualicen los datos 
  Wire.beginTransmission(0x52);
  Wire.send(0);
  Wire.endTransmission();
 
  // Recogemos y guardamos los datos
  Wire.requestFrom(0x52, 6);
  for(int indice = 0; indice < 6; indice++)
  {
    buffer[indice] = Wire.receive();
  }
 
  // Imprimimos los datos en el puerto serie
  //Serial.print("JX:");
  Serial.print(buffer[0], DEC);
 
  Serial.print(",");
  Serial.print(buffer[1], DEC);
 
  Serial.print(",");
  Serial.print((buffer[2] << 2) | ((buffer[5] & 0x0c) >> 2));
 
  Serial.print(",");
  Serial.print((buffer[3] << 2) | ((buffer[5] & 0x30) >> 4));
 
  Serial.print(",");
  Serial.print((buffer[4] << 2) | ((buffer[5] & 0xc0) >> 6));
 
  Serial.print(",");
  Serial.print((buffer[5] >> 1) & 1);
 
  Serial.print(",");
  Serial.println(buffer[5] & 1);
}
/// wii motion

#include <Wire.h>
byte data[6]; //six data bytes
int yaw, pitch, roll; //three axes
int yaw0, pitch0, roll0; //calibration zeroes

void wmpOn(){
Wire.beginTransmission(0x53); //WM+ starts out deactivated at address 0x53
Wire.send(0xfe); //send 0x04 to address 0xFE to activate WM+
Wire.send(0x04);
Wire.endTransmission(); //WM+ jumps to address 0x52 and is now active
}

void wmpSendZero(){
Wire.beginTransmission(0x52); //now at address 0x52
Wire.send(0x00); //send zero to signal we want info
Wire.endTransmission();
}

void calibrateZeroes(){
for (int i=0;i<10;i++){
wmpSendZero();
Wire.requestFrom(0x52,6);
for (int i=0;i<6;i++){
data[i]=Wire.receive();
}
yaw0+=(((data[3]>>2)<<8)+data[0])/10; //average 10 readings
pitch0+=(((data[4]>>2)<<8)+data[1])/10;
roll0+=(((data[5]>>2)<<8)+data[2])/10;
}
Serial.print("Yaw0:");
Serial.print(yaw0);
Serial.print(" Pitch0:");
Serial.print(pitch0);
Serial.print(" Roll0:");
Serial.println(roll0);
}

void receiveData(){
wmpSendZero(); //send zero before each request (same as nunchuck)
Wire.requestFrom(0x52,6); //request the six bytes from the WM+
for (int i=0;i<6;i++){
data[i]=Wire.receive();
}
yaw=((data[3]>>2)<<8)+data[0]-yaw0;
pitch=((data[4]>>2)<<8)+data[1]-pitch0;
roll=((data[5]>>2)<<8)+data[2]-roll0;
}
//see http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Wii_Motion_Plus
//for info on what each byte represents
void setup(){
Serial.begin(115200);
Serial.println("WM+ tester");
Wire.begin();
wmpOn(); //turn WM+ on
calibrateZeroes(); //calibrate zeroes
delay(1000);
}

void loop(){
receiveData(); //receive data and calculate yaw pitch and roll
Serial.print("yaw:");//see diagram on randomhacksofboredom.blogspot.com
Serial.print(yaw); //for info on which axis is which
Serial.print(" pitch:");
Serial.print(pitch);
Serial.print(" roll:");
Serial.println(roll);
delay(100);
}

Me encontre con este codigo para hacerlo funcionar juntos , pero la verdad que no me tira nada.

//Code for Arduino based communication with Wii Motion Plus and Nunchuck. 
//Nunchuck is plugged into WM+ extension port so it DOES NOT require
//additional expansion board. 
//Code, discussion, links, and references at:
//http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248889032/0
//influenced this code, primarily contributions by
//Knuckles904, Ed Simmons, Adrian Carter, and duckhead
//Additionally, information at 
//http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Wii_Motion_Plus
//was very helpful.
//This code provides bases and/or example for more specific implementations

// Created by automatik (auto11)
// http://voidbot.net

//code and set up instructions at:
//http://voidbot.net/nunchchuk-and-wii-motion-plus-6-DOF.html

#include <Wire.h>

//Nunchuck
uint8_t outbuf[6];           //nunchuck buffer for data
int cnt = 0;                 //nunchuck buffer counter

//Wii Motion Plus
byte data[6];                //buffer for WM+ data
int yaw, pitch, roll;        //three gyroscope axes
int yaw0, pitch0, roll0;     //calibration zeroes
boolean yaw_v, pitch_v, roll_v; //calibration zeroes

void setup ()
{
  Serial.begin (115200);
  Wire.begin();             // join i2c bus as a master
  delay(100);

//instead of averaging data , I used data
//based on experiments from my particular WM+
  yaw0=8163;
  pitch0=7859;
  roll0=8536;
}

void loop ()
{
// Data communciation is sensative hence
// bunch of timed delays. These are just
// what works on my setup so YMMV. If you
// think data is incorect increase vakues 
// for delays.

wmpActive();                 //  activate WM+
  delay(50);
extPort();                   //write 0x00 to 0x(4)A400fb
  delay(180); 
  send_zero();
DataFlush();
  delay(30);
  send_zero();
wmpRead();                   // read WM+ data ( gyro )
wmpDeact();                  // deactivate WMP
  delay(50);
  send_zero();
  delay(70);
nunchuckRead(); // read Nunchuck data ( accelerometer data and buttons )

//  delay(250);

//Serial.println("===============================================");
}

//common

//Request data
void send_zero ()
{
  Wire.beginTransmission (0x52); 
  Wire.send (0x00);		 // send zero
  Wire.endTransmission ();	 
}

void DataFlush() 
{
  int h=1;
  Wire.requestFrom(0x52,100);
  while (Wire.available())
  {
    Wire.receive();
    h++;
  }
}

//ext port
//write 0x00 to 0x(4)A400fb
void extPort()
{
 Wire.beginTransmission(0x52); 
 Wire.send(0xfb);
 Wire.send(0x00);
 Wire.endTransmission();
}

//Nunchuck

void nunchuckRead() 
{
  Wire.requestFrom (0x52, 6);	// request data from nunchuck
  while (Wire.available ())
    {
      outbuf[cnt] = Wire.receive ();	// receive nunchuck data
      cnt++;
    }

    send_zero (); // send the request for next bytes
    
    // If we recieved the 6 bytes, then print them 
    if (cnt >= 5)
    {
	nunchuckAssembData();
    }
    cnt = 0; //(NunChuck)
}


// Assemble and print the input data we have recieved
// accel data is 10 bits long
// so we read 8 bits, then we have to add
// on the last 2 bits.  That is why I
// multiply them by 2 * 2
void nunchuckAssembData()
{
  int joy_x_axis = outbuf[0];
  int joy_y_axis = outbuf[1];
  int accel_x_axis = outbuf[2] * 2 * 2; 
  int accel_y_axis = outbuf[3] * 2 * 2;
  int accel_z_axis = outbuf[4] * 2 * 2;

  int z_button = 0;
  int c_button = 0;

 // byte outbuf[5] contains bits for z and c buttons
 // it also contains the least significant bits for the accelerometer data
 // so we have to check each bit of byte outbuf[5]
  if ((outbuf[5] >> 0) & 1)
    {
      z_button = 1;
    }
  if ((outbuf[5] >> 1) & 1)
    {
      c_button = 1;
    }

  if ((outbuf[5] >> 2) & 1)
    {
      accel_x_axis += 2;
    }
  if ((outbuf[5] >> 3) & 1)
    {
      accel_x_axis += 1;
    }

  if ((outbuf[5] >> 4) & 1)
    {
      accel_y_axis += 2;
    }
  if ((outbuf[5] >> 5) & 1)
    {
      accel_y_axis += 1;
    }

  if ((outbuf[5] >> 6) & 1)
    {
      accel_z_axis += 2;
    }
  if ((outbuf[5] >> 7) & 1)
    {
      accel_z_axis += 1;
    }

//Print Nunchuck Data
/*
  Serial.print (joy_x_axis, DEC);
  Serial.print ("\t");

  Serial.print (joy_y_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_x_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_y_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_z_axis, DEC);
  Serial.print ("\t");

  Serial.print (z_button, DEC);
  Serial.print ("\t");

  Serial.print (c_button, DEC);
  Serial.print ("\t");

  Serial.print ("\r\n");
*/
      //A ENVOYER AU PORT SERIE
      Serial.print("|acc=");
      Serial.print(accel_x_axis, DEC);
      Serial.print(",");
      Serial.print(accel_y_axis, DEC);
      Serial.print(",");
      Serial.print(accel_z_axis, DEC);
      Serial.print("|but=");
      Serial.print(z_button, DEC);
      Serial.print(",");
      Serial.print(c_button, DEC);
      Serial.print("|joy:");
      Serial.print(joy_x_axis,DEC);
      Serial.print(",");
      Serial.println(joy_y_axis, DEC);
}


//Wii Motion Plus

//Activate Wii Motion Plus
void wmpActive(){
  Wire.beginTransmission(0x53);
  Wire.send(0xfe); 
  Wire.send(0x04);
  Wire.endTransmission(); 
}

//Deactivate Wii Motion Plus
void wmpDeact(){
 Wire.beginTransmission(0x52); 
 Wire.send(0xf0);
 Wire.send(0x55);
 Wire.endTransmission();
}


void wmpRead()
{
  Wire.requestFrom(0x52,6); //request data from WM+
  for (int i=0;i<6;i++)
  {
    data[i]=Wire.receive();
  }
  wmpAssembData (); //assemble WM+ data
}

//assemble Wii Motion Plus data bits
//and get difference from averge values
void wmpAssembData () 
{
yaw=((data[3]>>2)<<8)+data[0];//-yaw0;
roll=((data[4]>>2)<<8)+data[1];//-roll0;
pitch=((data[5]>>2)<<8)+data[2];//-pitch0;


// get difference from avg values
// comment this out if you want to
// get raw data values
//yaw -= yaw0;
//roll -= roll0;
//pitch -= pitch0;

//scaling  mode data
yaw_v = data[3] & 2;
roll_v = data[4] & 2;
pitch_v = data[3] & 1;

// print WM+ data  
wmpPrintData (); 
}

// print Wii Motion Plus data
void wmpPrintData () 
{
/*
Serial.print("yaw:");
Serial.print(yaw); 
Serial.print("\t");
Serial.print("pitch:");
Serial.print(pitch);
Serial.print("\t");
Serial.print("roll:");
Serial.println(roll);

Serial.print("yaw_v:");
Serial.print(yaw_v);
Serial.print("\t");
Serial.print("pitch_v:");
Serial.print(pitch_v);
Serial.print("\t");
Serial.print("roll_v:");
Serial.println(roll_v);
*/
      //A ENVOYER AU PORT SERIE
      Serial.print("Yaw,pitch,roll=");
      Serial.print(yaw); 
      Serial.print(",");
      Serial.print(pitch); 
      Serial.print(",");
      Serial.print(roll); 
}

creo que el problema esta en la velocidad ""I2C para el modo Fast (400Kb/s)"", igualmente he probado a dostintas veloccidad, pero no me tira nada. solo puros ceros. :astonished:

:~

Si el código está mas que probado lo que debes tener mal es el montaje.

Conectas el nunchuk al motion ? o conectas ambos al mismo bus ?

el problema que tienes probablemente sea de montaje

un saludo

s, lo tengo conectado el nunchuk al motion.

con este codigo me funciona, pero no lo entiendo, esta
muy abanzado el codigo. es por eso que lo quiero el de arriba.
ahi le lo dejo haber si alguien lo decodifica y ve que le estaria faltado el de arriba.gracias!!

http://code.google.com/p/multiwii/source/browse/tags/MultiWiiV1_0/MultiWiiV1_0.pde?spec=svn18&r=18

Alex,

parece que hemos cometido algun tipo de error en las respuestas a mensajes en el foro. He eliminado los tres ultimos mensajes de este hilo para evitar confusiones. Si hay alguna cuestion referente a dichos mensajes, solo hazmelo saber: d.cuartielles [at] arduino [punto] cc

Si te ha causado algun tipo de problema, lo siento,

/d

David no se si alguien se habrá confundido pero AlexRodriguez deja de subir el hilo con poniendo post de caritas llorando cada pocos días (cuando te llamaron la atención desaparecieron esos post) porque nadie te responde.

Ten en cuenta que si la gente no te responde es por 2 motivos:

  • No sabe la respuesta, pero aunque no se sepa la respuesta se suele dar una orientación.
  • Lo que se pide chirria. Me parece que este es tu caso.

Comentas que el código que tu tienes lo entiendes pero que no te funciona. Comentas que tienes otro código que si te funciona pero que no lo entiendes. Pides que alguien "descodifique" el código que te funciona pero no entiendes, para que te digan que te falla del código que no funciona que pusiste arriba. En mi opinión es muy difícil que alguien te conteste puede que haya alguien muy aburrido pero parece poco probable. Te recomiendo que intentes "descodificar" el código que no entiendes y que preguntes lo que no entiendas, así te requerirá un poco de trabajo a ti pero seguro que habrá gente dispuesta a echarte una mano. Salu2

buenas,hise un poco la tarea, pero aun estoy algo desconcertado con la sinbologia que usa el autor.
he modificado el codigo del MultiWiiCopter, para que solo me tire los datos del
los sensores, lo que no he podido que me tire el estado de los botones del wii nunchuk(siempre me tira cero), debo estar
apuntando hacia otra direccion, alguna idea ?

#define LEDPIN 13
#define POWERPIN 12



// alias for RC
#define ROLL 0
#define PITCH 1
#define YAW 2
#define THROTTLE 3
#define AUX1 4




// **************
// Wii Motion Plus I2C & gyro+nunchuk functions
// **************


static int16_t gyroADC[3];
static int16_t accADC[3];
static uint8_t rawADC[6];

static int16_t angle[2]; //absolute angle inclination in Deg

// Mask prescaler bits : only 5 bits of TWSR defines the status of each I2C request
#define TW_STATUS_MASK	(_BV(TWS7)|_BV(TWS6)|_BV(TWS5)|_BV(TWS4)|_BV(TWS3))
#define TW_STATUS       (TWSR & TW_STATUS_MASK)

void i2c_init(void) {
  PORTC |= 1<<4; // activate internal pull-ups PIN A4 for twi
  PORTC |= 1<<5; // activate internal pull-ups PIN A5 for twi
  TWSR = 0;        // no prescaler => prescaler = 1
  TWBR = ((16000000L / 400000L) - 16) / 2; // change the I2C clock rate
  TWCR = 1<<TWEN;  // enable twi module, no interrupt
}

void i2c_rep_start(uint8_t address) {
  TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) | (1<<TWSTO); // send REAPEAT START condition
  waitTransmissionI2C(); // wait until transmission completed
  checkStatusI2C(); // check value of TWI Status Register
  TWDR = address; // send device address
  TWCR = (1<<TWINT) | (1<<TWEN);
  waitTransmissionI2C(); // wail until transmission completed
  checkStatusI2C(); // check value of TWI Status Register
}

void i2c_write(uint8_t data ) {	
  TWDR = data; // send data to the previously addressed device
  TWCR = (1<<TWINT) | (1<<TWEN);
  waitTransmissionI2C(); // wait until transmission completed
  checkStatusI2C(); // check value of TWI Status Register
}

uint8_t i2c_readAck() {
  TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
  waitTransmissionI2C();
  return TWDR;
}

uint8_t i2c_readNak(void) {
  TWCR = (1<<TWINT) | (1<<TWEN);
  waitTransmissionI2C();
  return TWDR;
}

void waitTransmissionI2C() {
  uint8_t count = 255;
  while (count-->0 && !(TWCR & (1<<TWINT)) );
  if (count<2) { //we are in a blocking state => we don't insist
    TWCR = 0;  //and we force a reset on TWINT register
    
  }
}

void checkStatusI2C() {
  if ( (TW_STATUS & 0xF8) == 0xF8) { //TW_NO_INFO : this I2C error status indicates a wrong I2C communication.
    // WMP does not respond anymore => we do a hard reset. I did not find another way to solve it. It takes only 13ms to reset and init to WMP or WMP+NK
    TWCR = 0;
    digitalWrite(POWERPIN,0);
    delay(1);  
    digitalWrite(POWERPIN,1);
    delay(10);  
    i2c_rep_start(0xA6);
    i2c_write(0xF0);
    i2c_write(0x55);
    i2c_rep_start(0xA6);
    i2c_write(0xFE);
    i2c_write(0x05);
    
  }
}

void initI2C(void) {
  i2c_init();
  delay(250);
  i2c_rep_start(0xA6 + 0);//write direction => 0
  i2c_write(0xF0); 
  i2c_write(0x55); 
  delay(250);
  i2c_rep_start(0xA6 + 0);//write direction => 0
  i2c_write(0xFE); 
  i2c_write(0x05); 
  delay(250);
}

void getI2C() {
  i2c_rep_start(0xA4 + 0);//write direction => 0
  i2c_write(0x00);
  i2c_rep_start(0xA4 + 1);//read direction => 1
  for(uint8_t i = 0; i < 5; i++) {
    rawADC[i]=i2c_readAck();}
  rawADC[5]= i2c_readNak();
}

uint8_t rawIMU () {
  getI2C();
  if ( rawADC[5]&0x02 ) {// motion plus data
    gyroADC[PITCH]  = - (((rawADC[4]>>2)<<8) + rawADC[1]);
    gyroADC[ROLL]   = - (((rawADC[5]>>2)<<8) + rawADC[2]);
    gyroADC[YAW]    = - (((rawADC[3]>>2)<<8) + rawADC[0])>>3;
    
    Serial.print( gyroADC[PITCH]);
     Serial.print("  ");
     Serial.print(gyroADC[ROLL]);
     Serial.print("  ");
      Serial.print(gyroADC[YAW] );
      Serial.print("  ");
    return 1;
  } else { //nunchuk data
    accADC[PITCH] = (rawADC[2]<<2) - ((rawADC[5]>>3)&0x2);   // -
    accADC[ROLL]  =  (rawADC[3]<<2) + ((rawADC[5]>>4)&0x2);
    accADC[YAW]   = ((rawADC[4]&0xFE)<<2) - ((rawADC[5]>>5)&0x6); // -
    Serial.print(  rawADC[0],DEC);
    Serial.print("  ");
    Serial.print(  rawADC[1],DEC);
    Serial.print("  ");
     Serial.print( accADC[PITCH] );
     Serial.print("  ");
      Serial.print( accADC[ROLL]);
      Serial.print("  ");
       Serial.print(accADC[YAW]);
       Serial.print("  ");
      Serial.print((rawADC[5] >> 1) & 1 );
      Serial.print("  ");
      Serial.println((rawADC[5] & 1));
    return 0;
  }
}

void setup() {
 Serial.begin (115200);

 initI2C();
 rawIMU ();

}

void loop() {
  
  
  rawIMU ();
  delay(20);
  
}

me refiero en esta parte:

} else { //nunchuk data
accADC[PITCH] = (rawADC[2]<<2) - ((rawADC[5]>>3)&0x2); // -
accADC[ROLL] = (rawADC[3]<<2) + ((rawADC[5]>>4)&0x2);
accADC[YAW] = ((rawADC[4]&0xFE)<<2) - ((rawADC[5]>>5)&0x6); // -
Serial.print( rawADC[0],DEC);
Serial.print(" ");
Serial.print( rawADC[1],DEC);
Serial.print(" ");
Serial.print( accADC[PITCH] );
Serial.print(" ");
Serial.print( accADC[ROLL]);
Serial.print(" ");
Serial.print(accADC[YAW]);
Serial.print(" ");
Serial.print((rawADC[5] >> 1) & 1 );
Serial.print(" ");
Serial.println((rawADC[5] & 1));
return 0;
}

en cuanto dice ionhs: que mala onda y ensima apoya a la censura, aveces una cara puede decir que mil palabras. asi que le pido a Sr.David si me podria
dar Admin, asi lo baneo a ionhs, "me cae mal". ]:smiley:

el el código del multiwii no accede a los botones, no los usa para nada, así que imposible que te los escupa.

del nunchuk hay información a patadas, hasta en la wikipedia ... haz el favor de buscar un poco y no hacer perder tiempo a los demás

otro lado ...

http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/

te pregunte si tenias conectado uno al otro o los dios al mismo bus ... no se lee igual, si buscaras una miaja ...

por mi parte esta es la última respuesta que te doy, ( seguramente a partir de esta también te caeré mal)

resultas muy cansino
adiós

talves no se me entendio o mal interpreto, asi que hablare fuerte y mas despacio.

En primera instacia lo que le dije a ionhs, fue con humor, ni para que lo tome mal.aparte
usted que es su mama q responde por el ?

por otro lado es obio que he buscado info en la wed, "esta el cansancio", y caigo a estos foros
para que me oriente en el resultado deceado.
"hacer perder el tiempo", a que se refiere?? si quiere contesteme,me da igual. entonces para que entra usted, sino es para ayudarnos
mutuamente?? o usted se capta de sabelotodo??,.

si huhbiera leido un poco lo que cite, en ves de "bardiame", me habria entendido. lo que dije fue que modifique el codigo multiwii
para que me tire los datos de los sensores. por ejemplo los potenciometros
del wii nunchuk, no esta en el codigo del multiwii, pero ahora me tira los datos, lo que falta ahota es la botonera.

si , lo tengo conectado en uno al otro los sensores.talves me exprese mal de esta manera los tengo concectado

y si, me cae mal "SrDonGato" ]:smiley:

nota:me cae mal "SrDonGato" ]:D-------lo dije con humor

Hola AlexRodriguez.

He intercedido por tí y comunicado a David Cuartielles que debía tratarse de un error los tres post que han sido eliminados. Puesto que parecían referirse a algo que realmente no ha acontencido.
Realmente si ha ocurrido.

Estos foros están para compartir y ayudar. Todos compartimos incluso cuando tenemos un problema ¿Cómo? Indicando la mayor cantidad de información sobre el problema y de una forma lo más clara y concisa posible.
Toda la información que hay en las respuestas a un problema serán compartidas para siempre. Y éstas serán consultadas posteriormente por personas que tengan un problema similar.

Más claro no te lo ha podido explicar ionhs y SrDonGato.

No debes enviar 'posts' sin contenido. Un montón de caritas no son contenido.
No puedes exigir una respuesta porque puede que no sea conocida.
No presupongas que la gente conoce la respuesta a tu problema y no quiere dártela. Aunque fuera así, reprochárselo no solucionará tu problema.
Debes ofrecer la mayor cantidad de información posible sobre tu problema y de la forma más clara y concisa posible. Es el modo más efectivo de conseguir respuestas. Válidas o no.
Es beneficioso el buen ambiente en los foros. Pero si escribes en clave de humor, y alguien insinúa, o te hace ver, que no lo ha entendido así, es mejor que no sigas en esa línea.

Revisa y medita sobre lo que te he escrito. AlexRodríguez, considéralo como una advertencia.

Nos vemos en el foro.

Saludos.

Moderador (ºLe

saben lo paradogico de esto? q nunca obtube una respuesta a mi problema,
lo unico fue, bardiame, censurame y oponiendo a la gente que de una respuesta.
asi es, una especie de efecto domino.como dice la princesita de Sr.gato y teniendo
la mayoria de los votos "ni aparesca poq no te voy a ayudar", y digo mayoria de los voto
poq como casique mayor arrastra a la gente que me responda a mi dudas.
Ni modo, no tiene sentido seguir en e foro, ya que no obtendre respuestas.

ahi dejo mi trabajo para quien lo decee, y digo mi trabajo poque me tube que poner a buscar y modificar el code :

aqui tienes un link interesante....

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248889032/all

claro que quizás sea mucho pedir que sepas inglés cuando no sabes escribir castellano.