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.

Thursday, August 14, 2008

[oopic] Digest Number 3910

There are 6 messages in this issue.

Topics in this digest:

1a. Re: Need help--oIRRange Object
From: Bob Hedges
1b. Re: Need help--oIRRange Object
From: shubo zhang

2a. Serial Control Protocol
From: shubo zhang
2b. Re: Serial Control Protocol
From: Ian Drennan
2c. Re: Serial Control Protocol
From: Dave Warner
2d. Re: Serial Control Protocol
From: Andrew Porrett


Messages
________________________________________________________________________
1a. Re: Need help--oIRRange Object
Posted by: "Bob Hedges" bhmtr@mindspring.com bobhedges9
Date: Wed Aug 13, 2008 5:20 am ((PDT))

The subroutine Setup is never called.

--- In oopic@yahoogroups.com, shubo zhang <shubozhang@...> wrote:
>
> Hey, I try to use oIRRange Object(sharp GP2D12) to achieve obstacle
avoidence.But it fails to read value from the sensor. I follow the
oIRRange Object instruction and connect sensor to board. The code is
blow. Please help me out. Thank you very much !
>  
>
> oServo S1 = New oServo;   // Make a servo object.
> oServo S2 = New oServo;   // Make a servo object.
>
> oByte x = New oByte;      // Make an 8-bit variable.
>
> oIRRange I=New oIRRange;
> oDIO8 P=New oDIO8;
>
> Sub Void main(Void)
> {
>      S1 = 28;
>      S2=28;
>      x=1;
>     
>      I.IOLine=3;
>      I.Operate=1;
>      I.Adjust=8;
>      P.IOGroup=1;
>      P.Direction=cvOutput;
>   Do
>   {
>      
>      S1 = 20;
>      S2 = 20;
>      
>      ooPIC.Delay = 50;
>      S1= 40;
>      S2=40;
>       x++
>      
>      P.Value=I.Value;
>     
>      If(P>=64)                \\ I think there is something wrong at
this place.
>      {x=11;}
>   } While (x<=10); 
>         x=1;
>  
>   Do
>   {
>      ooPIC.Delay = 50;
>      S1 = 40;
>      S2=40;
>     ooPIC.Delay = 50;
>      S1 = 28;
>      S2=28;
>       x++    
>   } While (x<=5);
> }
>
> Sub Void Setup(Void)
> {
>   //--Set up the first servo--
>   S1.IOLine = 31;      //Set the servo to use I/O Line 31.
>   S1.Center = 28;      //Set the servos center to 28. (see manual)
>   S1.Operate = cvTrue;
>   //--Set up the second servo--
>  
>   S2.IOLine = 30;      //Set the servo to use I/O Line 30.
>   S2.Center = 28;      //Set the servos center to 28. (see manual)
>   S2.Operate = cvTrue;   //Last thing to do, Turn the Servo on.
>  }
>
>
>
>
> [Non-text portions of this message have been removed]
>


Messages in this topic (3)
________________________________________________________________________
1b. Re: Need help--oIRRange Object
Posted by: "shubo zhang" shubozhang@yahoo.com shubozhang
Date: Wed Aug 13, 2008 7:21 am ((PDT))

Hey,
 
First, thank you for answering my question. Because the code is too long, so I did not copy completely. The code does work now. But I still have trouble in setting P.Value. Is P a binary result?  I just want to use IF selection to select P.Value. When the distance is less than 40cm, it will execute another part. Please help me to address this problem. Thank you very much !

#Code:
 
//--The robot will move forward. When it detects an obstacle, robot will move backward.--
//-----------------------------------------------------------------
oServo S1 = New oServo;   // Make a servo object.
oServo S2 = New oServo;   // Make a servo object.
oServo S3 = New oServo;
oServo S4 = New oServo;
oServo S5 = New oServo;
oServo S6 = New oServo;
oServo S7 = New oServo;
oServo S8 = New oServo;
oByte x = New oByte;      // Make an 8-bit variable.

oIRRange I=New oIRRange;
oDIO8 P=New oDIO8;
 
