Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Newbie question about PEEK function

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
5 postsPage 1 of 1
5 postsPage 1 of 1

Newbie question about PEEK function

Post by tminionman » Mon Feb 18, 2008 9:20 pm

Post by tminionman
Mon Feb 18, 2008 9:20 pm

Hi everyone,

I just got a Robonova, and I'm evaluating it for my adviser as a possible soccer-playing robot for our school. I've been trying implement real-time control by sending data over serial to a PC, and having the PC respond with a set of servo positions.

My question is, how do I PEEK the RAM location where the gyro data is stored? One of the topics mentioned that it was stored at 1328-1331, but RoboBasic won't let me PEEK any ram location above 255.

If anybody has done this or can offer any insight, I'd really appreciate it. Thanks!
Hi everyone,

I just got a Robonova, and I'm evaluating it for my adviser as a possible soccer-playing robot for our school. I've been trying implement real-time control by sending data over serial to a PC, and having the PC respond with a set of servo positions.

My question is, how do I PEEK the RAM location where the gyro data is stored? One of the topics mentioned that it was stored at 1328-1331, but RoboBasic won't let me PEEK any ram location above 255.

If anybody has done this or can offer any insight, I'd really appreciate it. Thanks!
tminionman
Newbie
Newbie
Posts: 5
Joined: Mon Feb 18, 2008 9:16 pm

Post by i-Bot » Mon Feb 18, 2008 10:33 pm

Post by i-Bot
Mon Feb 18, 2008 10:33 pm

There is no problem to PEEK all the RAM locations. And your address is correct

Can you post our code, so we can have a look at your problem ?
There is no problem to PEEK all the RAM locations. And your address is correct

Can you post our code, so we can have a look at your problem ?
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by tminionman » Mon Feb 18, 2008 10:55 pm

Post by tminionman
Mon Feb 18, 2008 10:55 pm

Here is the code I'm trying to test with:


DIM B AS INTEGER
DIM A AS INTEGER

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0

'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0
GYROSET G6A,0,1,0,0,0,0
GYROSET G6D,0,1,0,0,0,0
GYRODIR G6A,1,1,1,1,1,1
GYRODIR G6D,0,1,0,0,0,0
GYROSENSE G6A,0,70,0,0,0,0
GYROSENSE G6D,0,70,0,0,0,0

SPEED 5

'== motor power on =============================
MOTOR G24

GOSUB standard_pose

'================================================
MAIN:

'GOSUB transmit_start
GOSUB transmit_data
'GOSUB transmit_done
GOTO MAIN
'================================================

transmit_data:
A=1328
B=PEEK(A)
ETX 57600, B
RETURN

'================================================

standard_pose:

MOVE G6A,100, 80, 145, 93, 100, 100
MOVE G6D,100, 80, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT

RETURN
'================================================

The red highlighted text is the statement giving me trouble. I'm running RoboBasic 2.5 (English), and the compile command returns an "[Assign(=)]Can't use integer type" error.
Here is the code I'm trying to test with:


DIM B AS INTEGER
DIM A AS INTEGER

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0

'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0
GYROSET G6A,0,1,0,0,0,0
GYROSET G6D,0,1,0,0,0,0
GYRODIR G6A,1,1,1,1,1,1
GYRODIR G6D,0,1,0,0,0,0
GYROSENSE G6A,0,70,0,0,0,0
GYROSENSE G6D,0,70,0,0,0,0

SPEED 5

'== motor power on =============================
MOTOR G24

GOSUB standard_pose

'================================================
MAIN:

'GOSUB transmit_start
GOSUB transmit_data
'GOSUB transmit_done
GOTO MAIN
'================================================

transmit_data:
A=1328
B=PEEK(A)
ETX 57600, B
RETURN

'================================================

standard_pose:

MOVE G6A,100, 80, 145, 93, 100, 100
MOVE G6D,100, 80, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT

RETURN
'================================================

The red highlighted text is the statement giving me trouble. I'm running RoboBasic 2.5 (English), and the compile command returns an "[Assign(=)]Can't use integer type" error.
tminionman
Newbie
Newbie
Posts: 5
Joined: Mon Feb 18, 2008 9:16 pm

Post by i-Bot » Tue Feb 19, 2008 11:10 am

Post by i-Bot
Tue Feb 19, 2008 11:10 am

I am using version 2.5.61, and it compiles OK. What version are you using (check help-about).

B should be a BYTE
I am using version 2.5.61, and it compiles OK. What version are you using (check help-about).

B should be a BYTE
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by tminionman » Tue Feb 19, 2008 4:39 pm

Post by tminionman
Tue Feb 19, 2008 4:39 pm

Well, after downloading 2.5.61, it compiles for me as well. I guess the CD version was a few revisions behind. Thanks a lot for your patience...this is why I'm a noob, I guess :).
Well, after downloading 2.5.61, it compiles for me as well. I guess the CD version was a few revisions behind. Thanks a lot for your patience...this is why I'm a noob, I guess :).
tminionman
Newbie
Newbie
Posts: 5
Joined: Mon Feb 18, 2008 9:16 pm


5 postsPage 1 of 1
5 postsPage 1 of 1