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.

Wednesday, April 30, 2008

Re: [oopic] oopic array index starts at 0 or 1, and why confusion?

This is a case where the documentation isn't in step. V.6 compiler
arrays are zero (0) indexed. to the best of my knowledge.

DLC

tuandung248 wrote:
> hi all,
> the document on the website at http://www.oopic.com/pgchap3.htm says
> that an array of objects always start at 1. however the compiler
> 6.1.1 shows that index starts from 0.
>
> eg. declare: Dim Leg(6) as New oServo in the oopic IDE it says i have
> 7 oServo objects
>
> but then why is it when I declare for it to start at 1, the array
> seems to start at 0 instead? why is this not consistent? in my
> program below, after I call SetUp, when I want to move my Leg(1) whose
> IOLine is at 28, it moves the servo at IOLine 30, which is Leg(2)(!!!)
> Similarly (also in the Main), i call Leg(5) it moves the one that is
> supposed to be Leg(6). Everything is off by 1: change position of
> Leg(0) would show at Leg(1) and Leg(6) didn't do anything. I had to
> get around by naming the servos Leg1, Leg2, ..., Leg6 instead. But
> it's convenience to expand my code. Has anybody had a similar problem?
>
> thanks in advance for your help and guidance,
> HT
>
> Code:
>
> Dim Leg(6) as New oServo
>
> Sub Main()
> Call Setup
> Leg(1)=10
>
> End Sub
>
> Sub SetUp()
> leg(2).InvertOut = cvTrue 'The servos on the right side
> leg(4).InvertOut = cvTrue ' need to turn in reverse.
> leg(6).InvertOut = cvTrue
>
> leg(1).Center = 24
> leg(2).Center = 36
> leg(3).Center = 27
> leg(4).Center = 45
> leg(5).Center = 33
> leg(6).Center = 37
>
> leg(1).IOLine = 30
> leg(2).IOLine = 28
> leg(3).IOLine = 14
> leg(4).IOLine = 12
> leg(5).IOLine = 10
> leg(6).IOLine = 8
>
> leg(1).Operate = cvTrue 'Turn the servos on.
> leg(2).Operate = cvTrue
> leg(3).Operate = cvTrue
> leg(4).Operate = cvTrue
> leg(5).Operate = cvTrue
> leg(6).Operate = cvTrue
> End Sub
>
>
> ------------------------------------
>
> 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/

Re: [oopic] after i load program to OOBoard oopic B2.2+ i can't connect to the board serial

Please see the "cosmic wedgie" fix. You have created a program that
interferes with the system being able to get control of the serial
port. Just search the archive for "Cosmic Wedgie" and you'll get the
series of steps to recover from it.

DLC

abdelmenem_salem wrote:
> hi sir
> i have the roguerobotics with the oopic b2.2+
> after i upload this programe to the board i can't connect to it again
> and the serial connection stop.
> suddenly hile it works it stoped
> when turn it on the motore move slowly for 3 second and stop
> i cant connect it to the computer
> all led works ok
> all built in switch and leds respond ok when press a swith the led is
> turned on
> i attached the error message i recive when try to connect it to the
> computer to upload a programe also i can't erase the eeprom
> i use a serial cable
> please try to help me quickly tell me what can i do to slove this
> problem
> I shorted those ESTOP pads and switch the board on and also can't
> connect to the board via serial port
> can any one help me please
> thanks
> ' ex 5-2
> Dim LeftServo As New oServoX
> Dim RightServo As New oServoX
> Dim Measure As New oIRRange
> Dim Spk As New oSpeaker
> Dim LCD As New oLCD
> Const TooClose = 70
>
> Sub Main()
> Measure.IOLine = 3
> Measure.Center = 20
> Measure.Operate = cvTrue
> LeftServo.IOLine = 29
> RightServo.IOLine = 30
> RightServo.InvertOut = cvTrue
> LeftServo.Value = 127
> RightServo.Value = 127
> LeftServo.Operate = cvTrue
> RightServo.Operate = cvTrue
> Do
> If Measure.Value < TooClose Then
> ' Start Turning
> RightServo.Value = -127
> While Measure.Value < TooClose
> '' Keep Turning
> ' Spk.Beep(100,50,3)
> ' Delay=300
> ' Spk.Beep(50,100,3)
> ' Delay=50
> Spk.Beep(64000,100)
>
>
> Wend
> ' Now continue turning for a little longer
> ooPIC.Delay = 50
> ' Now go forward
> RightServo.Value = 127
> End If
> Loop
> End Sub
>
>
>
> ------------------------------------
>
> 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/

[oopic] oopic array index starts at 0 or 1, and why confusion?

hi all,
the document on the website at http://www.oopic.com/pgchap3.htm says
that an array of objects always start at 1. however the compiler
6.1.1 shows that index starts from 0.

eg. declare: Dim Leg(6) as New oServo in the oopic IDE it says i have
7 oServo objects

but then why is it when I declare for it to start at 1, the array
seems to start at 0 instead? why is this not consistent? in my
program below, after I call SetUp, when I want to move my Leg(1) whose
IOLine is at 28, it moves the servo at IOLine 30, which is Leg(2)(!!!)
Similarly (also in the Main), i call Leg(5) it moves the one that is
supposed to be Leg(6). Everything is off by 1: change position of
Leg(0) would show at Leg(1) and Leg(6) didn't do anything. I had to
get around by naming the servos Leg1, Leg2, ..., Leg6 instead. But
it's convenience to expand my code. Has anybody had a similar problem?

thanks in advance for your help and guidance,
HT

Code:

Dim Leg(6) as New oServo

Sub Main()
Call Setup
Leg(1)=10

End Sub

Sub SetUp()
leg(2).InvertOut = cvTrue 'The servos on the right side
leg(4).InvertOut = cvTrue ' need to turn in reverse.
leg(6).InvertOut = cvTrue

leg(1).Center = 24
leg(2).Center = 36
leg(3).Center = 27
leg(4).Center = 45
leg(5).Center = 33
leg(6).Center = 37

leg(1).IOLine = 30
leg(2).IOLine = 28
leg(3).IOLine = 14
leg(4).IOLine = 12
leg(5).IOLine = 10
leg(6).IOLine = 8

leg(1).Operate = cvTrue 'Turn the servos on.
leg(2).Operate = cvTrue
leg(3).Operate = cvTrue
leg(4).Operate = cvTrue
leg(5).Operate = cvTrue
leg(6).Operate = cvTrue
End Sub


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

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] after i load program to OOBoard oopic B2.2+ i can't connect to the board serial

hi sir
i have the roguerobotics with the oopic b2.2+
after i upload this programe to the board i can't connect to it again
and the serial connection stop.
suddenly hile it works it stoped
when turn it on the motore move slowly for 3 second and stop
i cant connect it to the computer
all led works ok
all built in switch and leds respond ok when press a swith the led is
turned on
i attached the error message i recive when try to connect it to the
computer to upload a programe also i can't erase the eeprom
i use a serial cable
please try to help me quickly tell me what can i do to slove this
problem
I shorted those ESTOP pads and switch the board on and also can't
connect to the board via serial port
can any one help me please
thanks
' ex 5-2
Dim LeftServo As New oServoX
Dim RightServo As New oServoX
Dim Measure As New oIRRange
Dim Spk As New oSpeaker
Dim LCD As New oLCD
Const TooClose = 70

Sub Main()
Measure.IOLine = 3
Measure.Center = 20
Measure.Operate = cvTrue
LeftServo.IOLine = 29
RightServo.IOLine = 30
RightServo.InvertOut = cvTrue
LeftServo.Value = 127
RightServo.Value = 127
LeftServo.Operate = cvTrue
RightServo.Operate = cvTrue
Do
If Measure.Value < TooClose Then
' Start Turning
RightServo.Value = -127
While Measure.Value < TooClose
'' Keep Turning
' Spk.Beep(100,50,3)
' Delay=300
' Spk.Beep(50,100,3)
' Delay=50
Spk.Beep(64000,100)


Wend
' Now continue turning for a little longer
ooPIC.Delay = 50
' Now go forward
RightServo.Value = 127
End If
Loop
End Sub

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

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] Re: algorithm for GPS waypoints

Thanks Richard!

Dear OOpic Group,
>
> I am trying to program an OOpic-R to navigate by use of a total robotics DS-GPM-GPS module. I currently have all of my waypoints. I am basically trying to get our vehicle to navigate from one point to another and back. I have measured the distances between the two points as well. My problem is that I am having trouble writing code to perform this task and I only have a few days to do so. I have tried looking online for sample code, but most people are using basic stamps or are using garmin gps units were you just type in your waypoints and the module automatically computes everything for you.
>
> I would really appreciate anyone's help! Also thanks for your help up to this point with my other questions!
>
> Thank you,
>
> Kev1814
>
>------------------------------------
>
>

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

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] Re: algorithm for GPS waypoints

--- In oopic@yahoogroups.com, kevsl294@... wrote:
>
> Dear OOpic Group,
>
> I am trying to program an OOpic-R to navigate by use of a
total robotics DS-GPM-GPS module. I currently have all of my
waypoints. I am basically trying to get our vehicle to navigate from
one point to another and back. I have measured the distances between
the two points as well. My problem is that I am having trouble
writing code to perform this task and I only have a few days to do so.
I have tried looking online for sample code, but most people are
using basic stamps or are using garmin gps units were you just type in
your waypoints and the module automatically computes everything for you.
>
> I would really appreciate anyone's help! Also thanks for your help
up to this point with my other questions!
>
> Thank you,
>
> Kev1814
>

The manufacturer has some code here:
http://www.designergeneric.co.uk/designer/DS-GPM_Disk.zip

It does not include information on navigation. It also appears that
the GPS itself doesn't deal with waypoints or course-to-steer. That
means you have to determine course and this requires some kind of
calculation. It would be nice to have an arc-tangent function but,
alas, it isn't available. Doing it with integer-only arithmetic will
be a challenge.

Too bad you are so short of time. You could add a floating point
coprocessor to do the calculations:
http://www.sparkfun.com/commerce/product_info.php?products_id=8129

You could always try the old fashioned way to navigate known as
'easting' (or 'westing', I suppose). Before it was possible to
measure longitude at sea (before the chronometer), vessels would sail
due north/south until they were at the proper latitude and then sail
due east/west until they reached their destination. Of course there
could be some variations but as they approached their destination (in
terms of days to sail), they had to be at the proper latitude.

Knowing that vessels had to be at the proper latitude to make a
desired landfall made the job of pirates a lot easier. They just
sailed out on the parallel of latitude and waited.

Richard

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

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] algorithm for GPS waypoints

Dear OOpic Group,

I am trying to program an OOpic-R to navigate by use of a total robotics DS-GPM-GPS module. I currently have all of my waypoints. I am basically trying to get our vehicle to navigate from one point to another and back. I have measured the distances between the two points as well. My problem is that I am having trouble writing code to perform this task and I only have a few days to do so. I have tried looking online for sample code, but most people are using basic stamps or are using garmin gps units were you just type in your waypoints and the module automatically computes everything for you.

I would really appreciate anyone's help! Also thanks for your help up to this point with my other questions!

Thank you,

Kev1814

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

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/

Tuesday, April 29, 2008

[oopic] Re: general trouble shoot question

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, "Darrell" <videogrfx@> wrote:
> >
> > 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
>
> I guess I would dump the if, endif part and see if the motor control
> works at all.
>
> Richard
>

I don't have any idea how, electrically, the sensors work. If they
are just switches pulling the IOLine to ground, is there a pull-up
resistor? If not, use OOPic.PullUp = cvTrue which works on IOLines
8..15 when they are used as inputs.

So, break the problem into two pieces: test the switches and display
the results on an LED and test the motor code without the switches
being evaluated.

Richard

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

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, April 28, 2008

[oopic] Re: oVarX object and 2D array?

Many thanks to those who have answered so far. i'm very clear about
the points that you all have helped clarified now. i'm changing the
goal for the robot a little now since the current direction requires
way too much memory. will be back with more questions soon.
thanks again


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

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] Does that say to you to GAIN heaps of GIFTS ?

HTTP://GAMES-LOTTERY.001BUSINESS.CN
A sympathetic site with heaps of direct bonds towards the sites of
plays & free contests to gain full with batches, goods…



Search, browse and book your hotels and flights through Yahoo! Travel http://sg.travel.yahoo.com

[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] Site of Meetings BD/SM PROHIBITS -18 YEARS ! 3.528.275 active members

http://BDSM-Contact.sexycontact.cn FREE INSCRIPTION


Search, browse and book your hotels and flights through Yahoo! Travel http://sg.travel.yahoo.com

[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/

Sunday, April 27, 2008

[oopic] Re: general trouble shoot question

--- In oopic@yahoogroups.com, "Darrell" <videogrfx@...> wrote:
>
> 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

I guess I would dump the if, endif part and see if the motor control
works at all.

Richard

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

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] Re: oVarX object and 2D array?

sByte was vaporware for V.5 compilers that never worked. The V.6
compiler has the proper way worked out that works Dim A as EEPROM Byte,
for instance.

DLC

rtstofer wrote:
> --- In oopic@yahoogroups.com, trungtuandung@... wrote:
>
>> One more thing, can anybody clarify this? it's said that sByte can
>>
> access the 256 byte-space of INTERNAL EEPROM which don't seem to be
> the same thing as the EEPROM at E0 slow on which program code is
> stored. If I declare
>
>> Dim A as EEPROM Nib
>> that means I use the 'external' EEPROM which is much slower. then
>>
> what happens to the fast acccess internal EEPROM, is there anyway to
> use it?
>
>> thanks in advance
>>
>>
>
> I don't know much about sByte; I just tried to declare a variable of
> that type on V5 and V6 without success. I think you can just about
> forget the internal EEPROM.
>
> So, use the external EEPROM as documented. Yes, it will be slow.
> But you are using the OOPic for a thing it doesn't do well. What you
> gain in object abstraction, you give up in performance.
>
> When you think in terms of executing 300 or so lines of code per
> SECOND, things like EEPROM access may not be the limiting factor.
>
> The OOPic does well with hardware abstraction. Things like motors
> and servos are easy to control. Projects that require a lot of
> computation would probably be better served with a different
> controller.
>
> Richard
>
>
>
> ------------------------------------
>
> 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/

[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/

Saturday, April 26, 2008

[oopic] Re: oVarX object and 2D array?

--- In oopic@yahoogroups.com, trungtuandung@... wrote:
>
> One more thing, can anybody clarify this? it's said that sByte can
access the 256 byte-space of INTERNAL EEPROM which don't seem to be
the same thing as the EEPROM at E0 slow on which program code is
stored. If I declare
> Dim A as EEPROM Nib
> that means I use the 'external' EEPROM which is much slower. then
what happens to the fast acccess internal EEPROM, is there anyway to
use it?
> thanks in advance
>

I don't know much about sByte; I just tried to declare a variable of
that type on V5 and V6 without success. I think you can just about
forget the internal EEPROM.

So, use the external EEPROM as documented. Yes, it will be slow.
But you are using the OOPic for a thing it doesn't do well. What you
gain in object abstraction, you give up in performance.

When you think in terms of executing 300 or so lines of code per
SECOND, things like EEPROM access may not be the limiting factor.

The OOPic does well with hardware abstraction. Things like motors
and servos are easy to control. Projects that require a lot of
computation would probably be better served with a different
controller.

Richard

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

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] Re: oVarX object and 2D array?

Internal Memory and EEPROM:

If you look at the memory map afer compiling a program, it will tell
you what memory is available (object, variable, and EEPROM). In this
window, the object memory it typically the most precious (any Dim
statement with an oWhatever type). An oByte will be placed in object
memory space and a Byte will be placed in variable space. If you
place the EEPROM delimiter in the Dim statement (i.e. Dim A As EEPROM
Byte) then that variable will be stored on the internal EEPROM) When
you declare a Bit, Nib, or Byte, they all take up one byte of memory
space. Objects cannot be declared on the internal EEPROM.
Examples:
Dim A As oByte ' Defines in object space
Dim A As Byte ' Defines in variable space
Dim A As EEPROM Byte ' Defines in internal EEPROM
This statement is not allowed:
Dim A As EEPROM oByte
This is because you are defining A as a oByte object. Because it is
being treated as an object, it cannot be in the EEPROM, only the
object space.


External EEPROM:
The EEPROM at address cvE0 (decimal 80, I think) is the external
EEPROM (seperate chip) where the program is stored. Depending on the
length of your program, you can use the additional space on this
EEPROM for storage space but you cannot assign variables to it (hence
my first suggestion) You can only access bytes of storage by using
direct addressing.

The maximum size for an external EEPROM isactually 64k-bytes
(512kBits). I have used a 24LC512 with no problems.

If RShift, and LShift are only usable with oByte style variables,
then divide or multiply by powers of two for the same result. I
cannot remember if I have actually used that in a program before but
the code compiles which tells me that the compiler knows how to
handle it.

Dim A(8) As Nib:
This will use 9 bytes of space. The index is zero based and it will
not split the individual bytes in the memory space. Sorry. All of
these use 9 bytes of space:
Dim A(8) As Bit
Dim A(8) As Nib
Dim A(8) As Byte

--- In oopic@yahoogroups.com, "tuandung248" <trungtuandung@...> wrote:
>
> thank you. you're pretty clear but there are just some parts where
> i'm confused:
>
> 1. what's with the internal and external EEPROM? i'm buying a new
32Kb
> EEPROM (max for oopicR) to use but how to i use variables there?
> isn't the program code stored in the external EEPROM instead of the
> internal EEPROM? where doess the "EEPROM byte" let you store
variable to?
>
> 2. Don't Rshift, Lshift, etc only belong to object types that
inherit
> from oValue class? so they should only work if you use objects like
> oWord or oByte, instead of word or byte. So if I declare "Dim A(8)
as
> nib" don't I get 4 blocks of half-byte next to each other?
>
> As a sidenote, if I want to use bit shifting on a variable type, I
> think I have to assign the value to object type first.
> eg.
> Dim A as EEPROM word
> 'extreme example: if i wanna multiply A by 2
> Dim B as oWord
> B = A
> B = A.Lshift(1)
> A = B
>
> thanks again. This is a great place to learn from others.
>
> >
> > 1. You could do it that way but you are still going to have to
use
> > the same amount of variable space. There is not a varible
between a
> > byte and a word so you would end up with a decimal value between
0
> > and 729 (3^6). Since that is greater than 256 (8 bits) you have
to
> > go one step up to a word (16 bits). When you do this, you have
no
> > way to save the left over bits so use them however you want. So
your
> > method won't actually save any space over mine, they both use 729
* 2
> > bytes of storage. I don't know if I have made since here or not,
if
> > not, I will try to clarify.
> >
> > 2. Those statements will not work. There is only 256 bytes of
space
> > available on the EEPROM (Internal) and you are trying to use 2187
> > bytes. Also when you specify a nibble versus a byte, the
compiler
> > only lets you use the first 4 bits but all 8 bits are allocated
> > (Hense the RShift, LShift, Mod...). That is one reason I rarely
use
> > nibbles or boolean values, they do not save any space, they all
use
> > one byte of RAM space.
> >
>

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

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] Re: oVarX object and 2D array?

thank you. you're pretty clear but there are just some parts where
i'm confused:

1. what's with the internal and external EEPROM? i'm buying a new 32Kb
EEPROM (max for oopicR) to use but how to i use variables there?
isn't the program code stored in the external EEPROM instead of the
internal EEPROM? where doess the "EEPROM byte" let you store variable to?

2. Don't Rshift, Lshift, etc only belong to object types that inherit
from oValue class? so they should only work if you use objects like
oWord or oByte, instead of word or byte. So if I declare "Dim A(8) as
nib" don't I get 4 blocks of half-byte next to each other?

As a sidenote, if I want to use bit shifting on a variable type, I
think I have to assign the value to object type first.
eg.
Dim A as EEPROM word
'extreme example: if i wanna multiply A by 2
Dim B as oWord
B = A
B = A.Lshift(1)
A = B

thanks again. This is a great place to learn from others.

>
> 1. You could do it that way but you are still going to have to use
> the same amount of variable space. There is not a varible between a
> byte and a word so you would end up with a decimal value between 0
> and 729 (3^6). Since that is greater than 256 (8 bits) you have to
> go one step up to a word (16 bits). When you do this, you have no
> way to save the left over bits so use them however you want. So your
> method won't actually save any space over mine, they both use 729 * 2
> bytes of storage. I don't know if I have made since here or not, if
> not, I will try to clarify.
>
> 2. Those statements will not work. There is only 256 bytes of space
> available on the EEPROM (Internal) and you are trying to use 2187
> bytes. Also when you specify a nibble versus a byte, the compiler
> only lets you use the first 4 bits but all 8 bits are allocated
> (Hense the RShift, LShift, Mod...). That is one reason I rarely use
> nibbles or boolean values, they do not save any space, they all use
> one byte of RAM space.
>


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

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] Re: general trouble shoot question

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/

[oopic] Re: oVarX object and 2D array?

1. You could do it that way but you are still going to have to use
the same amount of variable space. There is not a varible between a
byte and a word so you would end up with a decimal value between 0
and 729 (3^6). Since that is greater than 256 (8 bits) you have to
go one step up to a word (16 bits). When you do this, you have no
way to save the left over bits so use them however you want. So your
method won't actually save any space over mine, they both use 729 * 2
bytes of storage. I don't know if I have made since here or not, if
not, I will try to clarify.

2. Those statements will not work. There is only 256 bytes of space
available on the EEPROM (Internal) and you are trying to use 2187
bytes. Also when you specify a nibble versus a byte, the compiler
only lets you use the first 4 bits but all 8 bits are allocated
(Hense the RShift, LShift, Mod...). That is one reason I rarely use
nibbles or boolean values, they do not save any space, they all use
one byte of RAM space.

