Shop OBEX P1 Docs P2 Docs Learn Events
Download PropBASIC here... 00.01.14 LAST VERSION FOR BST - Page 10 — Parallax Forums

Download PropBASIC here... 00.01.14 LAST VERSION FOR BST

17810121329

Comments

  • Mike HuseltonMike Huselton Posts: 746
    edited 2010-02-17 05:51
    Sapieha

    I see no error.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • SapiehaSapieha Posts: 2,964
    edited 2010-02-17 05:59
    Hi BradC.

    error:0 "Work can't be ended."

    Mike. I RUN Swedish version of XP and had many problems with programs that not suport correctly international subset of Fonts else other programing conventions.

    Regards
    Christoffer J

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • Mike HuseltonMike Huselton Posts: 746
    edited 2010-02-17 06:03
    Sporadically, this appears as code pollution: "PROGRAM Start LMM"

    Apparently the program couldn't resolve "LMM"

    Guess I'll have to test each example for Before/After garbage. Maybe it only it exists on my machine?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • BeanBean Posts: 8,129
    edited 2010-02-17 12:14
    Mike Huselton said...
    Sporadically, this appears as code pollution: "PROGRAM Start LMM"

    Apparently the program couldn't resolve "LMM"

    Guess I'll have to test each example for Before/After garbage. Maybe it only it exists on my machine?

    Mike,
    · Oops, that was me testing a future feature of the compiler.
    · I'll re-post the demo program after I remove that.


    P.S. I have re-posted the demos.zip file.·Also please download version 00.00.82 of the compiler. There were a couple bugs that we found in the·previous versions.

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/17/2010 12:34:19 PM GMT
  • Mike HuseltonMike Huselton Posts: 746
    edited 2010-02-17 17:53
    Sapieha,

    I lived in Gothamberg for about a year on a robotics project. Very cozy...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • Tony B.Tony B. Posts: 356
    edited 2010-02-18 04:21
    Wanted to say thanks again for all the work on PropBASIC.

    I have been able to move along learning syntax and coding methods by working with a Spin Stamp on a Board of Education. I've attached my simple test program for using three cogs to blink a LED, drive a servo, and send a string to a serial LCD panel.

    Want to say thanks for all the demo programs. They helped solve a couple of sticking points.

    Hope this helps encourage other to join the PropBASIC community by starting with the simple things first.

    Please note if you are going to work with the Spin Stamp you must change the "Device Settings" section to read in this way

    DEVICE          P8X32A, XTAL1, PLL8X
    XIN             10_000_000
    
    



    Tony
  • BeanBean Posts: 8,129
    edited 2010-02-18 12:58
    Tony,
    · Yes, your code looks very good. You clearly have a good handle on PropBASIC.

    · Nice job!

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/18/2010 7:13:47 PM GMT
  • Christof Eb.Christof Eb. Posts: 1,103
    edited 2010-02-18 19:04
    Hi BradC, hi Bean,

    thanks for the new IDE!!! I got it working with Windows 7. At the beginning it did find the prop on port 3 but it still tried to load to port 1. I can't repeat this after I went to IDE preferences.

    Bean, I see that it was not yet possible to change rdword in such way, that it works with signed numbers. Because everything else works with signed numbers, this is in my opinion either a bug or at least a trap. I would suggest to mention it clearly (with workaround?) in your PDF.

    Thanks alot, this is a great tool, I will test it hopefully more at weekend.

    Christof
  • Tony B.Tony B. Posts: 356
    edited 2010-02-18 20:40
    Bean,

    Thanks for the encouragement!

    I will post my code as I get PropBASIC to work with individual Parallax components and then using them in a working robot.

    I've really enjoyed working with PropBASIC.

    Tony
  • Tony B.Tony B. Posts: 356
    edited 2010-02-19 05:09
    Have a very simple program for controling one servo thru a Prop Servo Controller board using a Spin Stamp on BOE

    Since SEROUT can send only one Byte at a time, I worked on my first solution tonight. My solution so far was to hard code, in a data section, each byte and then read and send each of the eight bytes needed for the Controller based on the Communication Protocol on page four.

    It workssmile.gif , but is far from usable now especially with 16 channels! sad.gif

    Helpful suggestions would be appreciated on improving the code.

    I will keep working on it as well and will post better solutions as I discover them or implement helpful suggestions. This is fun problem solving unlike the many hours lost trying to discover why something doesn't work just to find one wire is plugged into the wrong hole in the breadboard and you just KNEW it wasn't your fault, but bad components.tongue.gif

    Tony
  • BeanBean Posts: 8,129
    edited 2010-02-19 12:55
    Here is how I would do it.
    I hope you get some ideas from it.

    Bean


    [noparse][[/noparse]edit] Fixed "<< 8" should have been ">> 8" Feb 21, 2010

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/21/2010 9:28:32 PM GMT
  • Tony B.Tony B. Posts: 356
    edited 2010-02-19 13:58
    Thanks Bean,

    My code is the result of getting stuck in a one track mind. Thought since SEROUT send one byte at a time had to break up "!SC" into individual bytes. DAH! It takes three bytes to store it blush.gif

    I'll try to be a little sharper next time I post code.

    Thanks for taken the time to rewrite the code. Hope to work with it tonight.

    Tony
  • JonnyMacJonnyMac Posts: 8,924
    edited 2010-02-19 16:38
    Tony,

    You might consider a custom subroutine to update a channel -- something like this:

    ' Use: TX_PSC chan, speed, position
    
    SUB TX_PSC
      chan          VAR     Long
      speed         VAR     Long
      pos           VAR     Long
    
      chan = __param1
      speed = __param2
      pos = __param3
    
      TX_STR  "!SC"                                 ' header
      TX_BYTE chan
      TX_BYTE speed
      __param1 = pos & $FF                          ' extract low byte
      TX_BYTE __param1
      __param1 = pos >> 8                           ' extract high byte
      TX_BYTE __param1
    
      ENDSUB
    
    ' ----------------------------------------------------------------------
    
    ' Use: TX_STR strpntr
    ' -- transmits a z-string at strpntr
    ' -- uses TX_BYTE
    
    SUB TX_STR
      strpntr       VAR     __param2
      strchar       VAR     __param3
    
      strpntr = __param1
      DO
        RDBYTE strpntr, strchar
        IF strchar = 0 THEN EXIT
        TX_BYTE strchar
        INC strpntr
      LOOP
      ENDSUB
    
    ' ----------------------------------------------------------------------
    
    ' Use: TX_BYTE char
    ' -- shell for SEROUT
    
    SUB TX_BYTE
      SEROUT TX, Baud, __param1
      ENDSUB
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-02-19 19:43
    My new prop computer is now completed and
    programming with PropBASIC is working excellent!

    humanoido
  • Brian RileyBrian Riley Posts: 626
    edited 2010-02-20 05:02
    I found Tony's MultiCogTest very helpful for myself and multi-cog in PropBasic. I made some mods to it and applied some of JonnyMac's template routines, discovered a bug in Bean's compiler, and tripped over few gotcha's along the way to this enlightenment. I have uploaded my version of it here as "MultiCogTest2.pbas"

    Now in PropBasic-BST we allow template files ... and, again, starting with JonnyMac's I added a series of SUBs to talk to a serial LCD device. The command set I used was compatible with any serial LCD board using the PH Anderson chip like my K107 (www.wulfden.org/TheShoppe/k107/about.shtml) or Modern Devices, or a couple of Australian companies whose names escape me at the moment. But with simple examination it will be obvious what needs to be done for your particular serial LCD. The template file is called "template_lcdbbr.pbas"

    Most serial LCDs have a myriad of commands and you really chew up code space implementing them all as SUBs, you must analyze your needs an decide which commands are worth making into separate SUBs and which you invoke using the general LCD_STR "string". Foremost of the several reasons I so strongly favor the Anderson chip is that its command sequences are ALL printable ASCII, so any command can be issued with a generic 'print' command.

    cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
  • BeanBean Posts: 8,129
    edited 2010-02-20 15:54
    Brian,
    · Very cool.
    · One suggestion... Instead of

      DO WHILE __param2 > 0
        SEROUT LCD, LCDBaud, __param1
        DEC __param2
      LOOP
    
    

    ··· You can use
      DO
        SEROUT LCD, LCDBaud, __param1
      LOOP __param2
    
    


    · As long as __param2 is greater than zero.

    ·This form of DO...LOOP uses DJNZ so it produces very tight code.

    · I assume the device you are sending the ?n to does the conversion to a newline ?

    Bean


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/20/2010 4:01:22 PM GMT
  • Brian RileyBrian Riley Posts: 626
    edited 2010-02-20 22:30
    Bean said...
    Brian,
    Very cool.

    One suggestion... Instead of

      DO WHILE __param2 > 0
        SEROUT LCD, LCDBaud, __param1
        DEC __param2
      LOOP
     
    
    



    You can use

      DO 
    
        SEROUT LCD, LCDBaud, __param1
      LOOP __param2
     
    
    



    As long as __param2 is greater than zero.

    This form of DO...LOOP uses DJNZ so it produces very tight code.

    I assume the device you are sending the ?n to does the conversion to a newline ?

    Bean


    OK ... first of all, blame JonnyMac, its his code!!!! Naaahhhhh!!! After all I chose to use it!

    So I did this

    SUB LCD_BYTE
      IF __paramcnt = 1 THEN
        __param2 = 1
      ELSE
        __param2 = __param2 MIN 1
      ENDIF
    
      DO
        SEROUT LCD, LCDBaud, __param1
      LOOP __param2
    
      ENDSUB
    
    



    OK Jon, out of the doghouse ... the first part of your code makes it so Bean's caveat about __param2 never being zero will never happen.

    ... and, OBTW, this change is worth 3 Longs!

    Bean -- the Anderson chip uses '?" as the escape character, and "?n" is a newline and why the string "...you today??" has two question marks, you have to escape the escape character to use it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
  • Tony B.Tony B. Posts: 356
    edited 2010-02-21 20:58
    Bean, JonnyMac, and Brian thanks for the help and suggestions. I have been looking over the code learning and getting better ideas. Have some questions.

    1. Bean, Do these expressions in the DATA blocks ( 1000 & 255, 1000 << 8) get evaluated at compile time?



    2. Bean in your code (1000 << 8) for extracting the high byte shouldn’t it be written (1000 >> 8)?



    3. JonnyMac, do you think there will be communication timing issues between the Propeller and Prop Servo Controller using the Subroutines (which I like very much) or is that a moot point since the Propeller is running a 80mhz and I’m only communicating between the two at 2400bps?



    Brian, thanks for getting rid of those resource hogging PAUSE statements. Look to play with your code today.

    Also Brian in your post and LCD Template code you hint at something I was thinking about. Could we develop a Task exchange site and standards like the Propeller object exchange? Your comment in the template_lcdbbr.pbas which says


    Serial LCD Commands - for a PH Anderson LCD 117 family controller determine what you will need and use, then add/remove as needed
    is how I think it could work. So, as I develop the Task for controlling the Prop Servo Controller I could post it and others could use or modify it as need. What you do you all think?

    Thanks all for your help

    Tony

    Post Edited (T Bill) : 2/25/2010 11:12:40 PM GMT
  • JonnyMacJonnyMac Posts: 8,924
    edited 2010-02-21 21:18
    T Bill said...
    JonnyMac, do you think there will be communication timing issues between the Propeller and Prop Servo Controller using the Subroutines (which I like very much) or is that a moot point since the Propeller is running a 80mhz and I’m only communicating between the two at 2400bps?

    No -- not in a million years. 2400 baud is "dirt slow" and the compiled PropBASIC programs are running full speed. I routinely use 115_200 for talking to terminals; it's not a problem.

    Here's a thought... write a custom program for the PSC so you can talk to it even faster. The PSC now has a Propeller on it and Parallax provides the original source, so why not give it a try (I routinely use a PSC for experiments having nothing to do with servos).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • BeanBean Posts: 8,129
    edited 2010-02-21 21:18
    T Bill said...
    1.······ ·Bean, Do these expressions in the DATA blocks ( ·1000 & 255, 1000 << 8) get evaluated at compile time?
    ·
    2.······ Bean in your code (1000 << 8) for extracting the high byte shouldn’t it be written (1000 >> 8)?
    ·
    Tony,
    · 1) Not by PropBASIC. They are evalutated when the .spin code is compiled.

    · 2) Hmmm. Yeah it should be 1000 >> 8.

    Bean

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/21/2010 9:23:28 PM GMT
  • JonnyMacJonnyMac Posts: 8,924
    edited 2010-02-21 21:58
    Tony,

    Why do you think you need a task -- which runs independently -- to control the PSC? Seems like you'd just be adding an extra step between your main program logic and the PSC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • Tony B.Tony B. Posts: 356
    edited 2010-02-21 22:45
    Jon,
    I was wanting to put PSC control in a task because I am using it on a robot that I have designed which is currently using 4 continuous rotation servos, and 3 standard servos with the addition of 2 or 3 possible. The use of the Spin Stamp is an upgrade for the robot having been driven by a Basic Stamp. I have the robot working on a Basic Stamp which is on a super carrier board. The Spin Stamp, which is also on a super carrier board, has 16 sockets or 3 pin headers connected to each pin and is an upgrade to go beyond the limits of the Basic Stamp. If I ran all the servos from the Spin Stamp alone I would lose 7 pins and maybe 10. I want to add a compass module, GPS, LCD, and a couple more Ping sensors so I need the pins thus, the reason for using the PSC.

    Why the need for a task? I want to keep control, decision making, and monitoring of all the sub systems in the main program and put all other sub systems (like motion, ping, compass, GPS) too work in their own Task. Thus for example the main program controls motion and sends commands to the Motion task which takes care of communication with PSC.
    By putting each sub system in its own Task I hope to make coding, debugging and improvements much easier.

    My ultimate goal is to compete in RoboMagellan competitions but I’m starting simple and adding as I get each sub system working well (It already roams on one ping on the Basic Stamp). This simple robot is a first step. I already have a second version built, but want to get my code solid on this slower robot before I move to the much bigger and faster robot. I also want to build and compete with my robot using PropBASIC. I have picked up on PropBASIC faster in one week than I have in a few months of working in Spin. I think PropBASIC is great and would love to help grow and improve it. It’s my way of saying thanks to you guys and giving back to the PropBASIC community.

    Thanks,
    Tony

    Post Edited (T Bill) : 2/22/2010 1:27:01 AM GMT
  • Christof Eb.Christof Eb. Posts: 1,103
    edited 2010-02-24 17:56
    Hi Bean and hi Brad,
    I simply wanted to report that I worked many hours at the last weekend with the ide (with windows 7) and with PropBasic. Everything worked completely stable!!! Don't you want to give it a "full" release number to encourage people to use it?
    (((Something for the wishlist: Can you create "include" for basic files, my programm with about 900 lines is no more very easy to handle?)))
    Thanks Christof
  • BeanBean Posts: 8,129
    edited 2010-02-24 18:27
    Christof,
    There is the LOAD command.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    ·
  • hover1hover1 Posts: 1,929
    edited 2010-02-24 19:11
    Terry,
    Will we be able to get the non-bst version of PropBasic, say to use with editPlus? Looks like it stoped at 0.79.

    Thanks,
    Jim

    EDIT: Nevermind PropBasic-bst works just fine.

    Post Edited (hover1) : 2/24/2010 7:22:16 PM GMT
  • Christof Eb.Christof Eb. Posts: 1,103
    edited 2010-02-24 19:49
    Bean,

    oh, sorry, I missed this. Whow.

    Christof
  • mwalimumwalimu Posts: 44
    edited 2010-02-25 05:57
    So is there a list of what is being added or fixed in these new versions?
  • Tony B.Tony B. Posts: 356
    edited 2010-02-25 23:28
    EDIT - Discovered error file in directory was able to read. Discover name of file to long (learned this last week forgot - shorten name. Also discovered error with "Scale" constant" fixed it. Error box now stays open showing other errors. Upload new file LED Test.pbas

    EDIT 2 - Tried compiling same code in LED Test under BST 19 using PropBASIC 86 and it works fine. The Test.pbas is the file (moved misplaced Delay statement to MAIN from SUB area). I started writing LED Test.pbas in BST 19.1 PB 86 using File>New>PropBASIC (T)emplate. I did the same in for Test.pbas in BST 19 PB 86. Will try start other new code files.

    EDIT 3 - Tried compiling Test.pbas under BST 19.1 PB 86 it works fine. Seems the files I create using File>New>PropBASIC (T)emplate that are causing the errors. When I click on the errors in the error box it takes me to the Spin file and highlights a comment section for each error.

    Using: BST 19.1 & PropBASIC 86

    Purpose of Code: To light a LED connected to Pin 4 from off to full bright using Counter A set for DUTY single-Ended (48)

    Reason: I'm trying to learn how to use the Counters on the Propeller using PropBASIC.

    Why: Would like to control Motor speed and direction through the H-Bridges on the new Propeller Robot Controller Board ( Used on new Stingray) using PropBASIC which I am using to run my newest robot, Banshee. http://forums.parallax.com/showthread.php?p=876789

    This code is trying to copy the simple program in the PE Kit book chapter 7,pg. 133. When I compile this code I get a Basic Compile Error, but the errors window closes without displaying the error and I haven't be able to find the error. I tested older code that compiled fine by creating an error in the code, compiled, and the error window remained open and listed the error.

    Help with the code, especially how to use COUNTERx, and why the error window keeps closing without listing the error(s) would be most apprececiated.

    Tony

    Post Edited (T Bill) : 2/26/2010 6:37:55 AM GMT
  • BeanBean Posts: 8,129
    edited 2010-02-26 12:05
    Tony,
    · I changed the pin from 4 to 16 and run both of them on a demo board.
    · Both of the files you posted seem to work fine on my system.

    · I'm not sure what is causing the errors.

    ··What operating system are you using ???

    · P.S. I'd be happy to help you develop the code for your robot. I looked on the thread you referenced, but I didn't see a schematic. Do you have one ? Just let me know how I can help.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf


    Post Edited (Bean) : 2/26/2010 12:11:39 PM GMT
  • BradCBradC Posts: 2,601
    edited 2010-02-26 14:28
    I'm distressed at the reports of the "Error window closing without displaying the error" and I'd love to fix it, but I really need more information or a way to reproduce it. I compiled your test code and simply got errors with the "Scale" constant.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You only ever need two tools in life. If it moves and it shouldn't use Duct Tape. If it does not move and it should use WD40.
Sign In or Register to comment.