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

Quesion on Basic.HEX

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
6 postsPage 1 of 1
6 postsPage 1 of 1

Quesion on Basic.HEX

Post by careyg » Mon Aug 09, 2010 10:38 pm

Post by careyg
Mon Aug 09, 2010 10:38 pm

Hullo,

Am continuing to fiddle around with Basic.hex this evening (though I must iron a shirt and hit the sack soon...).

Question

is it possible, when using the SERVO command (SERVO <ID> = <POSN>) to use a variable for <ID>? Whenever I attempt this, Servo 0 moves, rather than the expected servo.

e.g. something random (and valueless...) like:

10 Let A = $rnd % 16
20 servo A=$rnd%200

will always wiggle that same leg.

I'm guessing Servo expects a constant, and the interpreter is doing its best for me and getting a 0 for A, unless i'm supposed to use a special character to dereference the value for this instruction?

Anyway, probably time to shut Huno off for the night!

Cheers,

G.
Hullo,

Am continuing to fiddle around with Basic.hex this evening (though I must iron a shirt and hit the sack soon...).

Question

is it possible, when using the SERVO command (SERVO <ID> = <POSN>) to use a variable for <ID>? Whenever I attempt this, Servo 0 moves, rather than the expected servo.

e.g. something random (and valueless...) like:

10 Let A = $rnd % 16
20 servo A=$rnd%200

will always wiggle that same leg.

I'm guessing Servo expects a constant, and the interpreter is doing its best for me and getting a 0 for A, unless i'm supposed to use a special character to dereference the value for this instruction?

Anyway, probably time to shut Huno off for the night!

Cheers,

G.
careyg
Robot Builder
Robot Builder
Posts: 21
Joined: Tue Jul 01, 2008 10:20 pm

Post by l3v3rz » Tue Aug 10, 2010 12:19 am

Post by l3v3rz
Tue Aug 10, 2010 12:19 am

Sorry. the servo id is a constant at the moment. The idea being its safer if you know which servo you are modifying. Incidentally randomly setting a servo to a random value in a loop would cause your robot to go into a 'fit'. I'd be concerned it might damage itself.

Its good to hear your having some fun and if you have any suggestion for improvements then please send and I'll see what I can do. I've just added two new commands for the next version to allow I2C devices to be read/write from Basic.

cheers
Sorry. the servo id is a constant at the moment. The idea being its safer if you know which servo you are modifying. Incidentally randomly setting a servo to a random value in a loop would cause your robot to go into a 'fit'. I'd be concerned it might damage itself.

Its good to hear your having some fun and if you have any suggestion for improvements then please send and I'll see what I can do. I've just added two new commands for the next version to allow I2C devices to be read/write from Basic.

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by careyg » Tue Aug 10, 2010 7:40 am

Post by careyg
Tue Aug 10, 2010 7:40 am

Hiya,

Yes, sorry, the random setting of servo IDs wasn't my actual intention - causing Robots to fit is, I understand, tantamount to torture, but was an easy way to demonstrate what I was trying to achieve :)

Thanks again for the effort in building this and everything else. Shall be playing with Robobuilderlib this evening I think. May even dust out the corner of my brain which holds my Lisp knowledge, I don't think it's been touched since my 2nd year at Uni about 13 years ago!
Hiya,

Yes, sorry, the random setting of servo IDs wasn't my actual intention - causing Robots to fit is, I understand, tantamount to torture, but was an easy way to demonstrate what I was trying to achieve :)

Thanks again for the effort in building this and everything else. Shall be playing with Robobuilderlib this evening I think. May even dust out the corner of my brain which holds my Lisp knowledge, I don't think it's been touched since my 2nd year at Uni about 13 years ago!
careyg
Robot Builder
Robot Builder
Posts: 21
Joined: Tue Jul 01, 2008 10:20 pm

Post by l3v3rz » Wed Aug 11, 2010 11:04 pm

Post by l3v3rz
Wed Aug 11, 2010 11:04 pm

I have added the ability to have a variable into next version .. you can now go:
10 LET A=6
20 SERVO A=124

or just
10 SERVO 6=125

next version (with more features currently under test will be out soon!)
I have added the ability to have a variable into next version .. you can now go:
10 LET A=6
20 SERVO A=124

or just
10 SERVO 6=125

next version (with more features currently under test will be out soon!)
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by careyg » Wed Aug 11, 2010 11:55 pm

Post by careyg
Wed Aug 11, 2010 11:55 pm

cool, thanks - more to play with :)
cool, thanks - more to play with :)
careyg
Robot Builder
Robot Builder
Posts: 21
Joined: Tue Jul 01, 2008 10:20 pm

Post by l3v3rz » Sun Aug 15, 2010 8:03 pm

Post by l3v3rz
Sun Aug 15, 2010 8:03 pm

New version of BASIC with the update to SERVO is now available for download. If you do download, try this out:

Code: Select all
10 LET P=$PSD
20 LIGHTS P-10
30 GOTO 10


This turns the LIGHTS on back of the robot into a distance meter, light full on - nothing ahead, but as an object approaches they go out.

For more complex demos -
http://code.google.com/p/robobuilderlib/wiki/BasicDemos

My current favorite is the mirror moves.

cheers
New version of BASIC with the update to SERVO is now available for download. If you do download, try this out:

Code: Select all
10 LET P=$PSD
20 LIGHTS P-10
30 GOTO 10


This turns the LIGHTS on back of the robot into a distance meter, light full on - nothing ahead, but as an object approaches they go out.

For more complex demos -
http://code.google.com/p/robobuilderlib/wiki/BasicDemos

My current favorite is the mirror moves.

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm


6 postsPage 1 of 1
6 postsPage 1 of 1