--- In oopic@yahoogroups.com, "tuandung248" <trungtuandung@...> wrote:
>
> Thanks a lot!! That's a cool way of making use of the EEPROM. It's
a
> great idea to store the 6-digit word as one variable.
>
> 1. How about taking a 6-bit word as a base-3 number (digit 0,1,2)
and
> convert it to a decimal number instead? My concern is that, your
> method use shift operation on 2 bits which is probably faster while
> mine below might be slow due to multiply/divide operations. Should
I
> sacrifice one more bit and use base-4 like what you did instead?
>
> Dim Leg(6) As Nib
> Dim Index As Word
>
> Sub HashToIndex(Void)
> 'take a state from Leg(1..6) (eg. 012012)
> 'and convert to decimal. eg 140 for 012012
> Index = Leg(6) + Leg(5)*3 + Leg(4)*9 + Leg(3)*27 + Leg(2)*81 +
> Leg(1)*243
> End Sub
>
> Sub HashToState(Void)
> Leg(6) = Index Mod 3
> Index = Index / 3
> Leg(5) = Index Mod 3
> Index = Index / 3
> Leg(4) = Index Mod 3
> Index = Index / 3
> Leg(3) = Index Mod 3
> Index = Index / 3
> Leg(2) = Index Mod 3
> Index = Index / 3
> Leg(1) = Index
> End Sub
>
> 2. Last time I thought sByte is the only way to store var to EEPROM,
> but i realize sByte doesn't work anymore, and there's a better
option:
>
> Dim Relevance(729) As EEPROM Nib
> Dim Reliability(729) As EEPROM Nib
> Dim Weight(729) As EEPROM Nib
>
> As you see I need to store corresponding Relevance, Reliability,
> Weight (and a more few more similar columns that i'm trying to
reduce)
> to each state. Now that I hash each 6-digit word into an index
> decimal number, I can get a round with the 2D array. However, is it
> reliable to use the variables as declared above on ooPic-R, compiler
> 6.1.1, yet? Or is it more reliable to handle the oEEPROM object
like
> you did?
>
> Thank you for the quick help, hope to hear more from you and others.
>
>
> --- In oopic@yahoogroups.com, "tinslwc" <tinslwc@> wrote:
> >
> > You are going to have to store the table in the EEPROM. Even if
you
> > were able to use all the available bits in the regular RAM space,
you
> > would need almost 1100 bytes (729*6=4374 @ 2 bits each). If
EEPROM
> > space is limited, you can store each row of 6 values in one word
(16
> > bit) variable. I would then write a function to call out which
one
> > that you want. Here is an example:
> >
> > Dim EEPROM_Table As oEEProm
> > Const TableOffset = 10000
> >
> > Sub Main()
> > EEPROM_Table.Node = cvE0 ' or cvE1 if you have it)
> > EEPROM_Table.Width = 1 ' Set to 16 bit transfers
> > EEPROM_Table.NoInc = cvTrue ' Do not automatically increment
> > End Sub
> >
> > Function GetValue(x_Index As Word, y_Index As Byte) As Byte
> > EEPROM_Table.Location = TableOffset + (x_Index * 2)
> > x_Index = EEPROM_Table.Value ' Read 16 Bit Value
> > x_Index.RShift(y_Index * 2)
> > x_Index = x_Index And 3 ' Clear all but last 2 bits
> > Return x_Index
> > End Function
> >
> > Sub WriteValue(x_Index As Word, y_Index As Byte, Data As Byte)
> > Dim Temp As Word
> > EEPROM_Table.Location = TableOffset + (x_Index * 2)
> > x_Index = EEPROM_Table.Value
> > Temp = 3
> > Temp.LShift(y_Index * 2)
> > Temp = Temp Xor 65535
> > x_Index = x_Index And Temp
> > Temp = Data
> > Temp.LShift(y_Index * 2)
> > x_Index = x_Index + Temp
> > EEPROM_Table.Value = x_Index
> > End Sub
> >
> >
> > This code compiles but I did not test it to see if it works
> > properly. It should be able to read and write 2 bits at a time
> > (enough to represent 0, 1, 2, or 3) to the EEPROM table at the
> > location specified by x_Index and y_Index. It will not be really
> > fast although your application of this does not sound like it
will be
> > a problem. They say that the B versions of the oEEPROM object
has
> > some trouble with two byte transfers but I think you could rewite
> > this to use one byte transfers. The Table offset is where the
table
> > will begin on the EEPROM. Depending on the size of the EEPROM
you
> > use, you may need to change this. The table will take up 1458
bytes
> > so you need to keep that in mind and if you are using it on E0,
you
> > need to make sure that it is stored above your program location.
> > Good luck.
> > --- In oopic@yahoogroups.com, trungtuandung@ wrote:
> > >
> > > Hi all,
> > > I'm new here and hoping that somebody can help me with this.
I'm
> > using ooPic-R which is connected to 2 sensors and a SSC-32 servo
> > controller (with 12 servos). I want to make it learn how to walk
> > just by sensors and without walk sequence. Now I need huge
tables.
> > >
> > > The ooPic manual says that i can use object oVar3
> > > http://www.oopic.com/ovar.htm
> > >
> > > but the 6.1.1 oopic compiler online understands oVar8 and
oVar16.
> > I need a table of the size 729 by 6 and each cell has 3 values -
1, 0,
> > 1 (preferably, if not possible, i can settle with 0, 1, 2)
> > >
> > > What's the most efficient way to store them? I read somewhere
that
> > you can only store array of objects, in which case I'm out of
luck
> > because there are only 86 bytes object memory.
> > >
> > > Thanks in advance for your help,
> > > Harley
> > >
> >
>

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

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] Re: oVarX object and 2D array?

I have never used sByte. I only use the internal EEPROM for storing
information that I want to be available even after a reset.

Dim A as EEPROM Nib

That line will initalize the variable A on the internal 256 byte
EEPROM. I am not sure that you can dimension variables on the external
EEPROM.

--- In oopic@yahoogroups.com, trungtuandung@... wrote:
>
> One more thing, can anybody clarify this? it's said that sByte can
access the 256 byte-space of INTERNAL EEPROM which don't seem to be the
same thing as the EEPROM at E0 slow on which program code is stored.
If I declare
> Dim A as EEPROM Nib
> that means I use the 'external' EEPROM which is much slower. then
what happens to the fast acccess internal EEPROM, is there anyway to
use it?
> thanks in advance
>

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

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/

Friday, April 25, 2008

[oopic] Re: general trouble shoot question

--- 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/

[oopic] Re: general trouble shoot question

I've added longer delays but the sensors are still being ignored. Any
other suggestions anyone?

/* 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/

[oopic] Re: oVarX object and 2D array?

One more thing, can anybody clarify this? it's said that sByte can access the 256 byte-space of INTERNAL EEPROM which don't seem to be the same thing as the EEPROM at E0 slow on which program code is stored. If I declare
Dim A as EEPROM Nib
that means I use the 'external' EEPROM which is much slower. then what happens to the fast acccess internal EEPROM, is there anyway to use it?
thanks in advance

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

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] Re: oVarX object and 2D array?

Thanks a lot!! That's a cool way of making use of the EEPROM. It's a
great idea to store the 6-digit word as one variable.

1. How about taking a 6-bit word as a base-3 number (digit 0,1,2) and
convert it to a decimal number instead? My concern is that, your
method use shift operation on 2 bits which is probably faster while
mine below might be slow due to multiply/divide operations. Should I
sacrifice one more bit and use base-4 like what you did instead?

Dim Leg(6) As Nib
Dim Index As Word

Sub HashToIndex(Void)
'take a state from Leg(1..6) (eg. 012012)
'and convert to decimal. eg 140 for 012012
Index = Leg(6) + Leg(5)*3 + Leg(4)*9 + Leg(3)*27 + Leg(2)*81 +
Leg(1)*243
End Sub

Sub HashToState(Void)
Leg(6) = Index Mod 3
Index = Index / 3
Leg(5) = Index Mod 3
Index = Index / 3
Leg(4) = Index Mod 3
Index = Index / 3
Leg(3) = Index Mod 3
Index = Index / 3
Leg(2) = Index Mod 3
Index = Index / 3
Leg(1) = Index
End Sub

2. Last time I thought sByte is the only way to store var to EEPROM,
but i realize sByte doesn't work anymore, and there's a better option:

Dim Relevance(729) As EEPROM Nib
Dim Reliability(729) As EEPROM Nib
Dim Weight(729) As EEPROM Nib

As you see I need to store corresponding Relevance, Reliability,
Weight (and a more few more similar columns that i'm trying to reduce)
to each state. Now that I hash each 6-digit word into an index
decimal number, I can get a round with the 2D array. However, is it
reliable to use the variables as declared above on ooPic-R, compiler
6.1.1, yet? Or is it more reliable to handle the oEEPROM object like
you did?

Thank you for the quick help, hope to hear more from you and others.


--- In oopic@yahoogroups.com, "tinslwc" <tinslwc@...> wrote:
>
> You are going to have to store the table in the EEPROM. Even if you
> were able to use all the available bits in the regular RAM space, you
> would need almost 1100 bytes (729*6=4374 @ 2 bits each). If EEPROM
> space is limited, you can store each row of 6 values in one word (16
> bit) variable. I would then write a function to call out which one
> that you want. Here is an example:
>
> Dim EEPROM_Table As oEEProm
> Const TableOffset = 10000
>
> Sub Main()
> EEPROM_Table.Node = cvE0 ' or cvE1 if you have it)
> EEPROM_Table.Width = 1 ' Set to 16 bit transfers
> EEPROM_Table.NoInc = cvTrue ' Do not automatically increment
> End Sub
>
> Function GetValue(x_Index As Word, y_Index As Byte) As Byte
> EEPROM_Table.Location = TableOffset + (x_Index * 2)
> x_Index = EEPROM_Table.Value ' Read 16 Bit Value
> x_Index.RShift(y_Index * 2)
> x_Index = x_Index And 3 ' Clear all but last 2 bits
> Return x_Index
> End Function
>
> Sub WriteValue(x_Index As Word, y_Index As Byte, Data As Byte)
> Dim Temp As Word
> EEPROM_Table.Location = TableOffset + (x_Index * 2)
> x_Index = EEPROM_Table.Value
> Temp = 3
> Temp.LShift(y_Index * 2)
> Temp = Temp Xor 65535
> x_Index = x_Index And Temp
> Temp = Data
> Temp.LShift(y_Index * 2)
> x_Index = x_Index + Temp
> EEPROM_Table.Value = x_Index
> End Sub
>
>
> This code compiles but I did not test it to see if it works
> properly. It should be able to read and write 2 bits at a time
> (enough to represent 0, 1, 2, or 3) to the EEPROM table at the
> location specified by x_Index and y_Index. It will not be really
> fast although your application of this does not sound like it will be
> a problem. They say that the B versions of the oEEPROM object has
> some trouble with two byte transfers but I think you could rewite
> this to use one byte transfers. The Table offset is where the table
> will begin on the EEPROM. Depending on the size of the EEPROM you
> use, you may need to change this. The table will take up 1458 bytes
> so you need to keep that in mind and if you are using it on E0, you
> need to make sure that it is stored above your program location.
> Good luck.
> --- In oopic@yahoogroups.com, trungtuandung@ wrote:
> >
> > Hi all,
> > I'm new here and hoping that somebody can help me with this. I'm
> using ooPic-R which is connected to 2 sensors and a SSC-32 servo
> controller (with 12 servos). I want to make it learn how to walk
> just by sensors and without walk sequence. Now I need huge tables.
> >
> > The ooPic manual says that i can use object oVar3
> > http://www.oopic.com/ovar.htm
> >
> > but the 6.1.1 oopic compiler online understands oVar8 and oVar16.
> I need a table of the size 729 by 6 and each cell has 3 values -1, 0,
> 1 (preferably, if not possible, i can settle with 0, 1, 2)
> >
> > What's the most efficient way to store them? I read somewhere that
> you can only store array of objects, in which case I'm out of luck
> because there are only 86 bytes object memory.
> >
> > Thanks in advance for your help,
> > Harley
> >
>

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

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/

Thursday, April 24, 2008

[oopic] oopic-r to soundgin serial board connection

hello everybody


can someone help me with the pin/cicruit to control the serial
soundgin board with the oopic-r board

code examples will be apritiated too

shemtov

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

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] Re: general trouble shoot question

Thanks for the tip!
Darrell

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, "Darrell" <videogrfx@> wrote:
> >
> > Richard,
> > Thank you very much for responding. If you mean the newer compiler,
> > yes, I did. What should I put be using for the delay times? Could this
> > be why the sensors are being ignored?
> > Darrell
> >
>
> The delays are, under V6, 1/10 as long as before. We used to use
> OOPic.Delay = 500 at startup to get a 5 second delay. Now the delay
> is just 500 mS or 1/2 second.
>
> Richard
>

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

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] 4 seven-segment LED

I have an old oopic A1. I would like to make a countdown timer with
OOPIC. Does anyone have codes and schematic that can share with me. I
need it non profit meeting. We need to set the timer for each person
who can give present for 15 to 20 minutes limit. please email to me
reidsim at gmail dot com

Thank you,
Reid


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

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] Re: general trouble shoot question

--- In oopic@yahoogroups.com, "Darrell" <videogrfx@...> wrote:
>
> Richard,
> Thank you very much for responding. If you mean the newer compiler,
> yes, I did. What should I put be using for the delay times? Could this
> be why the sensors are being ignored?
> Darrell
>

The delays are, under V6, 1/10 as long as before. We used to use
OOPic.Delay = 500 at startup to get a 5 second delay. Now the delay
is just 500 mS or 1/2 second.

Richard

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

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] Re: general trouble shoot question

Richard,
Thank you very much for responding. If you mean the newer compiler,
yes, I did. What should I put be using for the delay times? Could this
be why the sensors are being ignored?
Darrell


--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, "Darrell" <videogrfx@> wrote:
> >
> > Here's what I've got.
> > /* 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 = 25;
> > bubble_motor.Brake = cvOff;
> > ooPIC.Delay = 50;
> > }
> > }
> > }
> >
> >
> >
> > 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;
> > }
> >
>
> Have you changed from V5 to V6? Those are very short delay values in
> V6 which measures in milliseconds. V5 measured in 10 mS.
>
> Richard
>

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

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] Re: Fried OOPic?

Mike, which board are you using and where did the 22V hit it? If you
have no voltage across 22 & 24, it sounds like the 5V regulator is
shot. If you have the S board, you can use an external 5V regulator
and connect it the ribbon cable 5V pin and ground pin. If the 22V hit
the 5V side of the regulator, odds are you fried the PIC and/or the
EEPROM. Replacement EEPROMs are on the order of $2 for a 32Kb and
$3.50 for a 64Kb (largest the OOPic will support). The reason I think
that the regulator is your problem is because typical failure mode for
a 7805 regulator is to open (i.e. everything will be grounded and you
will not see any voltage on the 5V bus). If by chance you are using
the S-board, that lieelt regulator cannot take much. The TO-220
package 7805 can handle a whole lot more (in fact you can run it off of
22V as long as you dont pull too much current on your 5V side).

--- In oopic@yahoogroups.com, "Mike Martin" <xaviour2me@...> wrote:
>
> Hi All
> I was doing a servo motor test routine and inadvertantly hooked up
the
> bench power supply for the servo to the rails on the breadboard I was
> using for my OOPic. It was set to about 22v. Now the compiler
can 'see'
> the cable but can't download anything anymore. I've got zero volts
> across pin 22 and 24 and can't get anything out of the prototyping
area
> either. Is it RIP OOPic?
> Mike M.
>

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

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] Re: oVarX object and 2D array?

You are going to have to store the table in the EEPROM. Even if you
were able to use all the available bits in the regular RAM space, you
would need almost 1100 bytes (729*6=4374 @ 2 bits each). If EEPROM
space is limited, you can store each row of 6 values in one word (16
bit) variable. I would then write a function to call out which one
that you want. Here is an example:

Dim EEPROM_Table As oEEProm
Const TableOffset = 10000

Sub Main()
EEPROM_Table.Node = cvE0 ' or cvE1 if you have it)
EEPROM_Table.Width = 1 ' Set to 16 bit transfers
EEPROM_Table.NoInc = cvTrue ' Do not automatically increment
End Sub

Function GetValue(x_Index As Word, y_Index As Byte) As Byte
EEPROM_Table.Location = TableOffset + (x_Index * 2)
x_Index = EEPROM_Table.Value ' Read 16 Bit Value
x_Index.RShift(y_Index * 2)
x_Index = x_Index And 3 ' Clear all but last 2 bits
Return x_Index
End Function

Sub WriteValue(x_Index As Word, y_Index As Byte, Data As Byte)
Dim Temp As Word
EEPROM_Table.Location = TableOffset + (x_Index * 2)
x_Index = EEPROM_Table.Value
Temp = 3
Temp.LShift(y_Index * 2)
Temp = Temp Xor 65535
x_Index = x_Index And Temp
Temp = Data
Temp.LShift(y_Index * 2)
x_Index = x_Index + Temp
EEPROM_Table.Value = x_Index
End Sub


This code compiles but I did not test it to see if it works
properly. It should be able to read and write 2 bits at a time
(enough to represent 0, 1, 2, or 3) to the EEPROM table at the
location specified by x_Index and y_Index. It will not be really
fast although your application of this does not sound like it will be
a problem. They say that the B versions of the oEEPROM object has
some trouble with two byte transfers but I think you could rewite
this to use one byte transfers. The Table offset is where the table
will begin on the EEPROM. Depending on the size of the EEPROM you
use, you may need to change this. The table will take up 1458 bytes
so you need to keep that in mind and if you are using it on E0, you
need to make sure that it is stored above your program location.
Good luck.
--- In oopic@yahoogroups.com, trungtuandung@... wrote:
>
> Hi all,
> I'm new here and hoping that somebody can help me with this. I'm
using ooPic-R which is connected to 2 sensors and a SSC-32 servo
controller (with 12 servos). I want to make it learn how to walk
just by sensors and without walk sequence. Now I need huge tables.
>
> The ooPic manual says that i can use object oVar3
> http://www.oopic.com/ovar.htm
>
> but the 6.1.1 oopic compiler online understands oVar8 and oVar16.
I need a table of the size 729 by 6 and each cell has 3 values -1, 0,
1 (preferably, if not possible, i can settle with 0, 1, 2)
>
> What's the most efficient way to store them? I read somewhere that
you can only store array of objects, in which case I'm out of luck
because there are only 86 bytes object memory.
>
> Thanks in advance for your help,
> Harley
>

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

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/

Wednesday, April 23, 2008

Re: [oopic] Re: Controller

Dear Richard,
Thank you for your advice.
I will try it.


Regards
Muliady Ang

----- Original Message ----
From: rtstofer <rstofer@pacbell.net>
To: oopic@yahoogroups.com
Sent: Wednesday, April 23, 2008 7:38:39 AM
Subject: [oopic] Re: Controller

--- In oopic@yahoogroups. com, ANG MULIADY <mld_ang@... > wrote:
>
> Dear all,
> Hello,
> I want to use OOPIC in our instrumentation and control laboratory.
> Can OOPIC be used as PID controller or Fuzzy Controller.
> Have anybody try this?
> Thank you
>
> Regards
> Muliady Ang
>

Can you rewrite your PID algorithm to use only 16 bit integer
arithmetic? If not, are you willing to add an external floating point
coprocessor running on either the slow, bit-banged, I2C bus or the
slow, bit-banged, SPI bus? You may get some speed help from virtual
circuits but you need to consider that the OOPic may only execute 300
lines of code per second (plus or minus).

Given the availability of PID process controllers, using the OOPic
would be the hard way to do it. But it could probably be done.

Richard



____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.

http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[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] Re: Controller

--- In oopic@yahoogroups.com, ANG MULIADY <mld_ang@...> wrote:
>
> Dear all,
> Hello,
> I want to use OOPIC in our instrumentation and control laboratory.
> Can OOPIC be used as PID controller or Fuzzy Controller.
> Have anybody try this?
> Thank you
>
> Regards
> Muliady Ang
>

Can you rewrite your PID algorithm to use only 16 bit integer
arithmetic? If not, are you willing to add an external floating point
coprocessor running on either the slow, bit-banged, I2C bus or the
slow, bit-banged, SPI bus? You may get some speed help from virtual
circuits but you need to consider that the OOPic may only execute 300
lines of code per second (plus or minus).

Given the availability of PID process controllers, using the OOPic
would be the hard way to do it. But it could probably be done.

Richard

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

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/

Tuesday, April 22, 2008

[oopic] Controller

Dear all,
Hello,
I want to use OOPIC in our instrumentation and control laboratory.
Can OOPIC be used as PID controller or Fuzzy Controller.
Have anybody try this?
Thank you

Regards
Muliady Ang


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.

http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[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] oVarX object and 2D array?

Hi all,
I'm new here and hoping that somebody can help me with this. I'm using ooPic-R which is connected to 2 sensors and a SSC-32 servo controller (with 12 servos). I want to make it learn how to walk just by sensors and without walk sequence. Now I need huge tables.

The ooPic manual says that i can use object oVar3
http://www.oopic.com/ovar.htm

but the 6.1.1 oopic compiler online understands oVar8 and oVar16. I need a table of the size 729 by 6 and each cell has 3 values -1, 0, 1 (preferably, if not possible, i can settle with 0, 1, 2)

What's the most efficient way to store them? I read somewhere that you can only store array of objects, in which case I'm out of luck because there are only 86 bytes object memory.

Thanks in advance for your help,
Harley

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

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/

Sunday, April 20, 2008

RE: [oopic] Re: Sharp GP2D12

Now that's a good thought. "Meaningful to whom (or what)?" Interesting how
different people think, don't you think? I can see that now. It's a very
abstract idea - a new way of thinking for me perhaps.

PS. Hmm, inches fathoms or furlongs - millimetres, metres or
kilometres..heh, heh (Down Under is metric) :-)

Mike M.

_____

From: oopic@yahoogroups.com [mailto:oopic@yahoogroups.com] On Behalf Of
ooPIC Tech Support
Sent: Tuesday, 15 April 2008 4:19 AM
To: oopic@yahoogroups.com
Subject: Re: [oopic] Re: Sharp GP2D12

Mike Martin wrote:
> Woo Hoo! I've got volts that go up and down! (Thanks Bill). So how do
> I calibrate it and translate volts into something meaningful though
> the OOPic?
>
>
Meaningful to whom? :) Look at the Sharp data sheet to get the
values and what their range represents. I myself don't translate them
at all. I find the value for the range that I'm interested in and let
the robot deal with it that way - A robot doesn't care if its inches,
fathoms or furlongs.

DLC
> --- In oopic@yahoogroups. <mailto:oopic%40yahoogroups.com> com, "tinslwc"
<tinslwc@...> wrote:
>
>> Mike,
>> I have used a GP2D15 (a digital output for specific distance) but
>>
> the
>
>> datasheet that I have has the 12 and 15. Looking on the top of
>>
> the
>
>> sensor, pins facing toward you, sensor facing away from you, the
>>
> pins
>
>> are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5 to
>> Vcc, Ground to Ground and read the output (Vo) with you meter with
>> respect to ground. You should see approximatly 2.5V with an object
>> about 10 cm away from the sensor and as you move the object away,
>>
> the
>
>> voltage shoud decay. According to my data sheet (and IR knowledge)
>> you need to have a reflective object in order to get the sensor to
>> work. A white sheet of paper should work fine. There does appear
>>
> to
>
>> be some ripple in the output waveform. A small capacitor from the
>> signal line to ground should clean this up. I would recommend
>> something on the order of ~0.01uF. Use a ceramic cap, not
>> electrolytic. If you would like the schematic/picture of what I
>> used, let me know and I will get one to you. Again, I was using
>>
> the
>
>> 15, not the 12 but the pinouts are the same.
>> -Bill
>> --- In oopic@yahoogroups. <mailto:oopic%40yahoogroups.com> com, "Mike
Martin" <xaviour2me@> wrote:
>>
>>> Hello All (newbie question)
>>> I'd like to ask two things.
>>> 1)Is the diagram on http://www.oopic. <http://www.oopic.com/gp2d12.htm>
com/gp2d12.htm wrong? The
>>> datasheet in the sensors & detectors folder in the files section
>>>
>> have
>>
>>> the pinout different to that on the oopic site (as well as the
>>>
>> wiring
>>
>>> colours). If I look at mine face-on, from left to right the
>>>
> wiring
>
>> is
>>
>>> yellow/black/red for Vo/GND/Voc but the website suggests
>>>
>> GND/Voc/Vc.
>>
>>> So you see, I'm having trouble figuring out if it even works.
>>> 2)Also, does someone have a code snippet (or a known working
>>>
>> diagram)
>>
>>> I could borrow to test it? I'm not entirely sure what to read
>>>
> from
>
>>> the IO line. What does IR.Value produce? So far all I can get out
>>>
>> of
>>
>>> it is an integer value of 46. I'm using B.1.0 firmware. How can a
>>> digital IOline read fluctuating voltages? Is it converted to
>>>
>> varying
>>
>>> pulses? The code I'm using is below:
>>>
>>> 'Turns on a RED LED - fishing for a value out of the IR
>>> Sub main()
>>> Red.IOLine = 1
>>> IR.IOLine = 3
>>> Red.Value = 0
>>> ooPIC.ExtVRef=0
>>> IR.Operate=cvTrue
>>> X = IR.Value
>>> If X = 46 Then 'discovered this value by trial and error
>>> Red.TurnOn
>>> End If
>>> Delay = 1000
>>> Red.TurnOff
>>> End Sub
>>>
>>>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>

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

[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] Fried OOPic?

Hi All
I was doing a servo motor test routine and inadvertantly hooked up the
bench power supply for the servo to the rails on the breadboard I was
using for my OOPic. It was set to about 22v. Now the compiler can 'see'
the cable but can't download anything anymore. I've got zero volts
across pin 22 and 24 and can't get anything out of the prototyping area
either. Is it RIP OOPic?
Mike M.


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

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/

Saturday, April 19, 2008

[oopic] Re: Stepper Motor Question

Good point. The L298HN looks like the easiest


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

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] Re: Stepper Motor Question

I'd get the one that you think is the easiest to solder to a board. :)

DLC

jon_mark_go wrote:
> Will the L298N work
> (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=497-1395-5-ND)
> or should I go with a different version of the
> chip(http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556632;keywords=l298)?
>
>
> ------------------------------------
>
> 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/