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.

Saturday, April 26, 2008

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

No comments: