Shop OBEX P1 Docs P2 Docs Learn Events
Creating a GUI? — Parallax Forums

Creating a GUI?

wicklewickle Posts: 6
edited 2013-07-28 10:00 in BASIC Stamp
Hey guys, I recently purchased a BOE-BOT, with the QTI line followers. And I have been making a line follower robot with a few extra commands, i would like to make a GUI that I can use on my computer to interface with the boebot, rather then just the debugger on the basic stamp program. What program can I use to create a GUI for the basic stamp?

Comments

  • DaveJensonDaveJenson Posts: 375
    edited 2013-07-15 09:58
    Any program that you can write with Serial interface.

    Visual Basic is popular.

    It just depends on your level of comfort and which languages you know....
  • SRLMSRLM Posts: 5,045
    edited 2013-07-15 10:20
    I like Python for that using the pyserial library. Here is a GUI a friend and I made:
  • wicklewickle Posts: 6
    edited 2013-07-22 14:49
    DaveJenson wrote: »
    Any program that you can write with Serial interface.

    Visual Basic is popular.

    It just depends on your level of comfort and which languages you know....

    My brains curiosity has had me dabble in small bits of different types of languages before, mostly C, and a bit of java. I have created some very basic GUI's with java where I created a few buttons and gave them some basic functions and outputting a very basic arithmetic function of sorts.

    With what I know, you create the buttons and layout of the gui then add the functionality to the button and other things to be used by the user. Am I correct in saying that?

    Also, the BoE with the basic stamp 2 module would I be able to use something like netbeans? Would it be able to compile the basic stamp code?
  • SRLMSRLM Posts: 5,045
    edited 2013-07-22 21:38
    The only connection that a GUI on the computer has with your BS2 is via a serial link. You don't (and can't) program the BS2 with netbeans, and the BS2 doesn't have (and can't have) a GUI.

    GUI's typically follow the Model-View-Controller framework, and that's how Java Swing is built. That's essentially what you described (adding functionality to a button).
  • wicklewickle Posts: 6
    edited 2013-07-23 17:50
    SRLM wrote: »
    The only connection that a GUI on the computer has with your BS2 is via a serial link. You don't (and can't) program the BS2 with netbeans, and the BS2 doesn't have (and can't have) a GUI.

    GUI's typically follow the Model-View-Controller framework, and that's how Java Swing is built. That's essentially what you described (adding functionality to a button).

    so its not possible to create a GUI for the boebot?
  • FranklinFranklin Posts: 4,747
    edited 2013-07-23 18:17
    so its not possible to create a GUI for the boebot?
    What do YOU mean by GUI? It is most definitely possible to build a GUI to control the BOEBot just follow the advice of the other posters.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-23 20:30
    It certainly is possible to create a GUI for the BoeBot. Instead of the PC program directly controlling the BoeBot's motors and directly sensing the BoeBot's sensors, the PC program sends commands to the BoeBot to move the motors and sends commands to the BotBot asking it to respond with the status of the various sensors on the BoeBot (like the IR distance sensors). The commands can be as simple as R750 or L750 to do a PULSOUT <pin>,750 to one or the other wheel servo motors or D for the BoeBot to determine the distances on the right and left using the IR sensors and to send both back to the PC as numbers with a comma in between.
  • ercoerco Posts: 20,256
    edited 2013-07-23 21:14
    Phorumista PhiPi made a nice GUI for the Scribbler, Boebot's cousin. Won't work easily on Boebot, though.

    http://www.parallax.com/tabid/458/Default.aspx
  • wicklewickle Posts: 6
    edited 2013-07-24 16:34
    Franklin wrote: »
    What do YOU mean by GUI? It is most definitely possible to build a GUI to control the BOEBot just follow the advice of the other posters.

    It probably would have been a good idea to describe more in detail what I am trying to do.. sorry about that let me go in to a little more detail.



    So I have my boebot programed and working to navagate as a linefollower through my hallway, and depending on a variable in the program its self it goes in to a certain room (ex. variable set to 1, goes in to the first room, set to 2 goes in to the second room.. etc) now each time i want to run the boe bot i have to change the value in the program its self.

    What i would like to do is create a very basic GUI window with a few buttons, and say have one button send the value of 1 to the variable and run the program with that, a second button send the value to 2 to the variable and progress with that.


    I hope that was enough of a description for you guys to get a little more of a feel for what im trying to do, I was thinking of using VB to create the GUI window from what I have been reading from you guys and my researching on the internet. But Im sure i cant just copy over my code from basicstamp over to VB, and expect it to understand it. What would I need to do to get my code from basic stamp to work in VB?
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-24 16:49
    "What would I need to do to get my code from basic stamp to work in VB?" - a lot of work and trying to do that is just the wrong way to go about this.

    What you need is a GUI on the PC, written in VB or something similar. The selected value (1, 2, 3, ...) gets transmitted to the BoeBot as a byte of data whenever the BoeBot asks for it (by transmitting some character you've chosen). You have to modify your BoeBot program to send a character you've chosen to the PC whenever it needs to know where to go next and then the BoeBot waits for a response from the PC with the value of the new destination.

    In other words, the BoeBot program, at the point where it would normally check the variable would do something like:

    DEBUG "?" ' Send a question mark followed by a carriage return
    DEBUGIN DEC dest ' Wait for a number followed by a carriage return, store in variable dest

    The VB program would have to look for a question mark followed by a carriage return. Once found, it would transmit the number most recently chosen as a sequence of digits followed by a carriage return
  • FranklinFranklin Posts: 4,747
    edited 2013-07-25 09:03
    What i would like to do is create a very basic GUI window with a few buttons, and say have one button send the value of 1 to the variable and run the program with that, a second button send the value to 2 to the variable and progress with that.
    Are you talking about an LCD display and buttons on the BoEbot rather than a tethered cable to your pc? If that is what you want it's called a menu and that can be done fairly easy if you keep it simple. Several people have done this and you should be able to search the forums for threads.
  • wicklewickle Posts: 6
    edited 2013-07-27 21:15
    Franklin wrote: »
    Are you talking about an LCD display and buttons on the BoEbot rather than a tethered cable to your pc? If that is what you want it's called a menu and that can be done fairly easy if you keep it simple. Several people have done this and you should be able to search the forums for threads.

    Sort of, I don't want an onboard LCD I just want a simple interface on the pc. I found this link just now http://www.andrew.cmu.edu/user/schapiro/documents/VB2bb.pdf

    Looks exactly what I'm trying to do create a small GUI window to send commands to the boe bot. I have not yet read the link, just found it but about to head to work I hate working grave yard :(

    Let me know what you guys think of that link
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-28 06:36
    That article is essentially what we've been talking about.
  • John BoardJohn Board Posts: 371
    edited 2013-07-28 07:01
    Gosh... This brings back memories! I remember the days when I made GUIs for my boebot using VB 5! For the most part I just used the serial "object", and communicated with simple instructions, mainly just single integers.

    In later days when was/am using python more often, as was mentioned earlier, I/we used pyserial, which is quite a reasonable option.

    Anyway, from what I've read of that doc (not much), it seems fairly decent, and I hope you all the best!
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2013-07-28 10:00
    This has been done in these forums at this link http://forums.parallax.com/showthread.php/96973-VB-Express-to-Stamp-Template

    Jeff T.
Sign In or Register to comment.