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
<*> 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:
No comments:
Post a Comment