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.

Sunday, April 27, 2008

[oopic] Re: general trouble shoot question

Well, the double &'s didn't work. I'm going to have to try something
else. It's very odd. For a minute I thought it was working as the
motor stopped when the sensors hit a gap(s) but it turned out it was
simply a coincindence due to the delays and the motor just happened to
stop at the right place a few times in a row. I thank you again for
your suggestions though!
Darrell


--- In oopic@yahoogroups.com, "Darrell" <videogrfx@...> wrote:
>
> Thanks Richard. I'll give it a go.
> Darrell
>
>
> --- In oopic@yahoogroups.com, "rtstofer" <rstofer@> wrote:
> >
> > --- In oopic@yahoogroups.com, "Darrell" <videogrfx@> wrote:
> > >
> > > I've added longer delays but the sensors are still being
ignored. Any
> > > other suggestions anyone?
> >
> > Maybe the & operator should be &&.
> >
> > Richard
> >
> >
> > >
> > > /* Bubble Code */
> > >
> > > oDCMotor bubble_motor = New oDCMotor;
> > >
> > > oDIO1 bubble_fc_sensor1 = New oDIO1;
> > > oDIO1 bubble_fc_sensor2 = New oDIO1;
> > >
> > > Byte bubble_speed;
> > > Byte bubble_stop_time;
> > >
> > > Sub Void Main(Void)
> > > {
> > > bubble_speed = 255;
> > > bubble_stop_time = 400;
> > >
> > > initialize;
> > >
> > > While(1)
> > > {
> > > If((bubble_fc_sensor1 == cvOn) & (bubble_fc_sensor2 == cvOn))
> > > {
> > > bubble_motor.Value = bubble_speed;
> > > bubble_motor.Brake = cvOn;
> > > ooPIC.Delay = 3000;
> > > bubble_motor.Brake = cvOff;
> > > ooPIC.Delay = 5000;
> > > }
> > > } }
> > >
> > > Sub Void initialize(Void)
> > > {
> > > ooPIC.Node = 3;
> > > bubble_motor.IOLineP = 18;
> > > bubble_motor.IOLineB = 24;
> > > bubble_motor.IOLineD = 26;
> > > bubble_motor.Operate = 1;
> > > bubble_motor.Direction = 1;
> > > bubble_motor.Unsigned = 1;
> > > bubble_motor.Value = bubble_speed;
> > > bubble_motor.PreScale = 3;
> > > bubble_motor.Brake = cvOff;
> > >
> > > bubble_fc_sensor1.IOLine = 12;
> > > bubble_fc_sensor1.Direction = cvInput;
> > > bubble_fc_sensor2.IOLine = 13;
> > > bubble_fc_sensor2.Direction = cvInput;
> > > }
> > >
> >
>

------------------------------------

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: