Shop OBEX P1 Docs P2 Docs Learn Events
Programming Language and Syntax and response to my posting code. — Parallax Forums

Programming Language and Syntax and response to my posting code.

paulvivepaulvive Posts: 35
edited 2012-01-15 15:38 in General Discussion
Back in 1980 when I first started with computers and programming languages it seemed easier because I knew what I wanted the computer to do and I knew what I wanted to see on the computer screen and I was able to learn the syntax that was necessary to do it. There were manuals that you could learn the language and syntax from. There weren’t any “GUI’s” only DOS to work with.. I don’t know the syntax of Pbasic, yet, and I don’t know what the Robot or Robotic module is looking for and if I did I wouldn’t know how to provide it. I‘m used to reading a manual of whatever I wanted to learn. Learning it, understanding it and being able to use it . I’m having a difficult time with the Pbasic syntax, I don’t know it and I haven’t found a Book to learn it from. I can’t learn it from bits and pieces of programs, although there are parts that I do recognize there is a lot that I don’t. Maybe I’m missing the fact that there is a manual for Pbasic as there was for Ancient Basic and visual basic and other languages that I learned from reading a book. If so, I would appreciate knowing where to find it. A lot of guys have been a great help in helping me to get started in Robotics and I really appreciate it. I have to admit, but I don’t intend it to be an excuse, but I’m 80 years old and my brain doesn’t work as well as it used to but I don’t intend to just sit in a rocking chair. I just wanted to say I really appreciate all of you for trying to work with me.

To some of the more recent replies about posting. I swear I used the right brackets, maybe I need glasses better than WalMart.

Comments

  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-01-15 06:46
    If you don't have a copy of the Basic Stamp Syntax and Reference Manual, you can download the book in PDF format free of charge from Parallax. Sounds like that may be just the ticket for you. Also Parallax has a lot of other learning resources available.

    Doc


    Here is the link to the BASIC Stamp Documentation Downloads page: http://www.parallax.com/tabid/440/Default.aspx

    and the PDF of the manual: http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-01-15 06:59
    Also, in the Basic Stamp Editor there is online help within the program itself.

    In this first screenshot - notice the icon of a book with a yellow question mark on the far right of the tool bar: Clicking that will open the online help for Pbasic syntax:

    toolbar.png


    The window should look like this (depending on your version of OS:

    pbasic_help.png



    Hope this is helpful!

    Doc
  • paulvivepaulvive Posts: 35
    edited 2012-01-15 09:47
    Thanks. I guess I have a lot more reading to do.
    One more question, once I learn and understand Pbasic I still have to know what inputs a particular Module or function needs so I know what to program. Foe example the SAY IT module. Wouldn't I need to know what inputs it needs to operate. Again the difference in writing a program for a computer it doesn't need anything but what I want it to have via my programming whereas a robot needs or looks for specific inputs which your program must provide. If I'm way off track here you won't hurt my feelings by telling me so, right now I feel stupid anyway. Thanks again for your input.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-15 14:10
    Paul,

    I just want to make sure you have the SayIt documentation from the product page. The document 30080_SayItModulev1.2.pdf has all the SayIt commands listed, starting on page 15. I personally didn't understand the syntax of the SayIt so I "listened in" on the data exchange between the Prop and the SayIt GUI.

    This is one exchange I recorded.
    Say It: A
    PC: lB                         ' set language to Italian
    Say It: o
    PC: lA                         ' set language to English
    Say It: o
    PC: gQA                        ' enter new password command
    Say It: o
    PC: nQAHZEBULUN                ' enter password text
    Say It: o
    PC: eQA
    Say It: o
    PC: tQA                        ' train password 1st time
    Say It: o
    PC: eQA                        ' cancel train password
    Say It: o
    PC: eQA                        ' ?
    Say It: o
    PC: tQA                         ' train password 1st time
    Say It: o
    PC: tQA                         ' train password 2nd time
    Say It: o
    PC: dQ                          ' test password group
    Say It: r
    PC:
    Say It: A                       ' the password "ZEBULUN" reconized
    PC: gBA
    Say It: o
    PC: nBAIPASSWORD
    Say It: o
    PC: eBA
    Say It: o
    PC: tBA                        ' train "password"(index 0) 1st time (group 1)
    Say It: o
    PC: tBA
    Say It: o
    PC: gBB                        ' "password" reconized
    Say It: o
    PC: nBBKCALCULATOR
    Say It: o
    PC: eBB
    Say It: o
    PC: tBB                       ' train "calculator" 1st time (group 1)
    Say It: o
    PC: tBB                       ' train "calculator" 2nd time (group 1)
    Say It: e                     ' error
    PC:
    Say It: B
    PC:
    Say It: B
    PC: eBB 
    Say It: o
    PC: eBB
    Say It: o
    PC: tBB                       ' train "calculator"(index 1) 1st time (group 1)
    Say It: o
    PC: tBB                       ' train "calculator"(index 1) 2nd time (group 1) 
    Say It: o
    PC: gBC
    Say It: o
    PC: nBCGDIGITS
    Say It: o
    PC: eBC
    Say It: o
    PC: tBC
    Say It: o
    PC: tBC
    Say It: o
    PC: gBD
    Say It: o
    PC: nBDEPLUS
    Say It: o
    PC: eBD
    Say It: o
    PC: tBD
    Say It: o
    PC: tBD
    Say It: o
    PC: gBE
    Say It: o
    PC: nBEFMINUS
    Say It: o
    PC: eBE
    Say It: o
    PC: tBE
    Say It: o
    PC: tBE
    Say It: o
    PC: gBF
    Say It: o
    PC: nBFGEQUALS
    Say It: o
    PC: eBF
    Say It: o
    PC: tBF
    Say It: o
    PC: tBF
    Say It: e
    PC:
    Say It: B
    PC:
    Say It: B
    PC: eBF
    Say It: o
    PC: eBF
    Say It: o
    PC: tBF
    Say It: o
    PC: tBF
    Say It: o
    PC: gBG
    Say It: o
    PC: nBGFTIMES
    Say It: o
    PC: eBG
    Say It: o
    PC: tBG
    Say It: o
    PC: tBG
    Say It: o
    PC: gBH
    Say It: o
    PC: nBHKDIVIDED_BY
    Say It: o
    PC: eBH
    Say It: o
    PC: tBH
    Say It: o
    PC: tBH
    Say It: o
    PC: gBI
    Say It: o
    

    You can see I added some comments after some of the early commands. It helped be to understand how to use the various commands after seeing the commands the PC issued to the SayIt.

    If you look at the replies from the SayIt, there are many "o" replies. Page 18 of the pdf has STS_SUCCESS | "o" | OK or no error status |. The other codes in the above exchange can also be found in the pdf. This helped me undstand the syntax better. Hopefully it will be helpful to you.

    One concept that took a while to get into my head was that the SayIt only listens for one group of words at a time. Your program has to tell it which group you want to be active.

    I thought Dave Xanatos did a great job explaining this.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2012-01-15 15:18
    Hi paulvive, it can be frustrating to the point you think it will never come but then it clicks. The help file in the IDE that doggiedoc pointed out is a great resource and full of examples. Copying simple examples found on these forums will also help. Any questions you have post them here no one is going to deem you stupid for asking a question, we all have questions to ask not matter what level were at.

    Keep practicing, over 50% of the PBasic instructions can be run without the need for any hardware whatsoever. Use DEBUGIN to enter values and DEBUG to view results. When it comes time you want to use some kind of hardware device just remember that the BS2 family are 5v devices with limits on their current capacity. Some devices just use on off values of either 5v or 0v respectively, more complex devices still use the Stamps 5v - 0v logic levels but usually there is some kind of communications needed. If its a Parallax device you can be certain example code exists, if its a third party device a good data sheet will help decide if it can be used with the Stamp.

    There are not many 80 year old Stampers and I respect you all for keeping sharp.

    Jeff T.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-15 15:38
    paulvive wrote: »
    I’m 80 years old

    Heck, this makes Leon seem like a spring chicken of only 69 years.
Sign In or Register to comment.