This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Friday, December 21, 2007

[oopic] Re: New to OOPIC Event Programming..pls help..

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> The oEvent object only triggers on a low-to-high transition, so
toggle
> isn't what I would use for the button. Try one that just acts like
a
> momentary contact. When you trigger the event you turn on the
sound,
> but you never turn it off, that isn't likely to do anything useful
> either, you should just "blip" it in the event handler. Another
idea is
> to set e.Operate = 0 initially to make sure of its initial state.
>
> DLC
>
> aravind_2917 wrote:
>
> >hello,
> >Am new to microcontrollers..i have got an oopic R board with c1.1+
> >firmware.
> >Am trying to write an event driven program. I want speaker to make
a
> >sound when a button is pressed...this is what i tried:
> >
> >1. oEvent e=New oEvent;
> >2. oButton b=New oButton;
> >3. oWire w=New oWire;
> >4. oSpeaker sp=New oSpeaker;
> >5.
> >6. Void main(Void){
> >7. b.IOLine=7;//button already on OOPIC-R
> >8. b.Mode=1; //toggle mode
> >9. w.Input.Link(b.Position);
> >10. w.Output.Link(e.Operate);
> >11. w.Operate=cvTrue;
> >12. }
> >13. Void e_Code(Void){
> >14. sp.Operate=1;
> >15. }
> >
> >There's no compile error,but,Its not working..
> >but when i change line 10 to "w.Input.Link(sp.Operate)" its working
> >what's wrong ? pls help me..!
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------

Okay ive tried it but no use...can you please give me the program...i
just want to check whether events are working or not..i dont have any
external hardware...i only have oopic-r board...leds and push buttons
on IOLines 5 6 and 7...i have to show somebody how events work...



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: