Shop OBEX P1 Docs P2 Docs Learn Events
Spin2 for Beginners -- Session 8 Files Available Now - Page 2 — Parallax Forums

Spin2 for Beginners -- Session 8 Files Available Now

2456

Comments

  • Ken said more were being kitted yesterday. I believe Ken bought enough parts for nearly 50 kits (I could be wrong).
  • JonnyMac wrote: »
    Ken said more were being kitted yesterday. I believe Ken bought enough parts for nearly 50 kits (I could be wrong).
    I used the link in your first message to order the LED string from Amazon. I suspect I already have the rest of the parts.

  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-18 21:01
    JonnyMac wrote: »
    Ken said more were being kitted yesterday. I believe Ken bought enough parts for nearly 50 kits (I could be wrong).
    My LEDs aren't going to be delivered soon enough from Amazon and I'd like to order the whole kit from Parallax but they still don't seem to be available. Has the second 50 already sold out?

    Edit: I just noticed that Jon said any string of smart LEDs should work. If I can use the WS2812 strings then I guess I'm good to go. When is this project starting?

  • JonnyMacJonnyMac Posts: 9,156
    edited 2020-12-18 22:01
    Sure, no problem -- the same driver (jm_rgbx_pixel.spin2) will will work WS2811 (the Christmas lights), WS2812s, and others.

    4PM PST on the 23rd. It's going to be very beginner friendly, so please be patient with me.
  • A beginner session sounds good to me. I'm a beginner with Spin2.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-19 01:32
    @JonnyMac Are you going to use the Propeller Tool for this session or Eric's FlexProp IDE? I'd like to participate but I will be using a Mac.
  • I only use Propeller Tool (I suggest version 2.3.0.0 at the moment). You may use any tool that supports Spin2. I have friends that use Propeller Tool in an emulator on their Mac with no problems. I don't use FlexProp but it seems from the number of people who do that it's fully compatible with Spin2. The only issue might be inline PASM which I use in some drivers. In the past, Eric was pretty adamant about people NOT using inline PASM2. Perhaps things have changed.
  • JonnyMac wrote: »
    I only use Propeller Tool (I suggest version 2.3.0.0 at the moment). You may use any tool that supports Spin2. I have friends that use Propeller Tool in an emulator on their Mac with no problems.
    You mean running something like VirtualBox with Windows installed? I'm afraid I don't want to have to buy a Windows license just to run Propeller Tool. I guess I'll stick with FlexProp or more likely just the FlexProp command line tools. I just got a sample C program running on my brand new P2 Edge + JonnyMac breadboard. You did a nice job with that!

  • @"David Betz" how about if you try to compile https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_rgbx_pixel using FlexProp. This is one of the objects we will be using. Maybe this test will give you some information about FlexProp's code compatibility.

    Ken Gracey
  • Well, here's a bit of good news: Today I finished a demo for the Sparkfun Qwiic Twist Encoder with RGB LEDs. It uses I2C. My I2C library for the P2 is nearly 100% inline PASM2. I had grabbed a version of FlexProp a few days ago to play with code someone sent to me, so I compiled my Qwiic Twist program and objects with FlexProp. It all seems to work fine. That said, I use PST for my terminal output which is a Windows app. You will probably have to make some adjustments for a different terminal (I use PSTs formatting commands quite a bit).

    Understand that I'm not a user of FlexProp hence feel no obligation to test my code with it. Still, I think the test I just ran means that the code we'll use for the Christmas project will be just fine for those using FlexProp. If issues pop up, we'll work through them.
    1480 x 993 - 153K
  • JonnyMacJonnyMac Posts: 9,156
    edited 2020-12-19 02:24
    You did a nice job with that!
    Thanks, but for the record, the only thing I did was strongly suggest that product, and show exactly what I wanted by "sketching" it with the DipTrace PCB program. Thankfully, what I want/needed matched up with other community members and it's already a successful product for my friends at Parallax.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-19 04:31
    Ken Gracey wrote: »
    @"David Betz" how about if you try to compile https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_rgbx_pixel using FlexProp. This is one of the objects we will be using. Maybe this test will give you some information about FlexProp's code compatibility.

    Ken Gracey
    I cloned the Propeller GitHub repository and looked in the jm_rgbx_pixel directory but the zip file containing the demo program seems to be corrupted. At least I couldn't open it on my Mac:
    dbetz@Davids-Mac-mini-2 jm_rgbx_pixel % unzip -v jm_rgbx_pixel_demo.zip 
    Archive:  jm_rgbx_pixel_demo.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of jm_rgbx_pixel_demo.zip or
            jm_rgbx_pixel_demo.zip.zip, and cannot find jm_rgbx_pixel_demo.zip.ZIP, period.
    
    Edit: I just tried unzipping this on a Windows machine in case it was the Mac that was at fault and that didn't work either. Would it be possible to post this zip file here so I can try compiling the demo program? The library itself compiled without any problems.

  • I just noticed that there is only 5v power on the P2 Edge breadboard but that the I/O pins are marked as 3.3v. How do I work with 3.3v parts on the breadboard?
  • V00, V08, V16, V24, V32, V40, V48, V56 are 3.3v
  • David,
    The zip files on the github are stored using some plugin, and you can't just download the whole repo and get the real zip files contained inside. What you get are little text files with info for the plugin to use to give you the real file if you click it to download. It's an annoying side effect of using something to store zip's in github. As far as I know the only way to get at the zip's is to navigate to them and click them on the website... maybe someone else knows how at the command line?

    re: the p2 edge breadboard. it takes 5V in, but the edge card returns 3.3v back out, so the pins and the V00 - V56 pins are 3.3v. So you just patch from the V00 (or V08, or etc.) to the breadboard power rails.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-19 04:56
    Roy Eltham wrote: »
    David,
    The zip files on the github are stored using some plugin, and you can't just download the whole repo and get the real zip files contained inside. What you get are little text files with info for the plugin to use to give you the real file if you click it to download. It's an annoying side effect of using something to store zip's in github. As far as I know the only way to get at the zip's is to navigate to them and click them on the website... maybe someone else knows how at the command line?
    Ugh. I hope there is a better way. In any case, I followed your advice and now have the demo sources. Thanks!
    re: the p2 edge breadboard. it takes 5V in, but the edge card returns 3.3v back out, so the pins and the V00 - V56 pins are 3.3v. So you just patch from the V00 (or V08, or etc.) to the breadboard power rails.
    Thanks for the explanation. I suspect I would have known that had I been smart enough to read the manual!


  • Not surprisingly, the rgbx_pixel demo compiles successfully with fastspin. I have to dig out my RGB LED strings to test it to see if it works. I seem to recall that the RGB LEDs require 5V power and signal. How should that be handled on the P2 Edge Breadboard?
  • JonnyMacJonnyMac Posts: 9,156
    edited 2020-12-19 05:12
    Here's the latest demo from my machine -- which I compiled and ran using FlexProp with no problems.

    The one thing you'll have to deal with when using some of my programs is terminal output. I frequently make use of PST and its formatting commands. I'm sure you have a favorite terminal on your Mac. Hopefully, it support similar formatting commands as PST (highly likely as PST is not very sophisticated).
    I seem to recall that the RGB LEDs require 5V power and signal. How should that be handled on the P2 Edge Breadboard?
    Power the strip with 5v. If you keep the connection to the first pixel short, 3.3 will work. It' gets conditioned to 5v going from one pixel to the next. I am presently running my demo on an Adafruit WS2812 ring with about 2 feet of wire from the Eval to the ring.
  • Is there any reason to use the Rev D PropPlug or will an older one work just as well? I was able to download a C demo using the older one but I noticed, when I powered off the breadboard, that the P56-57 LEDs glow dimly unless I unplug the PropPlug. Is it normal for the PropPlug to source power?
  • Old PropPlug works on the JonnyMac -- just plug it in label side down.
  • David Betz wrote: »
    Is there any reason to use the Rev D PropPlug or will an older one work just as well? I was able to download a C demo using the older one but I noticed, when I powered off the breadboard, that the P56-57 LEDs glow dimly unless I unplug the PropPlug. Is it normal for the PropPlug to source power?

    My Rev D PropPlug does the same thing in that the two LEDs on the P2 Edge module will glow dimly while the PropPlug is connected to a USB port and the 5v is NOT connected. So I think this is normal. This happens with both the Mini and JohnnyMac breadboards.
  • David Betz wrote: »
    Is there any reason to use the Rev D PropPlug or will an older one work just as well? I was able to download a C demo using the older one but I noticed, when I powered off the breadboard, that the P56-57 LEDs glow dimly unless I unplug the PropPlug. Is it normal for the PropPlug to source power?

    My Rev D PropPlug does the same thing in that the two LEDs on the P2 Edge module will glow dimly while the PropPlug is connected to a USB port and the 5v is NOT connected. So I think this is normal. This happens with both the Mini and JohnnyMac breadboards.
    That's good to know. I have three PropPlugs and didn't really want to have to buy one of the new ones.

  • I took an 8 LED AdaFruit strip and connected the ground pin to GND, the power pin to V24 and the signal pin to P24 and tried to run the demo but the LEDs don't light. Any idea what is going wrong? I also tried supplying the LED strip with 5V and still didn't see any output.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-19 13:01
    Okay, some bad news. I tried compiling and running the rgbx_pixel_demo program on a Windows machine using Propeller Tool and it worked fine. It looks like flexspin as I've used it doesn't generate a working binary. I used this command:
    fastspin -2 jm_rgbx_pixel_demo.spin2
    
    @ersmith Did I miss something?
  • JonnyMac wrote: »
    In the past, Eric was pretty adamant about people NOT using inline PASM2. Perhaps things have changed.

    I think you misunderstood me (not surprising, I think I expressed myself poorly). My point is that there's a danger that inline assembly will be over-used, and that it's generally better to write in plain Spin2 (which can do almost everything that assembly can). But flexprop does support inline PASM, and in fact has done so since before Spin2 existed.
  • David Betz wrote: »
    Okay, some bad news. I tried compiling and running the rgbx_pixel_demo program on a Windows machine using Propeller Tool and it worked fine. It looks like flexspin as I've used it doesn't generate a working binary. I used this command:
    fastspin -2 jm_rgbx_pixel_demo.spin2
    
    @ersmith Did I miss something?

    Could you give me some hint as to what went wrong? I don't have the LED hardware so I haven't tried Jon's example.

  • ersmith wrote: »
    David Betz wrote: »
    Okay, some bad news. I tried compiling and running the rgbx_pixel_demo program on a Windows machine using Propeller Tool and it worked fine. It looks like flexspin as I've used it doesn't generate a working binary. I used this command:
    fastspin -2 jm_rgbx_pixel_demo.spin2
    
    @ersmith Did I miss something?

    Could you give me some hint as to what went wrong? I don't have the LED hardware so I haven't tried Jon's example.
    Nothing happened when I loaded it. I'm not sure what else to say. I guess I should take a look at the generated pasm2 to see if I can figure out what's going wrong.

  • Please start a new thread around the use of FlexProp so we can keep this one on-topic.

    Thanks,

    Ken Gracey
  • Ken Gracey wrote: »
    Please start a new thread around the use of FlexProp so we can keep this one on-topic.

    Thanks,

    Ken Gracey
    Sorry. I just posted here because you asked me to try the rgbx demo program earlier in the thread. I guess I'm done at the present unless I find time to pour through the pasm2 code to see if I can figure out what's going wrong.

  • JonnyMac wrote: »
    Sure, no problem -- the same driver (jm_rgbx_pixel.spin2) will will work WS2811 (the Christmas lights), WS2812s, and others.

    4PM PST on the 23rd. It's going to be very beginner friendly, so please be patient with me.
    Is there a link for this or will it be posted later?

Sign In or Register to comment.