Shop OBEX P1 Docs P2 Docs Learn Events
getChar() does not work on USB BoE with Javelin stamp — Parallax Forums

getChar() does not work on USB BoE with Javelin stamp

GlennMayerGlennMayer Posts: 2
edited 2006-05-26 09:52 in General Discussion
I have been using BoeBots with Javelin stamps for the past several·year or so. The last batch of robots that I purchased had the USB version of the BoE. I have never been able to get the getChar() function working with the USB version of the BoE. The Parallax support personnel have not been able to help with the problem. When I use something like the following line

robotID=Terminal.getChar();········· // get the new ID

the program will simply wait forever no matter how many characters you hit on the keyboard. The same code works just fine with the serial version of the BoE.
Any ideas on what I might try to get it working?

Thanks

Glenn Mayer

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-02 20:24
    Get "JideWin Terminal.zip" and test.jcf and JideTerm_test.java from here:
    http://groups.yahoo.com/group/JavelinCode/files/JideTerm/

    JideWinTerminal is a windows standalone Jide Message Program that allows to
    send *.jcf files. A.jcf file (Javelin Command File)·is just a text file that is to be parsed by
    the javelin.

    See if that works.

    regards peter
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-05-02 20:39
    GlennMayer,

    We are working on updating the Javelin IDE- this is a known issue with USB connectivity.

    Ryan

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

    RClarke@Parallax.com
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-02 21:12
    I just updated JideTerm_test.java
    You also need the JideTerm class.
    Both JideTerm.java and JideTerm_test.java are here:
    http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/core/

    The JideTerm class allows to parse strings into substrings, much like
    parsing a dos command line.

    regards peter
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-11 01:21
    Hello Peter,·please forgive me if my questions are off target.· I am new to this platform, Java and everything else.·

    After some work I was able to get the code you posted to compile and download.· From what I can tell it still hangs at the getChar() call.· I am wondering if you have any more insight to add to the problem?

    Thanks,

    Michael
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-11 06:03
    If you downloaded JideTerm_test.java succesfully to the Javelin,
    the Jide message windows opens and you will get lines like
    count = 1
    count = 2
    etc.
    approx. one new line per second.
    Now close the Jide message window and close the IDE program.
    Start the JideWinTerminal program, select the com port that was
    used to program the javelin, and click start.
    Then you should see the same count lines appear.
    Click on the Send File button and select the test.jcf file
    Now you should see the text from the jcf file, possibly interrupted
    by count lines.

    I just programmed my javelin with a serial connection.
    Then ran the JideWinTerminal program with the Javelin IDE port
    connected to my usb2serial cable. The javelin then performs
    as if it had a serial connection.

    Have you done it exactly as I described here?
    What is your output? (you must at least get the count lines)

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-11 06:15
    Here is my output in the JideWinTerminal program:

    JideTerm test program
    count = 0
    count = 1
    CMD: #Javelin JideTerm Command File
    ·· : #Javelin
    ·· : JideTerm
    ·· : Command
    ·· : File
    CMD: command 1
    ·· : command
    ·· : 1
    CMD: command 2
    ·· : command
    ·· : 2
    CMD:
    CMD:
    CMD: #end of file
    ·· : #end
    ·· : of
    ·· : file
    count = 2
    count = 3

    regards peter
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-12 15:13
    Hello Peter,

    I want to thank you for your help.· That is one impressive collection of code that you have assembled.

    My first chance to look at this again will be·Sunday.···Hopefully I can figure something out.

    Thanks, Michael
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-16 23:51
    Hello Peter,

    Here is the output from the JideWinTerm log.· I attempted to send the test.jcf right after count = 2.· I think I am doing everything right.· The board programs just fine, which would seem to exonerate the communication parameters.· However just to be safe I played extensively with the Latency Timer setting as well as the transmit and receive buffers.· I also tried to run JideWinTerm on a different system, with no improvment.

    Michael

    JideTerm test program
    count = 0
    count = 1
    count = 2
    count = 3
    count = 4
    count = 5
    count = 6
    count = 7
    count = 8
    count = 9
    count = 10
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-17 00:15
    I hoped my JideWinTerminal, programmmed in Visual c#, would make
    a difference to the Javelin IDE message window (Borland C++ builder6).
    Apparently, the issue is with the Boe usb version, as Ryan said in
    an earlier post. Can't do much about that but waiting for the
    new IDE Ryan said they are working on.
    Don't you have another board that can be used
    (like the Javelin demoboard)?

    regards peter
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-17 22:01
    Thanks Peter.

    I had come to the same conculsion as you. I spoke to one of the Parallax engineers and he seemed concerned that I might have issues with latency or buffer sizes in the USB driver. Am I correct in concluding that basic communication must be working if (as I have already done) I can download and run many of the examples you have provided?

    I did consider using the Javelin Demo Board but it seemed expensive for my simple application. I am attempting to create a motor speed controller with safety stops. The host system is designed to send commands to the Javelin telling it what speed to run the motor and the Javelin is to provide some measure of safety should the host become incapacitated for any reason. I only need a handful of commands to make it work.

    Would the Javelin demo board be a better choice than say the Super Carrier Board (stock# 27130)? I am assuming that any board with a serial port will work where the USB did not. I guess I should ask, am I safe in that assumption?

    Thanks again,

    Michael
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-17 22:11
    You are right. Any board that accepts a 24pin basic stamp module
    will also accept a javelin.
    If you want to communicate with a pc program other than
    the Jide Message Window or my JideWinTerminal program,
    then you need a level shifter TTL to RS232.
    The javelin demoboard http://www.parallax.com/detail.asp?product_id=550-00019
    has this onboard, but you can also
    add a dce appmod http://www.parallax.com/detail.asp?product_id=29120
    to any other board (you can add a dce appmod to your usb board).
    You then use uart objects to communicate rather than getChar() and System.out.print().

    regards peter
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-17 22:30
    Hmmm, I hadn't thought about a second communication port. Am I overlooking something? Given my limited communication needs and assuming that getChar() is sufficient, I figured that the programming port would be all I'd need.

    I guess it was the USB port that steered me to where I am. None of my laptops have a built in serial port. Of course I can use a converter, but it would be darned nice if I can plug any handy computer in and control my motor as I envision. I would hate to give up that flexability.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-17 22:45
    If you have a serial-based board plus a usb2ser cable,
    you get the same functionality, but with a working
    usb connection.
    regards peter
  • New teacherNew teacher Posts: 4
    edited 2006-05-25 12:39
    Hello mjj0000,

    Your first post in this thread mentioned programming Javelin based Boe-Bots for some time.

    Question 1:

    I was thinking of migrating my collection of ·PBASIC 2.5 code to the Javelin,· but I would need simple examples to get started interacting with the servos and the IR LEDs.

    Can you send me an attachment with some sample programs?·· I have programmed in Java off and on for about six or seven years, so in theory I can understand them.

    I teach OOP using Java to grade 12 students ( seniors ) whenever I can assemble a small group for a "class out of school time".· I think OOP is a better way to look at programming if·it is available to code·any particular problem - ie. robots.

    Also can you point me towards any reference manuals that I may have missed or skimmed too quickly.

    Question 2:
    I have read power supply discussions in the Javelin forum.· There appears to be a need for more voltage than the Boe-Bot's power pack of 4 AA batteries can supply.· How is an untethered Boe-Bot powered when using a Javelin stamp in place of the BS2 IC?
    Between yourself and Peter there seems to be a wealth of knowledge. freaked.gif
    I think newbies like myself need to spend numerous hours immersed in Javelin code before we can fully understand your posts.

    Richard Bowen
    St. John High
  • mjj0000mjj0000 Posts: 6
    edited 2006-05-25 12:58
    Hello Richard, I think you are confusing me with Glenn.· However, I agree with your sentements.· If you look at Peter's code, he has many examples.· I am almost certain you will find what you need.

    http://groups.yahoo.com/group/JavelinCode

    Michael
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-05-25 18:32
    You can run a Javelin based BOE bot off of the original battery pack- you do however drain the batteries faster.

    Teaching OOP via Java is fine, if the students already have a concept of what objects are; since everything in Java is an object, a concept of what that actually means is paramount .

    Ryan

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

    RClarke@Parallax.com
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-26 09:52
    Code for the javelin based boebot is located here:
    http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/JBot/

    There is lots of reading material in this package.

    regards peter
Sign In or Register to comment.