mySerial functions (HELP!)


hi. i've 2 arduinos (nano , leonardo) connected myserial. here code first 1 (sends values). values read wire , stored in variable c[x]. "c" has position 0 9 10 positions. each c[x] position byte (stores numbers 0 255). then, variable c sent second arduino using myserial.


code: [select]
void loop() {
wire.requestfrom(4,10); //recibir informacion del controlador
while(wire.available()){
     for(i=0;i<=9;i++){
     c[i] = wire.read(); //guardar lectura en variable c
     serial.println(c[i],dec); //mostrar lectura en monitor serial (a decimal)
     }}            
serial.print("\n");
myserial.write(c,10);
}



the code of second 1 following:

code: [select]
void loop(){

if(myserial.available()){
numero=myserial.read();
 serial.println("recibo");
 serial.println(numero);
 }  
 }


i receive correctly values of variable "numero" want values in c[2],c[3],c[4],c[5] first arduino. how can store positions?

now edit post rid of italics, please


Arduino Forum > Using Arduino > Programming Questions > mySerial functions (HELP!)


arduino

Comments