Skip to content

Add audiobusio examples and fix simple test frequency #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Feb 24, 2021

This also uses newer pin auto-init.

These examples now need adafruit/circuitpython#4251 in CircuitPython.

This also uses newer pin auto-init.
@tannewt tannewt requested a review from jepler February 24, 2021 00:41
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it needs the duplicate-files checks neutered. Mind adding that in this PR?

@tannewt
Copy link
Member Author

tannewt commented Feb 25, 2021

Looks like it needs the duplicate-files checks neutered. Mind adding that in this PR?

I want to wait until we have an idea of what we're doing in every repo instead of hacking it for this one. Discussion here: adafruit/cookiecutter-adafruit-circuitpython#111

@Inne-Lemstra
Copy link

Inne-Lemstra commented Mar 3, 2021

Hi, I encountered the frequency 80 < minimum bug and wanted to make an issue but saw this PR.

The new frequency in the pioasm_simpletest.py of 2000 will make the 2 cycle on, 1 off pio blink not visible with the naked eye anymore.

might this be a solution?? The loops and longer cycle skips will slow the blink down to 0.1 sec.

squarewave = """
.program squarewave
    set x 10    ; counter for 10 loops of a 20 cycle instuction 
                     ; 20*10=200 cycles -> 0.1 sec "delay" with freq 2000
on:
    set pins 1 [19]     ; Drive pin high and then delay for 20 cycles
    jmp x--, on         ; x-- will loop if x not 0, then substract 1 from x
    set x 10            ; reset x fort he off loop    
off:   
    set pins 0  [19]    ; Drive pin low for 20 cyles
    jmp x--, off         ; x will be reset when script starts over
"""

Another thing is that board.D13 doesn't seem to work for me on a pico with circuitpython pico-en_US-20210227-24fdda0
board.LED does work and board.GP25 also works.
Does the example in the REAME update automatically as this script does??

This is the first time I am posting a comment on a PR and I hope I am doing this the right way.
If I am out of line or commenting somewhere I shouldn't, please disregard.

@tannewt
Copy link
Member Author

tannewt commented Mar 4, 2021

Hi, I encountered the frequency 80 < minimum bug and wanted to make an issue but saw this PR.

The new frequency in the pioasm_simpletest.py of 2000 will make the 2 cycle on, 1 off pio blink not visible with the naked eye anymore.

The simple example isn't meant to make a visible blink. I added a comment saying so. It is nice to have it on an LED still because you can see when it is running.

might this be a solution?? The loops and longer cycle skips will slow the blink down to 0.1 sec.

squarewave = """
.program squarewave
    set x 10    ; counter for 10 loops of a 20 cycle instuction 
                     ; 20*10=200 cycles -> 0.1 sec "delay" with freq 2000
on:
    set pins 1 [19]     ; Drive pin high and then delay for 20 cycles
    jmp x--, on         ; x-- will loop if x not 0, then substract 1 from x
    set x 10            ; reset x fort he off loop    
off:   
    set pins 0  [19]    ; Drive pin low for 20 cyles
    jmp x--, off         ; x will be reset when script starts over
"""

This would be great to have as a pioasm_blink.py example!

Another thing is that board.D13 doesn't seem to work for me on a pico with circuitpython pico-en_US-20210227-24fdda0
board.LED does work and board.GP25 also works.
Does the example in the REAME update automatically as this script does??

This is the nature of boards having different pin naming. board.D13 will work on our upcoming Adafruit boards because LED on D13 has been a standard for a while. Changing it to board.LED for pico is the way to fix it. These examples are meant to work on every board.

This is the first time I am posting a comment on a PR and I hope I am doing this the right way.
If I am out of line or commenting somewhere I shouldn't, please disregard.

Totally fine! Thanks for the comments. It's good to know folks are using these examples. :-)

@tannewt
Copy link
Member Author

tannewt commented Mar 4, 2021

Ok @jepler, I've merge in the latest main which fixes the duplicate code issue. Please take another look.

@tannewt tannewt requested a review from jepler March 4, 2021 18:00
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@jepler jepler merged commit 74330ed into adafruit:main Mar 4, 2021
@dglaude
Copy link
Contributor

dglaude commented Mar 4, 2021

Not sure if this can be a useful contribution. A few weeks ago I was playing with Blink on the PIO and found the solution to shake the Pico to see the blink. This was done late in the night, so in the dark (not sure how well it work in daylight).

This could be a suggestion for the guide or some comment in the code:
https://twitter.com/DavidGlaude/status/1367571218698825734?s=20

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 10, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint to 2.2.0 from 2.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Fingerprint#28 from admiralmaggie/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.8.0 from 3.7.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#57 from lesamouraipourpre/bad-sentences

Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 4.1.5 from 4.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#86 from SAK917/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.0.1 from 3.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#39 from dglaude/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_MONSTERM4SK to 0.1.2 from 0.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MONSTERM4SK#6 from FoamyGuy/pylintrc_update
  > Removed pylint process from github workflow

Updating https://github.com/adafruit/Adafruit_CircuitPython_AirLift to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_AirLift#2 from FoamyGuy/pylintrc
  > Set correct black and reuse versions
  > Removed pylint process from github workflow
  > Hardcoded black version

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.4 from 2.15.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#132 from jposada202020/tab_replacement
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#130 from kmatch98/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#126 from FoamyGuy/label_base_class

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.2.2 from 0.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#9 from tannewt/audiobusio_examples
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#13 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_Pixel_Framebuf to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Pixel_Framebuf#4 from FoamyGuy/main
  > Hardcoded black version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants