Hello,

You can use a two dimensional array:
uint32_t matrix[10][10]

Then you can write a small function to display it.
Regards

-  
Sylvain Pelissier


On Mon, 2010-02-15 at 22:56 +0000, Oussama Ghorbel wrote:
> Hello,
> 
> 
> i used the TestSerial application in Tinyos2.x to display data from
> mote on my pc.
> i could send a sequence of numbers ,now i want to fill numbers in a
> matrix then display all the values on my pc.
> i just want to know how and where define a matrix in nesC and how to
> use it  to display its values on my pc?
> 
> 
> Regards,
> 
> 
> this is a peace of code:
> 
> 
> implementation {
> 
> 
>   uint8_t  tb[4][4];
>   message_t packet;
>   bool locked = FALSE;
>   uint16_t counter = 0;
>   tb[0][0]=2;
>   tb[0][1]=4;
>   tb[0][2]=6;
>   tb[0][3]=8;
>   tb[1][0]=10;
>   tb[1][1]=12;
>   tb[1][2]=14;
>   tb[1][3]=16;
>   tb[2][0]=18;
>   tb[2][1]=20;
>   tb[2][2]=22;
>   tb[2][3]=24;
>   tb[3][0]=26;
>   tb[3][1]=28;
>   tb[3][2]=30;
>   tb[3][3]=32;
>   event void Boot.booted() {
>     call Control.start();
> 
>   }
>   
>   event void MilliTimer.fired() {
>     counter++;
>     if (locked) {
>       return;
>     }
>     else {
>       test_serial_msg_t* rcm = (test_serial_msg_t*)call
> Packet.getPayload(&packet, sizeof(test_serial_msg_t));
>       if (rcm == NULL) {return;}
>       if (call Packet.maxPayloadLength() < sizeof(test_serial_msg_t))
> {
> return;
>       }
>       
>       rcm->counter = counter;
>  rcm->tb[0][0] = tb[0][0];
>  rcm->tb[0][1] = tb[0][1];
>  rcm->tb[0][2] = tb[0][2];
>  rcm->tb[0][3] = tb[0][3];
>  rcm->tb[1][0] = tb[1][0];
>  rcm->tb[1][1] = tb[1][1];
>  rcm->tb[1][2] = tb[1][2];
>  rcm->tb[1][3] = tb[1][3];
>  rcm->tb[2][0] = tb[2][0];
>  rcm->tb[2][1] = tb[2][1];
>  rcm->tb[2][2] = tb[2][2];
>  rcm->tb[2][3] = tb[2][3];
>  rcm->tb[3][0] = tb[3][0];
>  rcm->tb[3][1] = tb[3][1];
>  rcm->tb[3][2] = tb[3][2];
>  rcm->tb[3][3] = tb[3][3];
>       if (call AMSend.send(AM_BROADCAST_ADDR, &packet,
> sizeof(test_serial_msg_t)) == SUCCESS) {
> locked = TRUE;
>       }
>     }
>   }
> 
> 
> 
> 
> please help me.........
> 
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to