Monday, January 7, 2008

[oopic] Problem with events.

Iam trying to execute a piece of code whever serial data is recieved
over the Serial port...I have oopic-R c.1.1+ firmware...till now i
have not been successful with any event driven program..can u please
tell me whats wrong with the following code...

Delay=2000;
oEvent ev=New oEvent;
oSerialPort sp=New oSerialPort;
Void main(Void){
Delay=2000;

oLED l=New oLED;
oWire w=New oWire;
oWire w2=New oWire;


ev.Operate=0 // initially to make sure ev.operate=0
l.IOLine=5;
sp.Operate=1;

w.Input.Link(sp.Received);
w.Output.Link(l.Operate);//trying to switch on an in built led
w.Operate=cvTrue;

w2.Input.Link(sp.Received);
w2.Output1.Link(ev.Operate);
w2.Operate=cvTrue;

}

Void ev_Code(){ //this code is not being executed
oLED l3=New oLED;
l3.IOLine=7;
l3.TurnOn;
oInt i=New oInt;
While(sp.Received!=0){ //trying to read from sp buffer
i=sp.Value; //till sp.recieved is set to 0.
}
}

someone give me a code with which i can test whether events are
working on my board...OOPIC-R c.1.1+

Thank you


Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments:

Post a Comment