Sub Void main(Void)
{
  //--Go set up the servo object properties--
  Setup;
 
     S1 = 28;
     S3 = 28;
     S5 = 28;
     S7 = 28;
     S2 = 28;
     S4 = 28;
     S6 = 28;
     S8 = 28;
     x=1;
    
     I.IOLine=3;
     I.Operate=1;
     I.Adjust=8;
     P.IOGroup=1;
     P.Direction=cvOutput;
    
   //--forward-- 
 
  Do
  {
     //--Set the servos to 0% and then wait a while--
     S1 = 28;
     S5 = 20;
     S3 = 36;
     S7 = 28;
   
 
     ooPIC.Delay = 50;
     S3 = 40;
 
     ooPIC.Delay = 50; 
     S5 = 28;
     ooPIC.Delay = 50;
     S1 = 16;
     S7 = 16;
   
     ooPIC.Delay = 50; 
  
     S3 = 28;
    
     ooPIC.Delay = 50; 
     S5 = 40;
     ooPIC.Delay = 50; 
     S1 = 28;
     S7 = 28;
   
   
   
    ooPIC.Delay = 50;
     S3 = 16;
 
     ooPIC.Delay = 50; 
     S5 = 28;
     ooPIC.Delay = 50;
     S1 = 40;
     S7 = 40;
   
     ooPIC.Delay = 50; 
  
     S3 = 28;
    
     ooPIC.Delay = 50; 
     S5 = 16;
     ooPIC.Delay = 50; 
     S1 = 28;
     S3 = 20;
     S5 = 36;
     S7 = 28;
      x++
     
     P.Value=I.Value;     //--read sensor's value
    
     If(P>=120)
     {x=101;}
  } While (x<=100);
 
 
  ooPIC.Delay = 500;
     S1 = 28;
     S3 = 28;
     S5 = 28;
     S7 = 28;
     S2 = 28;
     S4 = 28;
     S6 = 28;
     S8 = 28;
      x=1;
     
     
//--Backward--
 
  Do
  {
    
     S1 = 28;
     S5 = 20;
     S3 = 36;
     S7 = 28;
   
 
     ooPIC.Delay = 50;
     S5 = 16;
 
     ooPIC.Delay = 50; 
     S3 = 28;
     ooPIC.Delay = 50;
     S1 = 40;
     S7 = 40;
   
     ooPIC.Delay = 50; 
  
     S5 = 28;
    
     ooPIC.Delay = 50; 
     S3 = 16;
     ooPIC.Delay = 50; 
     S1 = 28;
     S7 = 28;
   
   
   
    ooPIC.Delay = 50;
     S5 = 40;
 
     ooPIC.Delay = 50; 
     S3 = 28;
     ooPIC.Delay = 50;
     S1 = 16;
     S7 = 16;
   
     ooPIC.Delay = 50; 
  
     S5 = 28;
    
     ooPIC.Delay = 50; 
     S3 = 40;
     ooPIC.Delay = 50; 
     S1 = 28;
     S5 = 20;
     S3 = 36;
     S7 = 28;
  
     x++
   
    
  } While (x<=5);
 
  ooPIC.Delay = 500;
     S1 = 28;
     S3 = 28;
     S5 = 28;
     S7 = 28;
     S2 = 28;
     S4 = 28;
     S6 = 28;
     S8 = 28;
}
//-----------------------------------------------------------------
//  A routine that sets up our servo properties
//-----------------------------------------------------------------
Sub Void Setup(Void)
{
  //--Set up the first servo--
  S1.IOLine = 31;      //Set the servo to use I/O Line 31.
  S1.Center = 28;      //Set the servos center to 28.
  S1.Operate = cvTrue;
  //--Set up the second servo--
 
  S2.IOLine = 30;      //Set the servo to use I/O Line 30.
  S2.Center = 28;      //Set the servos center to 28. 
  S2.Operate = cvTrue;   //Last thing to do, Turn the Servo on.

  S3.IOLine = 29;      //Set the servo to use I/O Line 29.
  S3.Center = 28;      //Set the servos center to 28.
 
  S3.Operate = cvTrue; //Last thing to do, Turn the Servo on.

  S4.IOLine = 28;      //Set the servo to use I/O Line 28.
  S4.Center = 28;      //Set the servos center to 28.
  S4.Operate = cvTrue; //Last thing to do, Turn the Servo on.
  S5.IOLine = 15;      //Set the servo to use I/O Line 15.
  S5.Center = 28;      //Set the servos center to 28.
  
  S5.Operate = cvTrue; //Last thing to do, Turn the Servo on.
 
  S6.IOLine = 14;      //Set the servo to use I/O Line 14.
  S6.Center = 28;      //Set the servos center to 28.
  S6.Operate = cvTrue; //Last thing to do, Turn the Servo on.
 
  S7.IOLine = 13;      //Set the servo to use I/O Line 13.
  S7.Center = 28;      //Set the servos center to 28.
 
  S7.Operate = cvTrue; //Last thing to do, Turn the Servo on.
 
  S8.IOLine = 12;      //Set the servo to use I/O Line 12.
  S8.Center = 28;      //Set the servos center to 28. 
  S8.Operate = cvTrue; //Last thing to do, Turn the Servo on.
  }


[Non-text portions of this message have been removed]

