Shop OBEX P1 Docs P2 Docs Learn Events
PropBASIC - Page 3 — Parallax Forums

PropBASIC

13»

Comments

  • Excellent description Bean...thank you.

    Discovery
  • Mickster,
    Would describe Viewport in some detail?

    Sincerely,

    Discovery
  • Discovery wrote: »
    Mickster,
    Would describe Viewport in some detail?

    Sincerely,

    Discovery

    You can check out a video here:

    https://onerobot.org/#ViewPort
  • Thank you Publison for the link. The video is quite impressive.

    Bean,
    It appears to me that Viewport only displays the program in spin. As you know, I only want to work at the pBASIC level so I would like to know your assessment of Viewport if you are familiar with it. Can Viewport be configured to show the pBASIC program rather than the spin code?

    Sincerely,

    Discovery

  • Discovery wrote: »
    Thank you Publison for the link. The video is quite impressive.

    Bean,
    It appears to me that Viewport only displays the program in spin. As you know, I only want to work at the pBASIC level so I would like to know your assessment of Viewport if you are familiar with it. Can Viewport be configured to show the pBASIC program rather than the spin code?

    Sincerely,

    Discovery

    Here is a thread that was the start of PropBasic integration with Viewport.

    https://forums.parallax.com/discussion/135494/propbasic-viewport-integration

    There are others that I will add later.
  • Thank you Publison,

    Discovery
  • Guys,

    The following program was downloaded to the Propeller Activity Board and it runs perfectly well. I tried to put the Blink1 code into COG1 and run it from a short program in LMM that reads the P0 input. Using a switch...when the input on P0 goes high...COG1 should execute the blinking program 40 times and stop.

    How do I go about this?

    '
    'LEDBlink1
    '
    DEVICE P8X32A

    LED1 PIN 26 OUTPUT
    LED2 PIN 27 OUTPUT

    PROGRAM Start LMM
    Value VAR LONG
    Value = 0

    Start:
    DO
    HIGH LED1
    LOW LED2
    PAUSE 100
    LOW LED1
    HIGH LED2
    PAUSE 100
    IF Value = 40 THEN EXIT
    Value = Value + 1
    LOOP
    END

    Sincerely,

    Discovery

  • BeanBean Posts: 8,129
    Something like this:
    DEVICE P8X32A
    
    Button PIN 0
    LED1   PIN 15
    
    BlinkTask  TASK 
    
    PROGRAM Start
    
    Start:
      DO
      LOOP UNTIL Button = 1
      COGINIT BlinkTask, 1
      PAUSE 8_000
      GOTO Start
    END
    
    TASK BlinkTask
    times VAR LONG = 40
      DO
        HIGH LED1
        PAUSE 100
        LOW LED1
        PAUSE 100
      LOOP times
    ENDTASK
    
    

    Bean
  • Bean,

    Thank you.

    Discovery
  • Hi Bean,
    I loaded the exact code you provided above into my machine and it displayed the following:

    An Unhandled exception occurred at $00414EAB:
    EAccessViolation : Access violation
    $00414EAB
    $004116F2
    $00411C19
    $0041261D
    $00402714

    Discovery
  • jmgjmg Posts: 15,173
    Discovery wrote: »
    Hi Bean,
    I loaded the exact code you provided above into my machine and it displayed the following:

    I get this report, no errors
    PropBasic Version 00.01.44 Jul 13, 2014
    Finished Compile. 26 Lines Read, 80 Lines Generated,  0 Warnings, 0 Errors.
    

  • Humm,

    I wonder if something is missing in my machine that is present in yours.

    Discovery
  • Any ideas about why the program would not compile?

    Discovery
  • BeanBean Posts: 8,129
    It should compile.
    Did you change anything ?

    Can you post the EXACT code your trying to compile.

    Bean
  • Yes,
    '
    ''BEAN PROGRAM
    '
    DEVICE P8X32A

    Button PIN 0
    LED1 PIN 26

    BlinkTask TASK

    PROGRAM Start

    Start:
    DO
    LOOP UNTIL Button = 1
    COGINIT BlinkTask, 1
    PAUSE 1000
    GOTO Start
    END

    TASK BlinkTask
    times VAR LONG = 40
    DO
    HIGH LED1
    PAUSE 100
    LOW LED1
    PAUSE 100
    LOOP times
    ENDTASK

    Sincerely,
    Discovery
  • Bean,
    You will note that I made two changes from your original code LED1 PIN 15 was changed to LED1 PIN 26 and PAUSE 8_000 to PAUSE 100.

    I tried to compile the program with PIN 15 and PAUSE 8_000 which gave the same exceptions. The code I sent you is an adjustment to try to get the program to compile.

    Discovery
  • BeanBean Posts: 8,129
    It compiles fine on my computer.

    See if this compiles:
    DEVICE P8X32A
    
    PROGRAM Start
    
    Start:
    
    END
    
    

    Bean
  • Does PropBasic use a DLL? Is there any chance that the DLL and EXE are out of sync? Maybe an old DLL is somewhere in the path?
  • pmrobertpmrobert Posts: 673
    edited 2018-08-08 16:09
    Does PropBasic use a DLL? Is there any chance that the DLL and EXE are out of sync? Maybe an old DLL is somewhere in the path?
    I'm almost 100% certain is doesn't. Since Bean released source I've been compiling my own .exes under Lazarus and they are definitely static linked executables. Perhaps Discovery's executable is corrupt? FPC & Lazarus turn out rather stable object code in my experience.

    Mike R...
  • BeanBean Posts: 8,129
    I realized that when I loaded Lazarus I got the 64-bit version which creates 64-bit apps.
    Not sure what happens if you try to run a 64-bit app on a 32-bit version of windows.
    As soon as I can, I will install the 32-bit version of Lazarus and make a 32-bit version of PropBasic.

    Bean
  • Hi Bean,
    I have written about 15 programs now and they all run fine on the Propeller Activity Board. The first major problem ocurred when you followed my requestion to run a portion of my code in another COG.

    The following is the EXACT code that you run on your machine but does not compile on mine.
    '
    ''BEAN PROGRAM
    '
    DEVICE P8X32A

    Button PIN 0
    LED1 PIN 15

    BlinkTask TASK

    PROGRAM Start

    Start:
    DO
    LOOP UNTIL Button = 1
    COGINIT BlinkTask, 1
    PAUSE 8_000
    GOTO Start
    END

    TASK BlinkTask
    times VAR LONG = 40
    DO
    HIGH LED1
    PAUSE 100
    LOW LED1
    PAUSE 100
    LOOP times
    ENDTASK

    As you suggest...64 and 32 bit might make the difference in compiling the code.

    Sincerely,

    Discovery


  • Hi Bean,
    I copied your simple code above...shown below:

    DEVICE P8X32A

    PROGRAM Start

    Start:

    END

    Strange thing is that I have written about 15 programs that use the shell above and they all run fine, however, the code above does not compile on my machine!!!

    When I try to compile it...the machine reverts to the Windows 10 start screen and there is no saved version in .pbas.

    I hope that you can figure this out.

    Discovery

  • BeanBean Posts: 8,129
    Have you tried the 1.48 release ? It is 32-bit.
    I'm sorry, I really have no idea why such a simple program would not compile.

    Bean
  • Bean,
    If I can locate the 1.48 release...I will try it. If not, I will find out if the current release will run on any of my other computers. If so, I may have to get another computer...if the problem is computer dependent.

    Discovery
  • Bean,
    You are most likely familiar with the expression "Sometimes even a blind rate can find the cheese". I took a few days off from studying Prop Basic and finished machining some precision parts for two projects that I needed to complete. After completing the projects I returned to the Propbasic compile problem of the program you sent me.
    I ran the compiler on the program again and got the same list of errors. I touched the SAVE AS button and noticed that the program LED Blink Bean.spin showed in the save window. Just on a whim, I changed the program name to LED Blink Bean.pbas. The program saved properly so I pressed the run arrow. The compiler completed with no errors and down loaded the program to the propeller on the Activity Board. I pressed the push button connected to p0 input and the p26 and p27 LEDs blinked properly. I was ELATED. The program worked perfectly! I added another COG task and it compiled and ran perfectly as well. So, for now on...I will save my programs with the .pbas extension and all should be well.
    I hope that this information can be helpful to you.

    Sincerely,

    Discovery
Sign In or Register to comment.