Arrays in the DAT section
lassethomsen
Posts: 46
Hi.
I am having this very weird problem with my arrays in the DAT section.
If i use the Home array, my legs are homed as i wantede them to be.
But if i use the Blah array one legs starts with moving to a max position (Servo 01 goes to 0 value), even though Blah is a copy/paste of Home. But after one leg has moved to the max position the legs are homed.
But i comment out those two lines from the Home array
There is no problem with one legs moving to the max position before getting homed.
If i only commeny out the long $FF linie, its Servo 03 that goes to 1200.
Im communication with my Servos/legs trough the Parallax ServoController.
I have attached the full source code for the file.
To me it looks like som memory violation, but i really cant figure out where the mistake is, so can anybody help me?
I am having this very weird problem with my arrays in the DAT section.
DAT 'Home position. $FF is to mark the end of the walking table Home long $00, leg1Ground, $04, leg3Ground, $08, leg5Ground long $02, leg2Raise, $06, leg4Raise, $0A, leg6Raise long $03, leg2Home, $07, leg4Home, $0B, leg6Home long $02, leg2Ground, $06, leg4Ground, $0A, leg6Ground long $00, leg1Raise, $04, leg3Raise, $08, leg5Raise long $01, leg1Home, $05, leg3Home, $09, leg5Home long $00, leg1Ground, $04, leg3Ground, $08, leg5Ground long $FF Blah long $00, leg1Ground, $04, leg3Ground, $08, leg5Ground long $02, leg2Raise, $06, leg4Raise, $0A, leg6Raise long $03, leg2Home, $07, leg4Home, $0B, leg6Home long $02, leg2Ground, $06, leg4Ground, $0A, leg6Ground long $00, leg1Raise, $04, leg3Raise, $08, leg5Raise long $01, leg1Home, $05, leg3Home, $09, leg5Home long $00, leg1Ground, $04, leg3Ground, $08, leg5Ground long $FF
If i use the Home array, my legs are homed as i wantede them to be.
But if i use the Blah array one legs starts with moving to a max position (Servo 01 goes to 0 value), even though Blah is a copy/paste of Home. But after one leg has moved to the max position the legs are homed.
But i comment out those two lines from the Home array
long $00, leg1Ground, $04, leg3Ground, $08, leg5Ground long $FF
There is no problem with one legs moving to the max position before getting homed.
If i only commeny out the long $FF linie, its Servo 03 that goes to 1200.
Im communication with my Servos/legs trough the Parallax ServoController.
I have attached the full source code for the file.
To me it looks like som memory violation, but i really cant figure out where the mistake is, so can anybody help me?
Comments
In every other program I can find the DAT block is put at the end of the program and the labels are put as far left as possible and on the same line as the start of the block of data.
I have no idea why this might make a difference but it has got to be worth a go.
Graham
Any other ideas?
graham
Any other ideas?
At line 102 you have Walk(@Blah), but the PRI Walk method at line 114 says Walk(_Walk). Then, at line 116 you have m_Walk := @Blah; shouldn't that read m_Walk := _Walk?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
BTW: I type as I'm thinking, so please don't take any offense at my writing style
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
BTW: I type as I'm thinking, so please don't take any offense at my writing style
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
But shouldnt i could store a adressepointer to my array in a byte?
A byte will only hold a number up to 255 so it is not surprising that it wasn't man enough for the task. Hub ram is addressed by the byte so you would be up to 168 by the end of the home block.
Take a look at this thread:
http://forums.parallax.com/showthread.php?p=621981
It shows my propstick development set up, notice that I make the connection for TV using a special cable with the resistor network built in.
Graham