Messages in this topic (3)
________________________________________________________________________
________________________________________________________________________
2a. Serial Control Protocol
Posted by: "shubo zhang" shubozhang@yahoo.com shubozhang
Date: Wed Aug 13, 2008 12:56 pm ((PDT))

Hey,
 
My board is ooPIC-R (c.1.1.+). Can I control the board over the serial port ?
 
Thanks !
 


[Non-text portions of this message have been removed]

Messages in this topic (4)
________________________________________________________________________
2b. Re: Serial Control Protocol
Posted by: "Ian Drennan" ianid@sai.co.za iand242002
Date: Wed Aug 13, 2008 1:25 pm ((PDT))

shubo zhang wrote:
> Hey,
>
> My board is ooPIC-R (c.1.1.+). Can I control the board over the serial port ?
>
> Thanks !
>
>
>
>
>
>
Yes you can. SCP is also used to program your oopic using the Serial port.

Ian


Messages in this topic (4)
________________________________________________________________________
2c. Re: Serial Control Protocol
Posted by: "Dave Warner" BIMI_TYEDYE@HOTMAIL.COM bimi_tie_dye
Date: Wed Aug 13, 2008 2:31 pm ((PDT))


To what depth can we control the OOPIC? Please elaborate.
http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us

[Non-text portions of this message have been removed]

Messages in this topic (4)
________________________________________________________________________
2d. Re: Serial Control Protocol
Posted by: "Andrew Porrett" slicerwizard@gmail.com slicerwizard
Date: Wed Aug 13, 2008 11:34 pm ((PDT))

At 05:31 PM 8/13/2008, Dave Warner wrote:

>To what depth can we control the OOPIC? Please elaborate.

You can stop/start/reset your script code or completely reprogram
it. You can query or change the values of variables or objects. You
can load/retrieve data tables to/from the EEPROM. Or you can do the
usual stuff, which is to just have your OOPic code accept simple
commands from your PC. What you do depends on what you want/need to do.


...Andy


Messages in this topic (4)

------------------------------------------------------------------------
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Digest 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-normal@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/

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

Tuesday, August 12, 2008

[oopic] Need help--oIRRange Object

Hey, I try to use oIRRange Object(sharp GP2D12) to achieve obstacle avoidence.But it fails to read value from the sensor. I follow the oIRRange Object instruction and connect sensor to board. The code is blow. Please help me out. Thank you very much !
 

oServo S1 = New oServo;   // Make a servo object.
oServo S2 = New oServo;   // Make a servo object.

oByte x = New oByte;      // Make an 8-bit variable.

oIRRange I=New oIRRange;
oDIO8 P=New oDIO8;

Sub Void main(Void)
{
     S1 = 28;
     S2=28;
     x=1;
    
     I.IOLine=3;
     I.Operate=1;
     I.Adjust=8;
     P.IOGroup=1;
     P.Direction=cvOutput;
  Do
  {
     
     S1 = 20;
     S2 = 20;
     
     ooPIC.Delay = 50;
     S1= 40;
     S2=40;
      x++
     
     P.Value=I.Value;
    
     If(P>=64)                \\ I think there is something wrong at this place.
     {x=11;}
  } While (x<=10); 
        x=1;
 
  Do
  {
     ooPIC.Delay = 50;
     S1 = 40;
     S2=40;
    ooPIC.Delay = 50;
     S1 = 28;
     S2=28;
      x++    
  } While (x<=5);
}

Sub Void Setup(Void)
{
  //--Set up the first servo--
  S1.IOLine = 31;      //Set the servo to use I/O Line 31.
  S1.Center = 28;      //Set the servos center to 28. (see manual)
  S1.Operate = cvTrue;
  //--Set up the second servo--
 
  S2.IOLine = 30;      //Set the servo to use I/O Line 30.
  S2.Center = 28;      //Set the servos center to 28. (see manual)
  S2.Operate = cvTrue;   //Last thing to do, Turn the Servo on.
 }


[Non-text portions of this message have been removed]


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

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/

[oopic] About I2C coprocessors

Hey,
I am interested in I2C coprocessors.The ooPIC programmer's guide mentions I2C coprocessors in dynamic data exchange part. But the example can be fulfilled in single processor. I want to know what kind of application I have to use coprocessors or it has advantages to choose coprocessors.
 
Thanks ! Enjoy olympics games !


[Non-text portions of this message have been removed]


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

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/

RE: [oopic] Seeking OOPIC tutor - paid postion

Out of the hat, I would say Dennis. We don't know where he is now, but he's
REALLY a pro at OOPic; in fact he's the moderator and the one who answers
all of our questions here. Another person might be Richard. And if you
cant find anyone, just feel free to post all of your questions here.

___________________
Ray Xu
rayxu@tx.rr.com
DPRG <http://www.dprg.org> member
OOPic <http://tech.groups.yahoo.com/group/oopic/> group member
Seattle <http://tech.groups.yahoo.com/group/SeattleRobotics/> Robotics
group member
My Blog <http://rayxublogs.blogspot.com/>

-----Original Message-----
From: oopic@yahoogroups.com [mailto:oopic@yahoogroups.com] On Behalf Of Greg
Sent: Tuesday, August 12, 2008 6:49 AM
To: oopic@yahoogroups.com
Subject: [oopic] Seeking OOPIC tutor - paid postion

I am seeking an individual willing to instruct me online and by
telephone on OOPIC basics. This is a paid position, remuneration to
be agreed upon but $15 / hour would be a rough starting point.

The position would ideally be a retired person with good
communication skills who is fluent in the OOPIC language and has
broad electronic knowledge. Tutoring would be by telephone (phone
calls at my expense), and payment can be made by any number of
methods.

Interested individuals should be prepared to receive numerous
annoying phone calls from me, many of them brief but requiring
interruptions of your day. A fee structure to remunerate you for
those one minute annoying phone calls can also be agreed upon.

I have no previous OOPIC experience and am finding the starting
learning curve very steep. I have a background in electronics,
extensive experience with interpretive BASIC, some limited experience
in Object Oriented programming (Visual Basic), but ZERO experience
with OOPIC. I also hold an Advanced License in Amateur Radio, and I'm
a friend of Bill W's.

Interested individuals should contact me at VE3GRF@RAC.CA
<mailto:VE3GRF%40RAC.CA>

Please help, I'm drowning in object classes. I have an unlimited
North America calling plan so your location is not important as long
as it is within continental North America.

Greg

[Non-text portions of this message have been removed]


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

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/

[oopic] Seeking OOPIC tutor - paid postion

I am seeking an individual willing to instruct me online and by
telephone on OOPIC basics. This is a paid position, remuneration to
be agreed upon but $15 / hour would be a rough starting point.

The position would ideally be a retired person with good
communication skills who is fluent in the OOPIC language and has
broad electronic knowledge. Tutoring would be by telephone (phone
calls at my expense), and payment can be made by any number of
methods.

Interested individuals should be prepared to receive numerous
annoying phone calls from me, many of them brief but requiring
interruptions of your day. A fee structure to remunerate you for
those one minute annoying phone calls can also be agreed upon.

I have no previous OOPIC experience and am finding the starting
learning curve very steep. I have a background in electronics,
extensive experience with interpretive BASIC, some limited experience
in Object Oriented programming (Visual Basic), but ZERO experience
with OOPIC. I also hold an Advanced License in Amateur Radio, and I'm
a friend of Bill W's.

Interested individuals should contact me at VE3GRF@RAC.CA

Please help, I'm drowning in object classes. I have an unlimited
North America calling plan so your location is not important as long
as it is within continental North America.

Greg

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

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/

Monday, August 11, 2008

Re: [oopic] Reed switch help

At 05:44 PM 8/11/2008, Brian Lloyd wrote:
>If all I am doing is counting pulses I try not to tie inputs to Vcc at
>least not without a series resistor. Drive the input as an output and
>you could smoke the pin. I would use the reed switch to ground and a
>pull-up resistor to Vcc/Vdd. I agree with your value of 10K.
>
>
>
> Vdd
> |
> 10K
> |
>pin<-----+
> |
> reed switch
> |
> Vss (ground)


You could still hurt the micro if the pin is driven high and the reed
switch is closed. I'd add a protection resistor:

. Vdd
. |
. 10K
. |
pin<--330---+
. |
. reed switch
. |
. Vss (ground)


...Andy

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

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/

Re: [oopic] Reed switch help

On Aug 11, 2008, at 11:38 AM, ray xu wrote:

> The resistor acts as a pull-low resistor. A 10K-ohm or a 4.7K-Ohm
> is good

If all I am doing is counting pulses I try not to tie inputs to Vcc at
least not without a series resistor. Drive the input as an output and
you could smoke the pin. I would use the reed switch to ground and a
pull-up resistor to Vcc/Vdd. I agree with your value of 10K.

Vdd
|
10K
|
pin<-----+
|
reed switch
|
Vss (ground)


Brian Lloyd
Granite Bay Montessori School 9330 Sierra College Bl
brian AT gbmontessori DOT com Roseville, CA 95661
+1.916.367.2131 (voice) +1.791.912.8170 (fax)

PGP key ID: 12095C52A32A1B6C
PGP key fingerprint: 3B1D BA11 4913 3254 B6E0 CC09 1209 5C52 A32A 1B6C

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

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/