Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Code Generator - Now with 14 working Objects — Parallax Forums

Propeller Code Generator - Now with 14 working Objects

RaymanRayman Posts: 14,495
edited 2021-06-09 14:56 in Propeller 2

Here's a way to jumpstart FlexSpin C development...

Just check a few boxes and hit the "Generate Code" button and this program will generate the barebones .c and .h files and batch files that compile and load it to P2.

You can then compile and load with the other buttons.

Update 09Jun21: Added DVP Camera object!

718 x 1142 - 45K
717 x 1021 - 49K
714 x 998 - 41K
717 x 998 - 39K
466 x 474 - 18K
466 x 503 - 24K
466 x 718 - 30K
«1

Comments

  • RaymanRayman Posts: 14,495

    Now have Object and Pins view working :)

    Check it out... You can test out your VGA or I2C configuration in seconds.

    If you don't have FlexProp already, just download latest release from Github and extract into a folder like C:\FlexProp
    Then the .exe in the first post should be able to find it and go to work...

    717 x 1021 - 49K
    714 x 1022 - 31K
  • RaymanRayman Posts: 14,495
    edited 2021-04-27 21:59

    Added a Neopixel driver object.
    Now, one can generate, compile, and run code to drive an led strip in seconds...

    714 x 998 - 41K
  • RaymanRayman Posts: 14,495

    Added RTC and NCO objects.
    Also, added FlexProp button that opens up flexprop with the .c file that was previously generated.

    717 x 998 - 39K
    466 x 474 - 18K
  • This looks pretty cool, @Rayman

  • RaymanRayman Posts: 14,495

    Thanks @ersmith !

    I just added in a Simple Sound object (source from @Ahle2). Can now get .mod music and sound effects working with just a few clicks.

    Also fixed some annoying delays when opening dialog boxes.

    466 x 474 - 14K
  • RaymanRayman Posts: 14,495

    Added Servo and Digital I/O objects.
    Also, fixed a few things in the code.

    466 x 474 - 12K
    466 x 591 - 20K
  • JRoarkJRoark Posts: 1,215
    edited 2021-05-07 17:42

    @Rayman, this is some really neat stuff. What is this wrtten in and where do you get the time?

  • RaymanRayman Posts: 14,495
    edited 2021-05-07 18:22

    Thanks @JRoark . I've spent a lot of time the last 3 weekends working on it. But, I also did a little bit today because I'm finding this useful.
    It's a bit experimental, but seems like it's actually working.

    It's written in MFC C++, only because that's what I know best. It's also good for making stand alone .exe files with no dependencies.

  • RaymanRayman Posts: 14,495
    edited 2021-05-07 23:54

    Just added an object that configures the HUB digital filters.

    After looking at this image... Renamed the options from "Enable Filter X" to "Set Filter X". don't know for sure, but imagine that is closer to the truth.

    So now, when combined with a digital I/O pin object, one can easily test out these filters.

    716 x 1020 - 54K
  • Cluso99Cluso99 Posts: 18,069

    WOW Ray! This looks fantastic :smiley:

  • ColeyColey Posts: 1,110

    This is brilliant Ray. :)

  • RaymanRayman Posts: 14,495

    Thanks @Cluso99 & @Coley

    I fixed a bad bug in the HUB filters object. I have to remember that the << and >> operator precedence is different in C than in Spin...

    Also added icons to the Object Select dialog. Also added a DAC object. This one just sets the 8-bit value non-smart value, not the 16-bit smart mode value.

    466 x 601 - 20K
    466 x 474 - 10K
  • Really excellent stuff here!

    One minor issue... When I re-launch P2C and start a new project, it would be nice if my settings for the paths to flexspin, loadp2, Plan9 directories were saved. I keep my flexprop directory in a specific place that differs from C:\FlexProp\bin. Just a thought.

    Thanks for all your hard work!

    dgately

  • RaymanRayman Posts: 14,495
    edited 2021-05-09 17:24

    @dgately Thanks for trying it!
    I'm making it so that when you hit the "Compile" button, it saves all the paths and the custom compiler options so they become the default next time.
    Sound right? Hopefully can get this posted soon...

    Actually, moved it to the "Generate" button, because this is where they are used... Also, made a note there that one must Generate files again if paths are changed. (That tripped me up for a second...)

  • RaymanRayman Posts: 14,495

    @dgately Think path saving should work now.

    Also, added an ADC object. Some options are greyed out because I haven't figured out how to make them work yet :(

    466 x 503 - 24K
  • @Rayman said:
    @dgately Think path saving should work now.

    Almost... Save the Plan9 folder as well?

  • RaymanRayman Posts: 14,495

    @dgately Thanks. Should be all fixed this time.

  • RaymanRayman Posts: 14,495

    Found a couple bugs while testing with latest version of FlexSpin... (DAC didn't work unless it was first in list and simple sound didn't release pins when deleted). There's a new version in top post.

  • RaymanRayman Posts: 14,495
    edited 2021-05-15 19:51

    Added SINC2 and SINC3 options to the ADC object. Also now allows to show calibrated or uncalibrated result.

    Note: code for USB is not yet done.

    466 x 503 - 24K
  • RaymanRayman Posts: 14,495

    Added the @garryj USB Keyboard and/or Mouse driver as an object.

    466 x 718 - 30K
  • Cluso99Cluso99 Posts: 18,069

    Nice job.

    As a suggestion, the error LED is not required, so you could allow -1 with a comment. I think this requires a mod to the object IIRC. There is a version where I allowed the two LEDs to be configured on different pins with respect to the base pin. Don’t recall if I allowed -1. The activity pin is required as it’s a signalling pin between objects.

  • RaymanRayman Posts: 14,495

    That's a good suggestion. The power enable option was easy as it is in Spin. But, the error LED function is deep in the assembly part and I'm not 100% sure how to disable it...

  • RaymanRayman Posts: 14,495

    What I can do is make a version with the error LED assembly I/O commands commented out. That seems to work.

  • RaymanRayman Posts: 14,495
    edited 2021-05-16 21:39

    Done. Now can optionally generate a variation of the USB driver that has all the error LED pin affecting assembly lines commented out.
    New option to not use error LED pin is in bottom left corner of dialog.

    466 x 747 - 31K
  • Very cool! Is there any chance of a Linux version? Just asking!

  • RaymanRayman Posts: 14,495

    In theory, it should run under Wine.

    Maybe I can test on my Mac.

    Wonder if it has to be 64-bit now...

  • dgatelydgately Posts: 1,630
    edited 2021-05-17 02:00

    I'm running P2C.exe in a Win10 VM, via Parallels Desktop on macOS. I can even launch it from a macOS window or Dock. It launches WIN10 in Parallels if not already running, when I double-click on the P2C.exe app in a Mac window (nice!).

    What this means is that I don't need to install P2C.exe onto the WIN10 drive. This makes it easier to download in Safari, and not worry about copying over to the WIN10 partition/directories in Parallels!

    Thx

  • RaymanRayman Posts: 14,495
    edited 2021-05-23 20:41

    @dgately Is that with Big Sur? I'm upgrading my Mac now to Big Sur... I'm not clear on whether 32-bit Windows apps will run under Parallels still or not...

    Also not sure what this means for Wine... Guess I'll try it out...

    Trying this 64-bit version with wine64

  • @Rayman said:
    @dgately Is that with Big Sur? I'm upgrading my Mac now to Big Sur... I'm not clear on whether 32-bit Windows apps will run under Parallels still or not...

    Also not sure what this means for Wine... Guess I'll try it out...

    Yes, Big Sur (11.3)...

  • RaymanRayman Posts: 14,495
    edited 2021-05-23 22:01

    @dgately I was also able to get P2C to run under Parallels after a bunch of OS and Parallels updates.

    Was also able to get it to run under Wine64. Well sort of...
    The file exploring parts don't work. Guess that's one reason why 64-bit is still in development...
    Also, flexspin.exe doesn't work. I think that is because it is a 32-bit app.

    Was able to get Parallels going in "Coherence" mode, I think what you described above.

    There is something strange going on with the Win10 Desktop in Parallels though...
    If I save P2C files there, they don't work. But, if I save them in a new folder on the fake C drive, then it works.

    Anyway, seems 32-bit is still working under Parallels.

Sign In or Register to comment.