Shop OBEX P1 Docs P2 Docs Learn Events
Java VS Basic for robots. — Parallax Forums

Java VS Basic for robots.

Kd7laxKd7lax Posts: 42
edited 2006-05-30 17:26 in General Discussion
Hey guys,

I have to do a presentation for my Java class, so I was thinking of doing one on programming robots in java compared to basic. And I am going to use my BS2 hooked up to my homemade sumo-bot for demo (people always like to see robots [noparse]:)[/noparse].
For comparison I am going to use the BS2 and the Javelin ... and was wondering if any one knows of some good articles or something that compares java to basic with robots.

Also some sample code... Maybe like a program in BASIC and a program in JAVA that do the same thing.

Any ideas for my presentation.. or good resources for information would be much appreciated.

-Mike

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-05-28 00:25
    What about comparing embedded vs. non-embedded Java? It might make more sense for those who aren't familiar with Basic.
  • Kd7laxKd7lax Posts: 42
    edited 2006-05-28 01:04
    Hmm that might be good...

    Is there much of a difference? I have never delt with embedded java before.

    thanks for the ideas!
    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit my website @ www.kd7lax.com- Devoted to ham radio
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-05-28 02:29
    Microcontrollers are frequently referred to as embedded devices, so the Javelin would be one example of using embedded Java.
  • Kd7laxKd7lax Posts: 42
    edited 2006-05-29 07:05
    Does the Javelin use JavaMe? or just a subset defined by parallax?

    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit my website @ www.kd7lax.com- Devoted to ham radio
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2006-05-29 17:42
    Just looking at the Javelin manuals, which are available from the product page
    for the Javelin module, [noparse][[/noparse]url]http://www.parallax.com/detail.asp?product_id=JS1-IC[noparse][[/noparse]/url,
    I found this little quote:
    Javelin Stamp Module manual said...
    Java Programmers – READ THIS
    The Javelin Stamp is a small yet powerful controller that makes use of a subset of Java 1.2.
    The Javelin Stamp has firmware enhancements (called Virtual Peripherals or VPs) that emulate,
    or virtualize, hardware devices such as UARTs, timers, A/D converters, D/A converters, and
    more.

    Seek and ye shall find... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-29 17:42
    The Javelin uses a subset of the JAVA Language as stated on its product page on our website.

    http://www.parallax.com/detail.asp?product_id=JS1-IC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kd7laxKd7lax Posts: 42
    edited 2006-05-30 05:53
    So is it fair to say:
    A) It takes more coding to program a microcontroller in JAVA then it does in BASIC?
    B) Java exicutes some what slower than BASIC

    I am having alot of trouble finding information about BASIC .... there is alot about java but not very much about how fast BASIC is ect.

    any way ... any information any one can give me.. in regards to JAVA VS BASIC (for robots) would be much appriceated.

    thanks
    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit my website @ www.kd7lax.com- Devoted to ham radio
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-05-30 14:06
    Kd7lax said...
    So is it fair to say:
    A) It takes more coding to program a microcontroller in JAVA then it does in BASIC?
    B) Java exicutes some what slower than BASIC

    I am having alot of trouble finding information about BASIC .... there is alot about java but not very much about how fast BASIC is ect.

    any way ... any information any one can give me.. in regards to JAVA VS BASIC (for robots) would be much appriceated.

    thanks
    -Mike

    It is not a case of "more" or "less", per se, but rather a difference in approach. In Java everything is an object- as result all code is inherently modular- The way you structure things with Java will be different- You will also be able to run 'back ground' tasks with Java, that you will have to 'hand implement' with BASIC. In that sense certain robotic functions will in fact appear to execute faster, not slower. (For example the use of background UARTS, that can be running while other tasks continue on their way...)

    Hope this helps,

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • XNORXNOR Posts: 74
    edited 2006-05-30 17:26
    I think the main difference between BASIC and Java is that BASIC is a
    "procedural" language, while Java is an "object-oriented" language.

    I found the following article helpful in illustrating the difference:

    www.cs.kent.ac.uk/pubs/2002/1517/content.pdf

    The first example is a simple robot program written in a procedural
    style, while the second example is the same program rewritten in an
    object-oriented style.

    HTH
Sign In or Register to comment.