LedsC doesn't automatically initialize. You have to call LedsC.init() from
StdControl.init() first.

On Mon, July 2, 2007 11:40 am, mai naaom said:
> hi
> i  wrote a code to receive packets from the serial port and set the received
> data on the leds i used the hyper terminal to send the data  on it ,this
> code doesnt work
> this the code
> WHAT is wrong?
>
> #include "SerialB.h"
>
> module SerialBC {
>   uses interface Boot;
>   uses interface Leds;
>   uses interface Packet;
>   uses  interface AMPacket;
>   uses interface Receive;
>   uses interface SplitControl as serialcontrol;
>   }
> implementation {
>
>
>   message_t pkt;
>   bool busy = FALSE;
>   uint16_t data;
>
>
>
>   event void Boot.booted() {
>     call serialcontrol.start();
>   }
>
>   event void serialcontrol.startDone(error_t err) {
>     if (err == SUCCESS) {
>           }
>     else {
>       call serialcontrol.start();
>     }
>   }
>
>   event void serialcontrol.stopDone(error_t err) {
>   }
>
>
>
>
>
>   event message_t* Receive.receive(message_t* msg, void* payload, uint8_t
> len){
>     if (len == sizeof(serialmsg)) {
>       serialmsg* btrpkt = (serialmsg*)payload;
>      call Leds.set(btrpkt->data);
>     }
>
>     return msg;
>   }
> }
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


-- 
The difference between the right word and the almost right word is really a
large matter- it's the difference between a lightning bug and the lightning.
-Twain

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

Reply via email to