Monday, January 7, 2008

Re: [oopic] Problem with events.

Adding to what Richard notes: you have to declare objects globally,
check out the oEvent[x] manual pages. An event will ONLY trigger when
the .Operate line moves from logic 'low' to logic 'high'. It will not
re-trigger until it is moved low and then high again. You don't say how
you have wired your inputs so I don't know what your values are going to
be. If you are using a button in the usual way then it will be normally
logic high and go low when the button is pressed. This means that the
oWire.invertout will need to be set to cvTrue to reverse the logic of
that signal.

DLC

aravind_2917 wrote:
> 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
>
>
>
>

--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------


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