Shop OBEX P1 Docs P2 Docs Learn Events
Propeller DATA — Parallax Forums

Propeller DATA

NewzedNewzed Posts: 2,503
edited 2006-07-08 23:37 in Propeller 1
I wrote:

DAT
xpos··· word··· 400

then I wrote:

PUB start | i

· 'start the tv terminal
· term.start(12)
· getdata·

and then I wrote:

PUB getdata
· term.str(string("Position X· "))
· posit := word[noparse][[/noparse]xpos][noparse][[/noparse]0]
· term.dec(posit)
· term.out(13)··

When I run it, my TV displays:

Position X 548

Why does it say 548 instead of the 400 I was expecting?

Thanks

Sid
«13

Comments

  • cgraceycgracey Posts: 14,206
    edited 2006-07-01 21:13
    You need to express the address of xpos:
    ·posit := word[noparse][[/noparse]@xpos][noparse][[/noparse]0]
    Newzed said...
    I wrote:

    DAT
    xpos··· word··· 400

    then I wrote:

    PUB start | i

    · 'start the tv terminal
    · term.start(12)
    · getdata·

    and then I wrote:

    PUB getdata
    · term.str(string("Position X· "))
    · posit := word[noparse][[/noparse]xpos][noparse][[/noparse]0]
    · term.dec(posit)
    · term.out(13)··

    When I run it, my TV displays:

    Position X 548

    Why does it say 548 instead of the 400 I was expecting?

    Thanks

    Sid
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-01 22:31
    Thanks a lot, Chip - that works great.

    On page 4-58 of the Prop manual it says:

    PUB GetData | Temp
    Temp := Byte[noparse][[/noparse]MyData][noparse][[/noparse]0]

    I think that should be changed to agree with what you just told me.· Also, I think "temp" is a reserved word - the program would not let me use it.
    Thanks again.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-07-02 18:31
    I finally finished my Propeller program so I can use it to run my little SuperMill.· For proving out the program, I wrote:

    DAT
    trav· word· "L",100,"I",200,"P", "L", 300,"I", 400, "R", 0,· "O",0,"L",600,"I",400,"Q"

    which is 8 "operations" all appearing on one line in Propeller.· When making a board I may have 200 or more operations.· I can't put all that on one line, so how do I organize my data list· so it can be read in its entireity. It starts off reading byte 0, the pointer is incremented by 1, it reads the next byte, and so on.· I tried writing:

    DAT
    trav· word· "L",100,"I",200,"P", "L", 300,"I", 400,
    ······· word "O",0,"L",600,"I",400,"Q"

    but that didn't work.· Help, please.

    Thanks

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-02 18:37
    Data items are placed in memory in the order they're written. If you just leave off the comma following the last "400", it should work
  • CJCJ Posts: 470
    edited 2006-07-02 18:50
    looks like a data size problem, have you tried reading the data as words, seeing as that is how you are storing them

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-02 19:01
    I wrote:

    trav· word· "L",100,"I",200,"P", "L", 300,"I", 400
    ············ ·· "R", 0,· "O",0,"L",600,"I",400,"Q"

    and got an error saying the second line must be proceeded by byte, word or long.· So then I wrote:

    DAT
    trav· word· "L",100,"I",200,"P",0,"L", 300
    ···· · word· "I", 400,· "R", 0,· "O",0,"L",600,"I",400,"Q"

    and that worked!

    Thanks again, Mike.

    Sid
  • cgraceycgracey Posts: 14,206
    edited 2006-07-03 05:22
    I forgot to state that DAT variables can be referenced by name, with index:

    trav[noparse][[/noparse]index]
    ...same as...
    word[noparse][[/noparse]@trav][noparse][[/noparse]index]

    ...and...

    trav
    ...same as...
    word[noparse][[/noparse]@trav]


    Newzed said...

    I wrote:

    trav· word· "L",100,"I",200,"P", "L", 300,"I", 400
    ············ ·· "R", 0,· "O",0,"L",600,"I",400,"Q"

    and got an error saying the second line must be proceeded by byte, word or long.· So then I wrote:

    DAT
    trav· word· "L",100,"I",200,"P",0,"L", 300
    ···· · word· "I", 400,· "R", 0,· "O",0,"L",600,"I",400,"Q"

    and that worked!

    Thanks again, Mike.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-03 13:34
    Thanks, Chip

    I am just finishing up my Prop program to run my little SuperMill.· I have two variables, xpos and ypos, tht define the current coordinates of the X and Y tables.· These variables are updated each time either table moves and are always correct as long as I don't turn the Prop off.· If I turn the Prop off, then back on, they both go to 0,0.· With the Stamp, each time either is updated, I write the new value to EEPROM.

    I have read the DAT pages of Chapter 4 several times but I do not see a way to write a DAT statement from with the program.· Is it possible to write a DAT statement "on the fly", so to speak.· I could always write a new DAT statement before I turn the Prop off, then read it when the Prop is turned back on, but it would be much nicer if I could update the DAT statement automaticallly via the program.

    Thanks

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-03 13:56
    The Propellors bootstrap EEPROM is an I2C device and there already is an I2C object in the Propellor library. You could get the absolute address of a DAT variable at runtime using the @ operator and write your data to those locations using I2C. When the Propellor restarts, it loads RAM from the first 32K of an attached EEPROM as a plain RAM image. Your data will be there.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-03 14:33
    Mike, I downloaded "i2cObject.spin", v1.2, and added it to my OBJ block:

    OBJ
    · term: "tv_terminal"·················
    · kb: "keyboard"
    · fp: "floatmath"
    · i2c: "i2cObject"

    Here is·my DAT block:

    DAT
    ··· loc·· word· 0,0····· 'xpos, ypos
    ··· trav· word· "L",100,"I",200,"P",0,"L", 300
    ·········· word· "I", 400,· "R", 0,· "O",0,"L",600,"I",400,"Q"

    Now, could you show me how to write new values of xpos or ypos to DAT whenever either changes.· Maybe one of these days I can do things like this for myself, but not just yet.

    Thank you very much.

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-03 15:19
    I think the following fragment will work. Modify as you need to. This was taken from the I2C demo and I haven't actually tried it yet.
    Basically, you'd call InitializeI2C somewhere in your initialization and call DoItAll(@loc,xpos,ypos) when you want to update the DAT. You can do an "if DoItAll(...)" if you want to check that it all went well. I'm assuming that words are most significant byte first on the Propellor. I haven't checked, but
    I think that's how things are arranged.
    CON
      i2cSCL        = 28
      i2cSDA        = 29
    
      EEPROM_Addr   = %1010_0000  
    
    OBJ
      i2cObject      : "i2cObject"
    
    PUB InitializeI2C
      i2cObject.init(i2cSDA, i2cSCL)
    
    PUB WriteByte(Addr,Value)            ' Write the byte Value at Address.  True if successful
      if i2cObject.devicePresent(EEPROM_Addr) == true
        i2cObject.writeLocation(EEPROM_Addr,Addr,Value,16,8)
        waitcnt(clkfreq / 100 + cnt)   ' Wait 10ms
        return i2cObject.readLocation(EEPROM_Addr,Addr,16,8) == Value
      return false
    
    PUB WriteWord(Addr,Value)            ' Write the word value at Address.  True if successful
      if WriteByte(Addr,Value >> 8)
        return WriteByte(Addr+1,Value & $FF)
      return false
    
    PUB DoItAll(Addr,xValue,yValue)
      if WriteWord(Addr,xValue)
        return WriteWord(Addr+2,yValue)
      return false
    
    
  • NewzedNewzed Posts: 2,503
    edited 2006-07-03 16:51
    Mike, I put the WriteWord sequence at the very end of my program, with this mod:

    PUB WriteWord(Addr,Value)··········· ' Write the word Value at Address.· True if successful
    · i2cObject.init(i2cSDA, i2cSCL)·
    ··· if i2cObject.devicePresent(EEPROM_Addr) == true
    ····· term.str(string("EEPROM present"))
    ··· else
    ····· term.str(string("EEPROM not present"))
    ··· i2cObject.writeLocation(EEPROM_Addr,Addr,Value,16,8)
    ··· waitcnt(clkfreq / 100 + cnt)·· ' Wait 10ms
    ··· return i2cObject.readLocation(EEPROM_Addr,Addr,16,8) == Value
    · return false

    Then at the very beginning of the program I modified my PUB start to:

    PUB start
    · 'start the tv terminal
    · term.start(12)
    · WriteWord(Addr, value)

    When I tried to load it I got an error "Expected an expression term" and it highlighted "Addr".· What did I do wrong?·

    Sid·······
  • NewzedNewzed Posts: 2,503
    edited 2006-07-03 17:05
    Mike, it just occurred to me - did you mean to write EEPROM_addr instead of Addr?

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-03 17:32
    1) Use the WriteByte and WriteWord as I've written them. Modify your "start" routine as follows:
    DAT
    test word 0
    PUB start
    ' start the tv terminal
      term.start(12)
      term.dec(test)
    ' initialize I2C
      i2cObject.init(i2cSDA, i2cSCL)
      if NOT WriteWord(@test,test+1)
        term.str(string("EEPROM Write Error"))
    
    



    Every time you run this, it should show a larger value

    2) EEPROM_Addr is the address of the EEPROM chip on the I2C bus and has nothing to do with Propellor addresses
  • NewzedNewzed Posts: 2,503
    edited 2006-07-03 18:48
    Mike, I tried to do exactly what you said.· When I wrote:

    DAT

    test· word· 0

    "test" turned purple, so I figured it ws a reserved word.· I changed it to test1 and it turned the normal color.· Then I wrote:

    PUB start
    ' start the tv terminal
    · term.start(12)
    · term.dec(test1)
    · waitcnt(clkfreq*2 + cnt)········· 'added this line
    ' initialize I2C
    · i2cObject.init(i2cSDA, i2cSCL)
    ·· if NOT WriteWord(@test1,test1+1)
    ··· term.str(string("EEPROM Write Error"))

    I loaded and ran.· "0" appears for 2 seconds, then the screen turned black briefly, then back to a blank blue screen - nothing at all displayed.

    I have an idea - easier for me, harder for you.· I have attached pulsout_N_autorun which works fine.· Could you insert whatever so it will work?· Line 127 is the first instance of xpos changing value.· If you can do your thing here so I can see how you did it, then I can change all the other instances in the program.· If it compiles, please send it back to me as pulsout_P_autorun.

    Thanks· lot

    Sid
    ···
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-03 20:15
    That's what I get for suggesting things that sound like they should work, but without actually testing them. Sorry. Oh well! I have to work tonight and tomorrow is the 4th of July and we're having a crowd over, etc. What I plan to do is start with the I2C object and write a short program to read some bytes from the EEPROM and display them. Since most of the code is similar, once the reading is working, the writing is likely to work. I'll report back once I have something ... maybe tomorrow afternoon if things don't get too crazy with preparations.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 16:24
    The Propellor Demo Board doesn't have a pullup on the EEPROM SCL line. The chip always actively drives the clock during the boot process and while programming the EEPROM. The I2C object always assumes that there are pullups on both the SCL and SDA lines and hangs up if this isn't so. I'm going to modify the I2c object to check for the SCL line being pin 28 and to actively drive SCL if so.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-04 17:51
    Mike, my i2cObject spedifies pins 28 and 29, and my board has pullups on both lines.

    I doiwnloaded i2cDemoApp.· I had no idea what I was doing but I started changing things to see what would happen.· Eventually I got to the point where it would read the current position of xpos and ypos, write them to EEPROM and then read them back.· This is in keeping with my programming philosophy when I don't know what I'm doing - if Button A doesn't work, then push Button B.

    Anyway, I incorporated the write/read sequence into my program as:

    PRI EEPROM_Demo | eepromData, eepromLocation, EEPROM_array[noparse][[/noparse]10], ackbit

    Then I wrote another method:

    PRI EEPROM_read | eepromData, loc, EEPROM_array[noparse][[/noparse]10], ackbit

    I saved everything into a new version - pulsout_P_autorun - which I have attached.· All the previous lines that said "term.dec(xpos", etc.. were deleted.· The revised program with the two added methods were great, EXCEPT - when I turn the Prop off and back on again, X and Y go to 0,0, instead of the current positions I was anticipating.· It's like it is not reading the EEPROM or I am not getting it there correctly in the first place.· Can you fix it so I can read the current position when I boot up again.· I have also attached the version of i2cObject I am using.· Apparently there are at least two versions of this object and I wanted to make sure you have the version I was using.

    Thanks

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 18:53
    I'll look at your stuff later (probably tomorrow). Here's my modified i2cObject. It reads and writes from/to the program EEPROM on an unmodified Propellor Demo Board. It should also work with other I2C devices when the clock pullup is not used. The output is on video and it's basically a stripped
    down, modified I2C Demo program that just scans the I2C bus and does it's EEPROM thing if one is found.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 19:21
    After a quick glance at your program ...
    1) Even though the I2C read / write routines accept a bit count, they really only read / write the 8 most significant bits.
    They're taking the high order byte of your values (which is probably zero). You have to break it apart yourself. That's why
    I wrote the "WriteByte" and "WriteWord" routines ... to take care of this. You might as well use them.
    2) I've modified the i2cObject to properly handle a bit count other than 8 (see my previously posted archive). That will only
    work for devices that understand a non-8 bit data size. It certainly isn't true for EEPROMs.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 19:24
    One more thing:
    You have to use "@" when passing the EEPROM location to the read/write routines. So, "@xpos" means "address in EEPROM or RAM of xpos". In your program you just put "xpos". This writes the data at the location in EEPROM corresponding to the value of xpos ... in other words ... where you don't want it.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-04 20:28
    Mike, I'n not sure I understand what you are saying.

    However, I agree with you that I am doing it wrong.· When I write:

    term.dec(xpos)·· I think I'm really displaying the value that was generated when I told it to go left.

    I changed that line to:

    term.dec(eepromdata)

    and all I got was 0, so obviously I am not writing properly to the EEPROM· I'll just wait until you can make it right.· I'm anxious to see how you do it.· I have an EEPROM that will only accept bytes, so with the Stamp I have to write:

    shiftout.......v1.lowbyte, v1.highbyte,...........

    Don't now if that approach will work with Prop.· Anyway, I'll wait for you to fix things, as you always do.

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 21:35
    Please look at my test program and see what I'm doing. You're going to have to figure this out. To write xpos and ypos to your EEPROM:
    PRI writePosition
        i2cObject.Init(29, 28)  ' initialize the i2c routines with SCL pin 28 and SDA pin 29
        i2cObject.writeLocation(%1010_0000, @xpos, xpos >> 8, 16, 8) ' write msb of xpos
        i2cObject.writeLocation(%1010_0000, @xpos+1, xpos, 16, 8) ' write lsb of xpos
        i2cObject.writeLocation(%1010_0000, @ypos, ypos >> 8, 16, 8) ' write msb of ypos
        i2cObject.writeLocation(%1010_0000, @ypos+1, ypos, 16, 8) ' write lsb of ypos
        i2cObject.stop ' stop using pins 28 and 29 and leave them as inputs
    DAT
    xpos     long     0
    ypos     long     0
    
    


    This writes the current value of xpos and ypos to the EEPROM so that they will be reloaded into RAM when the Propellor is restarted. These should not be written to EEPROM unless they have actually changed since there is a limit on the number of times any EEPROM can be written (approx 1,000,000).
    Note that this may not work if you don't use my modified i2cObject (v1.3). If you want to display xpos and ypos, use "term.dec(xpos)". If you want to read the values stored in EEPROM do:
    PRI readPosition | msb,lsb
        i2cObject.Init(29, 28)  ' initialize the i2c routines with SCL pin 28 and SDA pin 29
        term.str(string("xpos="))
        msb := i2cObject.readLocation(%1010_0000, @xpos, 16, 8) ' read msb of xpos
        lsb := i2cObject.readLocation(%1010_0000, @xpos+1, 16, 8) ' read lsb of xpos
        term.dec(msb << 8 | lsb)
        term.str(string(", ypos="))
        msb := i2cObject.readLocation(%1010_0000, @ypos, 16, 8) ' read msb of ypos
        lsb := i2cObject.readLocation(%1010_0000, @ypos+1, 16, 8) ' read lsb of ypos
        term.dec(msb << 8 | lsb)
        i2cObject.stop ' stop using pins 28 and 29 and leave them as inputs
    
    
  • NewzedNewzed Posts: 2,503
    edited 2006-07-04 23:24
    Mike, I removed everything about EEPROM from Rev P and wrote

    term.dec(xpos)· ' or (ypos)· wherever necessary, ran it to make sure everything was OK, then saved it as Rev Q.

    I then added your two methods - copied and pasted - and tried to compile it.· I got an error "Expected a unique name" and it highlighted the xpos in the DATA list.· So....I· changed all references in the DATA list and in your two methods to xposit or yposit as required.· It then compiled OK.

    I'll let you know in the morning how the program worked out.· It is about time for me to power down.

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-04 23:35
    You may have duplicates for xpos and ypos, particularly if you just copied and pasted. My routines should be referring to your values whereever they are. If you declared xpos and ypos as VARs, they may not be stored in EEPROM, I'm not sure. DATs are stored in EEPROM and copied to RAM for execution. That's why I declared them in the DAT section. As I recall from an earlier thread, if you have two copies of the same object, the compiler stores only one copy of PRI/PUB/DAT information in the EEPROM no matter how many copies you have of the same object. Each copy though gets its own private VAR section. This doesn't apply so much to the "Top" object that has your main program, but the same notion applies. Anyway, good luck tomorrow and have a nice 4th of July evening.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-05 13:14
    Good morning, Mike

    Well, here is what happened.· I added your two methods to my program, changing
    WriteLocation to

    i2cObject.writeLocation(%1010_0000, @xposit, xposit>> 8, 16, 8) ' write msb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @xposit+1, xposit, 16, 8) ' write lsb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @yposit, yposit >> 8, 16, 8) ' write msb of ypos
    ··· i2cObject.writeLocation(%1010_0000, @yposit+1, yposit, 16, 8) ' write lsb

    To check the response, I put ReadLocation at the beginning of the program and put WriteLocation at the end of the L,R,I and O sequences.· The first time if ran it the screen said:

    xpos = 19456· ypos = 18688

    I then ran left, 100, and xpos changed to 0.· Then I realized that I wanted to store xpos, not xposit, so I changed the WriteLocation lines to:

    i2cObject.writeLocation(%1010_0000, @xposit, xpos>> 8, 16, 8) ' write msb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @xposit+1, xpos, 16, 8) ' write lsb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @yposit, ypos >> 8, 16, 8) ' write msb of ypos
    ··· i2cObject.writeLocation(%1010_0000, @yposit+1, ypos, 16, 8) ' write lsb of ypos

    When I loaded and ran xpos was still 0 and ypos still 18688.

    I ran in, 100, and ypos changed to 18788.· Then I ran left, 1000.· Xpos was 768
    and ypos was still 18788.· I ran right,100.· Xpos and ypos were unchanged.· I ran right, 1000.· xpos was 65280 and ypos was unchanged.· I turned the Prop off for a minute, then back on and the same values were displayed.

    That is where I am at the moment.· I'm going to play around with it to see if I can get the proper display.· I feel that this has taken enough of your time, so if I can not get it working, I'll go back to my original program, and if I have to stop in the middle, I'll either just let the Prop run until the next morning, or, I could record the X and Y values, then plug them in at the start of the program when I'm ready to resume.

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-05 14:02
    Try displaying the contents of both xpos/ypos and xposit/yposit and see what happens when you restart the Propellor. Also try my sample program, see what it does, and try to figure out what's happening.
  • NewzedNewzed Posts: 2,503
    edited 2006-07-05 14:52
    Mike, I wrote a liitle program for my Stamp

    xpos var word
    x var byte
    y var byte
    z var word

    xpos = 1000
    x = xpos>>8··· 'msb
    y = xpos········ lsb
    xpos·= x<<8 | lsb

    debug dec ? x, cr
    debug dec ? y, cr
    debug dec ? xpos, cr

    The debug screen said:

    x = 3
    y = 232
    xpos = 1000

    so that proves out your math.· Then I added 2 lines to WriteLocation:

    PRI writePosition
    ··· xpos := 444···· 'added
    ··· ypos := 555··· 'added
    ··· i2cObject.Init(29, 28)· ' initialize the i2c routines with SCL

    The idea being to force a display of xpos and ypos, regardless of what they really were.· I ran left, 100, and got 256 and 16543 instead of the 444 amd 555 I was expecting.· Then I loaded the program into EEPROM instead of RAM and got
    256 and 43.

    It doesn't make any difference whether I use v1.2 or v1.3 of ic2Object.

    So I'll try something else.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-07-05 15:21
    Mike Green said...
    Try displaying the contents of both xpos/ypos and xposit/yposit and see what happens when you restart the Propellor. Also try my sample program, see what it does, and try to figure out what's happening.
    I did that and restarted.· Both xposit and yposit were 0.· Then I went left 100.· xposit changed to 100 but your xpos remained 0.· Then I wrote In 100.
    yposit remained 0 but your ypos changed to 100.· Then I wrote in 100 again.
    yposit remained 0 butyou ypos changed to 44.· This is weird.
    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-07-05 16:47
    Mike, I changed WriteLocation to read:

    PRI writePosition
    ··· xposit := xpos
    ··· yposit := ypos
    ··· i2cObject.Init(29, 28)· ' initialize the i2c routines with SCL pin 28 and SDA pin 29
    ··· i2cObject.writeLocation(%1010_0000, @xposit, xposit>>8, 16, 8) ' write msb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @xposit+1, xposit, 16, 8) ' write lsb of xpos
    ··· i2cObject.writeLocation(%1010_0000, @yposit, yposit >>8, 16, 8) ' write msb of ypos
    ··· i2cObject.writeLocation(%1010_0000, @yposit+1, yposit, 16, 8) ' write lsb of ypos
    ··· i2cObject.stop ' stop using pins 28 and 29 and leave them as inputs

    I esloaded and everything read 0.· Then I wrote In 255.· Your ypos said 255, yposit said 255 and my Y said 255.· Then I said in 1.· Your ypos said 0, yposit said 256, and my Y said 256.· It's like the program is not reading the msb of yposit.· I said left 100.· Your xpos stayed at 0, xposit said 100 and my X said 100.· I said left 155.· Your xpos remained 0, my X and xposit both said 255.· I then changed:

    term.dec(msb << 8 | lsb)

    to read:

    term.dec(yposit)

    Now your·ypos, my Y and yposit all respond accurately.· I turned the Prop off for a minute, then back on.· Your ypos said 59392, yposit said 59392, and as epected my Y said·0.

    Then I changed:

    term.dec(msb << 8 | lsb)

    to read:

    term.dec(xposit)

    Now the xpos function responds just like the·ypos.· However, if I turn Prop off, then back on, your xpos says 1, xposit says 1, and as expected my X says 0.

    I am becoming emotionally traumitized!

    Sid
Sign In or Register to comment.