#circuitpython-dev
1 messages · Page 242 of 1
We could have adabot create a stats json file to show here for libraries.
Should be doable. Framework is already there for Bundle downloads, and individual lib downloads from PyPI. Example
unzip into root folder of circuitpython:
MBP-di-Damiano:~/projects/circuitpython$ make -j12 BOARD=pca10059 SD=s140 USER_C_MODULES=$(pwd)/cmodules -C ports/nrf/
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Including User C Module from /Users/damianomazzella/projects/circuitpython/cmodules/example
usage:
Adafruit Ci...
@jwcooper just talked with @tannewt each release would be sorted by downloads (most being at the top of each release).
Sure, might have time this weekend to have a look, thanks.
8f1fc6c Added option to easily treat SPI parameter data... - makermelissa
af3d809 Updated boards files with displays - makermelissa
7872a33 Merge branch 'master' of https://github.com/ada... - makermelissa
97baa78 Added comment regarding parameter loop - makermelissa
36b1010 Adjusted inline limit to fix Hallowing PL build - makermelissa
@solar whale Heya - could I request a code review from you on a HTTP API helper library I wrote?
When using an int index you could end up writing past the end of
TileGrid's memory.
Fixes #1747
My understanding is that the top release shown would be the one with the most total downloads (3.1.2 now I think.)
i meant the latest release is still at the top, and within that, top downloads.
Why do you want this? We will not promise that our internal C APIs are stable. The only way to have something native that is maintained is by merging it into this repo.
@prime flower sure, but I may not get to it until Monday - won't have much time this weekend.
OK! it appears that firefox as per @tannewt displays it correctly but it's chrome that does not, all this time... sorry @jwcooper for the comments here, so this is now a chrome display issue :(
here is what it looks like on chrome.

so this is now a chrome display issue
Also an Edge issue, as it displays "non-sorted" as well.
@tannewt I followed the original MicroPython discussion on this over months. The idea is just to make it lower overhead to add special-purposes modules, segregated in another directory. Anyone using this would need to maintain a fork. I don't think we'd recommend using this except for private stuff. It doesn't flow with shared-bindings, shared-modules, etc. but it does make it easier to add a simple module.
@dmazzella Anything general-purpose (e.g., an FFT module, or something like t...
One advantage of having this in our fork is that it will make merging from upstream easier next time, since it's already included in MPy. At the next merge, we'd either have to merge or discard it (manually).
The sort comparison function isn't returning the right thing. It should be:
return b.downloads - a.downloads
to get highest to lowest.
[adafruit/circuitpython] Pull request opened: #1756 Fix crash when getting board\.SPI outside the VM
If one of the default pins was already in use it would crash.
The internal API has been refined to allow us to get the value
without causing an init of the singleton.
Fixes #1753
@gilded cradle @tidal kiln heya i have a Q if you're around
I'm around
silly Q how do i initialize a display when i've built displayio into my board definition
i want to hook up my TFT gizmo to the CPX but it says my pins are in use
oh, calling release_displays() should do it.
Let me check the exact syntax
displayio.release_displays()
If that doesn't work, I can try hooking up a display to a CPX and see if I can get it to work.
Cool
sorry was distracted by CUTE
It's all good
I remember somebody from Show and Tell this week was working on a slider puzzle game for the PyPortal, but that's the only one I'm aware of.
hi there, just wondering what the deal is with CircuitPython on the m0 Adalogger? It appears to be a non-uf2 board, but there's a uf2 build of CircuitPython? does that mean there's a way to flash uf2 to it or does the build just build bin and uf2 for all boards?
made default CP font 11866 bytes smaller by adding 5 missing glyphs, the ones need for zh translation
how do i do pull request on the fonts?
bdf files are kinda strange the 5 missing glyphs are made up of componets of other glyphs when i add stuff like that it makes the file size smaller.... weird
@red harbor you can use the .bin files for it, i have adafruit mo adalogger with CP on it.
.uf2 is for the bootloader, i think you need to use the .bin atleast once
@slender iron i tested my updated default font with hallowing here is what i got
hallowing old font english 2428 bytes free in flash
hallowing new font english 2480 bytes free in flash
hallowing old font chinese 'FLASH' overflowed by 592 bytes
hallowing new font chinese ``FLASH' overflowed by 532 bytesso i think it does make builds smaller, which is a great thing right??? i ended up doingCIRCUITPY_AUDIOBUSIO = 0` for hallowing, i dont use a speaker ever and that frees up a huge amount of space
With the bus exposed, we can send custom commands to the display, to
leverage advanced features specific to the display, which are not
exposed by default.
Instead remember and use the frequency, polarity and phase that was
set when the bus was first created.
So that we can access them outside of displayio, for example by
the _stage library.
In theory, I could have several SPI displays connected to the same bus, and displayio has provisions for that — locking of the SPI bus, toggling of the CS pin, even re-setting of the SPI frequency, polarity and phase. However, it's not possible to create two (or more) FourWire objects sharing the same DC and/or reset pins, but with different CS pins — because we will get a "Pin in use" error when the FourWire object tries to create them.
The declaration of board_i2c() got deleted here, though board_spi() and board_uart() still exist. Was that deliberate?
Could you put in a comment here about the fact the original_spi or common_hal_board_get_spi() might be null, and if so why, and how that's handled? I'm having trouble figuring out the different possible cases.
Looking forward to this feature. Do you think scanning will be implemented soon?
It will be after 4.0 is out. There are other BLE things to do, like BLE HID (which needs pairing/bonding), and we'll prioritize those after the 4.0 release.
Sounds great! You guys are doing a fantastic job.
@tulip sleet Are there any current issues with not being able to enter the REPL from the serial console?
a few people in the forums were having trouble with windows, maybe
but not widespread
Ok, thanks. Wanted to make sure I hadn't repro'd something important.
Works after reset, which I figured it would, but wanted to make sure I shouldn't be adding to an issue 😄
Ah I didn't run into anything that complicated. It's been connected all night, and then wouldn't enter the REPL when I tried.
in that case, CIRCUITPY wouldn't show up either
Yah I had CIRCUITPY
what version are you running?
Oh, hah, 3.1.2. So entirely nevermind. 😄 I thought I was running latest on this one.
https://github.com/adafruit/circuitpython/pull/1748 fixed some things. oooooh, i have no opinion 😃
I should have known better - this is the PyCon demo CPX, of course it's running stable.
🤦
i thought 3.1.2 was perfect ( 😃 )
Everybody loves a good bug
@tulip sleet Just so I'm not missing something here.... all of the following are built into CP for CPX right? ```import array
import math
import audiobusio
yes, they should all be in 3.1.2. I looked at the source
or just try an import in the repl, that's the ground truth.
Ok thank you. I mean, the code worked, but I had it in my head maybe I had added a lib somewhere and forgotten about it.
If I had added it, REPL wouldn't have helped. It would have existed to import.
no, those are all native so they're either buitin or not
Ok right on, thank you for the sanity check 😄
Starting to put together the Open Spaces code content for PyCon. Which means going through every example, testing it, and then adding a docstring. Which, if it needs another lib, should be mentioned. The rest are obvious. That one I started second guessing.
@idle owl @tulip sleet Are built in and frozen the same concept? I made a list a while back of the frozen ones when there was a discussion about memory consumption and the behaviour changed with ordering for 3.1.1 https://forums.adafruit.com/viewtopic.php?f=60&t=143160
Changing subject, I think I have stumbled across a micropython peculiarity with bytes() but would be useful if someone could confirm that: https://forums.adafruit.com/viewtopic.php?f=60&t=150071
@marble hornet how is the pocketbeagle going?
It was on hold since last night, I visited rit, but not well. I can't get pup to install nor apt-get
U can pull it out and plug it in
@simple pulsar frozen modules are Python code that has been precompiled and included in the .uf2. They don't use up (much) RAM when imported, unlike .mpy files which are precompiled but live in RAM when imported. "Builtin" means native C code, at least to us.
@marble hornet what version of linux are you using?
maybe try "Other currently available software images" from the getting-started guide, does the Ubuntu work?
Let me link my phone to the computer, I have not yet tried Ubuntu
i was just thinking ubuntu kinda like debian but usually more user friendly less errors probably??
would the adafruit blinka work on both?
it should - raspbian is based on debian, for instance
and ubuntu?
also based on debian, but more cutting-edge
i used to use debian but I've been using ubuntu for about 11 years
is pip the only way to install blinka?
@marble hornet are you using pip or pip3? what version of debian is it?
installing any other way is painful. it's important to get pip3 to work right if it doesn't
I see from above apt-get doesn't work. If that doesn't work something is really hosed
pip3 and v9.5
can you ping anything from the beagle?
i'm sshed in, let me try
e.g. 8.8.8.8, which is a google nameserver; it will respond
can;t find it
usb
that is a simulated local network connection; no routing unless you set it up, I think
which beagle is this?
which beagle is it?
Google Groups allows you to create and participate in online forums and email-based groups with a rich experience for community conversations.
all I would do is read through that too
what os is the host?
will be afk for a while
thank you, windows. reading now...
So we need a separate FourWireDevice then. (To match I2CDevice for example.)
Setting the display brightness works ok when working with the native display itself but not when a subclass (like the display drivers use) is used.
I think it would be sufficient to be able to pass a DigitalInOut object as the pins during the initialization, at which point it wouldn't try to create new ones.
@hybrid field in the first screenshot, you're trying to use import in a CMD terminal window. That's not inside Python, so it won't work. You need to run Python with a program that imports pyautogui. You also need to install pyautogui so Python can see it.
I tried to make a game that would have both music and graphics. I decided to make a simple Tetris game for the Hallowing. The code is here: https://github.com/deshipu/hallowing-tetris
Unfortunately, when the display is being refreshed, that interferes with audioio playback and the result is distorted sound.
@tulip sleet yeah its solved
but thanks
@slender iron some really nice description of that game for samd21 I linked to before. There are ideas for some smart optimizations: https://next-hack.com/index.php/2019/04/07/lets-build-an-handheld-platform-game-with-a-cortex-m0-microcontroller/
sure, but may be useful later on
totally
plus, some things are easier to optimize if you think about them in advance
like making CS part of the fourwire, so that we can later dma the transfers
yup, agreed
FYI - "pl" build failed for me again -- must be right on the edge -- travis did not complain. Note- I ran this Friday night, but just saw the results -- still current master, I think.
make: Entering directory '/home/jerryneedell/projects/adafruit_github/circuitpython_master/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
-8 bytes free in flash out of 253696 bytes ( 247.75 kb ).
24700 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
Too little flash!!!
Makefile:309: recipe for target 'build-hallowing_m0_express/firmware.elf' failed
make: *** [build-hallowing_m0_express/firmware.elf] Error 255
make: *** Deleting file 'build-hallowing_m0_express/firmware.elf'
make: Leaving directory '/home/jerryneedell/projects/adafruit_github/circuitpython_master/ports/atmel-samd'
@solar whale is CFLAGS_INLINE_LIMIT = 50 in your version? https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk You can lower that. We might also consider turning off CIRCUITPY_SAMD or _ROTARYIO or similar.
part of the string difference has to do with the version string, which can grow if it includes "dirty", etc.
I'll check but I cloned the repo after the last commit.
set that limit to 48 or 45
ok -- will try in a few minutes.- system updating...
@tulip sleet -- ha -- just rebuilt after updating my Ubuntu and it succeeded...
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
FREEZE ../../frozen/Adafruit_CircuitPython_BusDevice ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_NeoPixel
100 bytes free in flash out of 253696 bytes ( 247.75 kb ).
24700 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
Converting to uf2, output size: 507392, start address: 0x2000
Wrote 507392 bytes to build-hallowing_m0_express/firmware.uf2.
I had not changed the setting from 50....
Sorry for the false alarm -- I have to go AFK for a few hours.
@solar whale great! make sure you start from a completely clean build, but not sure what else to say.
I guess it doesn't make much sense to do this, and it makes the firmware much bigger.
Hi, I’m reinstalling everything on my mac and I forget which gcc-arm-none was the correct one to compile circuit python. I just remember something about a q2 version.
7.3.1 2018q2 (sometimes called q3, I think!)
Thanks dan
Found it! Should be able to get this finished off and PRed tomorrow (GMT+10).
This was fixed by #114, but somehow the site hasn't been rebuilt, which I don't understand.
doing one big PR for all the boards, do not approve this one yet.
I can't speak to the site building after no.114 or not as I can't even see that side of things. But, could it maybe be related to the image source URL?
Its currently https://github.com/adafruit/awesome-circuitpython/blob/master/awesome_circuitpython.png. Navigating to that URL in a browser brings up the repo, not just the image.
Maybe the download URL would be better? https://raw.githubusercontent.com/adafruit/awesome-circuitpython/master/awesome_circuitpython.png
this was added via the features that are now in advanced search thank you @TG-Techie

ok newsletter preview and more did a bunch on that, and features for /downloads and other things, let us know if we missed any news, etc. too - https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-04-09-draft.md
I have done some more thinking and studying on this topic. In particular, I've read (well, read the front part; skimmed a lot more) Using Asyncio in Python 3, and I've read about curio and trio (github_, which is even simpler than curio, started by @njsmith. Trio emphasizes "[structured concurrency...
@tulip sleet That when module looks pretty cool.
@umbral dagger tnx - It came from some thoughts I had before breakfast, so it's a bit rough, but I'm feeling like various ideas are coalescing.
@tulip sleet I find that to be a dangereous time to have thoughts.
sometimes a lack of blood sugar can make things seem overly clear when they're not
@tulip sleet 🎉
thanks - I'm still baffled as to what went wrong with the other PR - the file comparison looks identical. it might have gotten overwritten later ?? anyway, this time, the commit listed looks good.
yay!
yeah, that's a weird one. i feel kind of silly pointing out in the issue, exactly what the previous PR was doing. 😄
well, the PR disappeared when it was merged, so your point was the same as mine; gmta
I have very silly question:
AFAIK circuitpython is limited subset of python
Why you wouldn't stick whole python ? Would it be so huge?
In other words : why original python runtime haven't been used?
MicroPython doesn't implement bytes(object) at the moment, the method syntax is the only way to execute it, i.e.object.__bytes__(). This can be see in CircuitPython too including 4.0.0 beta 5 (also shown in https://forums.adafruit.com/viewtopic.php?f=60&t=150071), example below from a REPL on CPX:
>>> bytes(obj1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'onetwo' object is not iterable
@stark needle for the original Python you need something much more powerful than a microcontroller, for example, a RaspberryPi
for example, just to start, original Python needs 4MB or RAM memory. The SAMD21 microcontroller has 32kB of RAM total.
For comparison, here is how you would do it with some kind of async framework (let's call it "then"):
import then
import time
import digitalio
async def blink1(pin):
while True:
pin.value = not pin.value
await time.sleep(1)
async def blink2(pin):
await time.sleep(0.5)
while True:
pin.value = not pin.value
await time.sleep(1)
async def interrupt(pin):
while True:
await pin.interrupt(pin.RISING)
p...
@deshipu Right, right, yes, we're talking about the same thing! I left out the asyncs and awaits, or propose they might be hidden by the when mechanism.
trio and curio use async with as a style. I'll doodle with the same style:
import when
# similar defs as in previous comment ...
# ...
# I am deliberately leaving out the `async`s because I want to understand we actually need them and when we don't. How much can we hide in the library?
with when.loop() as loop...
Hi, I am just interesting if is possible create device without spiflash.
Just MCU+SD card and run code directly from card and also save files to card.
Thanks
Yes, you can import code or read data from an SD card, but, there is no mechanism for accessing the card via the USB port on the device. That is, there's no passthrough from USB to the card filesystem.
And is possible modify cpython to access to SD card, without use internal flash and spiflash ? ... simple device samd21e18+microsd card slot. I am just interesting about this possibility, SD card with fat system is more standardized and have unlimited storage.
The firmware has to live in internal flash, and there needs to be some code to set up using the SD card (though that could be built into the the firmware).
In general, having a large SD card doesn't necessarily help a lot, because the size of programs is limited by the size of RAM, especially on a SAMD21 (32kB). If you have large data files (e.g., data you are streaming out), then the SD card can help. But having 2MB of CIRCUITPY is not that limiting. It's also faster than the SD card, tho...
Thanks for fast answer.
I know that firmware need live internal flash, I just asking if is possible replace spiflash with sd card.
If I understand, it is possible but spi flash is better ;)
It's not possible to "hide" the async keyword in the library, because then you create a function that is being invoked when you "call" it. With async, "call" will simply produce an iterator object, which the library can then exhaust in its main loop, handling any Futures it gets from it along the way.
I think that syntax makes a very big difference for beginners, and that the "callback" style that you propose is very difficult to grasp for people not used to it. With the async style syntax...
@deshipu Thank you for the enlightenment. I'll rework the examples with async. I think we still might be able to avoid explicit awaits in some cases. I like the interval() style, which pushes the timing into when instead of making it part of the function. But maybe that is too much of a toy example.
@deshipu But I am seeing trio use what you call the "callback" style:
https://trio.readthedocs.io/en/latest/tutorial.html#okay-let-s-see-something-cool-already
Notice child1, not child1(), below, etc.
There are other examples where the args are separated from the function, e.g. start(fn, arg).
Do you have an example of an await/async library that uses your style?
async def child1():
# ...
async def child2():
# ...
async def parent():
print("pare...
Here is a very simple implementatin of such an async framwork, that can only await on a sleep function:
import time
TASKS = []
class Task:
def __init__(self, when, coro):
self.coro = coro
self.when = when
def sleep(seconds):
return [seconds]
def start(*awaitables, delay=0):
now = time.monotonic()
for awaitable in awaitables:
TASKS.append(Task(now + delay, awaitable))
def run(*awaitables):
start(*awaitab...
This presentation explains the trampoline trick that it uses:
https://www.youtube.com/watch?v=MCs5OvhV9S4
As for examples, asyncio uses that style: https://docs.python.org/3/library/asyncio.html
Of course in a proper implementation you would use a priority queue for tasks that are delayed, and a select() for tasks that are blocked on input/output, such as interrupts, reading, or writing.
@stuck elbow thanks 👍
@stark needle what for?
For explanation about python runtime
ah, ok, you're welcome :)
I'm currently linking to release notes on github releases page. Let me know if there is a better location for each version.
Fixes: https://github.com/adafruit/circuitpython-org/issues/54
Example:
https://github.com/adafruit/circuitpython/releases/tag/3.1.2

@stuck elbow cool tetris game, tried it out 😃
thanks
it's not entirely finished -- no full line deleting, no next block, no points, etc.
I just wanted to see if it's feasible in the first place
yah, good test!
I'm thinking if the accelerometer wouldn't be a better interface for it
tilt it to move the brick, tap to rotate...
in my limited experience, tap detection is hard to do consistently
@stuck elbow if you want a pyportal btw, email me whenever pt@
thanks, I will wait for PyBadge :)
awesome!
lol
design will change, but we have 1 extra for prototyping
"I'm gonna wait for christmas"
pt: "It's december 25th!"
<@&356864093652516868> Here's the notes doc for the CircuitPython Weekly for today! Please feel free to add your Hug Reports and Status updates even if you'll be there in voice. It's super helpful! Thanks! https://docs.google.com/document/d/1b2sGCYc7xplbESZ1XVPTf6DgM9FdzBIgZ4BysM64SGI/edit
Google Docs
CircuitPython Weekly for 8 April 2019 Video is available here on YouTube. Join here for the chat all week: https://adafru.it/discord The weekly happens normally at 2pm ET/11am PT on Mondays. Check the #circuitpython channel on Discord for notices of change in time and l...
@idle owl
I will miss the the meeting today, but wanted to share:
- hug to @timber mango for additional PR on improving PocketBeagle support in Blinka and for writing nice Blinka test scripts for PocketBeagle
- hug to hulkco (Gustavo Reynaga) for BeagleBone testing
My updates:
For https://github.com/adafruit/Adafruit_Python_PlatformDetect/issues/20 udev rules have been added by Robert Nelson to the BeagleBoard.org Debian customization package so debian user can now read the board ID from EEPROM without being root
For https://github.com/adafruit/Adafruit_Blinka/issues/100
I2C is working OK on PocketBeagle and no regressions on BeagleBone Black.
@timber mango helped identify that SPI device index (/dev/spidevX.Y) changes between different kernels. A solution was created by Robert Nelson to have consistent indexes (/dev/spi/X.Y). I will work on making Blinka support the new scheme for PB and BBB. I will also do additional SPI testing.
Thanks!
GitHub
currently the call to with open("/sys/bus/nvmem/devices/0-00500/nvmem", "rb") as eeprom: requires root privileges. this leads to scripts that use Blinka and are run on a BeagleB...
@fierce girder Thanks for letting me know! I'll add it to the notes and read it off during the meeting!
thanks 😃
@fierce girder thanks for the mention ;-)
i will be back at this Beagle things hopefully next week! 😃
<@&356864093652516868> CircuitPython weekly starts in 5-10 minutes!
Lurking today 😃 Hope everyone is doing well! Happy Monday!
Just listening in today. No new tale to tell.
lurking
Better than nothing? 😄
Mic issues here. Dropping out. Back soon.
Hoping to have a mic by the time it’s my turn.
just lurking
💯
Ok, I should have a Mic now.
I say "should" because I reloaded software on my computer this weekend and haven't tested it
@paper rivet are you just listening in? (aka lurking)
ya
k, welcome!
cheers
- @kattni for all the behind-the-scenes PyCon prep.
- @jwcooper, @pt, @danh, @tannewt for continued work on circuitpython.org.
- The folks over at Python Discord. I think the partnership is working well. And, they hit 15K members today. Grats to them!
- @Group for being awesomely awesome!
I don't have a mic or sound but hugs to @gilded cradle for help with ST7735
displayio ❤ eInk
Last Week:
-
nRF PDMIn: Did some work to implement the sinc filter. The number representations look better, but the audio is still garbage. Still working my way through understanding DSP filtering. (Latent hug to Audacity for including raw data processing; working on nRF AudioOut first may have been a better idea. Hehe)
-
adabot
- "Updated libraries" list: started, but the plan is changing so that's on hold.
- Did a fairly big refactor, moving the common use functions to their own file. Also moved the CP library validator functions to their own file to ease maintainability. All of this also has the goal of easier expansion for the future.
- Began learning & playing around with GitHub API v4 (GraphQL vs REST). It's...interesting. Requests require more thought and construction, but the flexibility with what you can get out of one request is pretty awesome. Should cut down on execution a lot. I may be requesting authorization to use GH's GraphQL Explorer on adafruit repos, this week. I'm just not sure "who" the request is sent to...
This Week:
- PDMIn: continue tweaking the sinc filter
- adabot, adabot, adabot
sorry for the novel
@raven canopy I can probably give you permissions
@slender iron k. It's listed in the OAuth Apps, iirc.
k, just let me know what you need from me
IN THE WEEDS implement access to pin change events on mcp23017
@stuck elbow If you don't mind please post a link for that samd21 DMA spi example you found
woah - nice!
@pastel panther It's this project: https://next-hack.com/index.php/2019/04/07/lets-build-an-handheld-platform-game-with-a-cortex-m0-microcontroller/ -- the sources are linked at the end
hiya here but text only
thanks my belated update: airlift breakouts going into the shop today - running @sly falcon 's updated 1.3.0 which added Enterprise support whoo! (hugz to docmollo)
pybadge PCBs are ordered, lotsa fun in a credit-card shaped board. has a samd51, minispeaker, arcadey buttons. 1.8" SPI TFT, battery charging, feather headers and stemma connectors
expect those in about a week
last week i did a big push to add all eink chipsets so if you wanna eink your circuitpython you can do that now
Thanks all! Have to head out.
@slender iron btw just verified that yeah i can pwm the backlight on TC2_0 - yeah the datasheet says so but always good to hand-check! thanks for the reminder 😃 - thats with arduino
right, in circuitpython we don't support tc's wo[0]
because we use it for the top value
yayay i know just saying "at least i didnt make a mistake with the hardware"
yup, totally
like TC6 doesnt always exist, want me to put in an issue?
sure
currently used for the counter TOP, maybe we don't care as much about freq (just within the prescale divider ranges)
z'done
thank you!
We currently don't support the first capture compare channel right now because we use it to store the 16bit top value to get precise frequency.
@gilded cradle something like when.triggered(pin#, 'high') is pretty intuitive imo
Meanwhile, in the Batcave....
https://github.com/deshipu/meanwhile <-- what I have so far
has anyone else had issues with pip installing stuff (like cookiecutter) somewhere not on your PATH ?
do you have a virtual environment active?
Thanks everyone. Have a great day!
👋
thanks all! 👋
not as far as I know
Thanks everyone
Thanks!
👋
@stuck elbow thank you for bringing this up and for starting to work on meanwhile!
goobuhy errrabuddy
I hope there will be a "perhaps" method in "meanwhile"
😃
"meanwhile, in another universe..."
does python have a directory where it sets up wrapper scripts for packages that are installed?
@pastel panther I think, but I'd have to dip into the folders. Did you run pip with --user?
I tried that as well, yes
And it won't run anything?
@tulip sleet I just added simple pin polling (without edge/value options) to meanwhile
I can see it installed in site-packages but I don't know what the link between and something on my path is supposed to be
@pastel panther that seems...odd. do you have multiple Pythons installed (2.7, 3.5, 3.6)?
ya
Maybe the paths are crosswired? Might be worth it to force it: python3.x -m pip install --user cookiecutter?
if I was at home, I might be able to help more, rather than throwing out random questions
@pastel panther oh, did you check this part: https://cookiecutter.readthedocs.io/en/latest/installation.html#adjust-your-path
I've become fond of using virtual environments for several versions of Python, and one of the reasons is I know right where any site packages are stored.
Any thounghts on this? ```/tmp/ccu1TDZy.ltrans26.ltrans.o: In function memset': <artificial>:(.text.memset+0x0): multiple definition of memset'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memset.o):memset.c:(.text.memset+0x0): first defined here
collect2: error: ld returned 1 exit status
Looks like you're including more than one library that contains memset()
@pastel panther you can check the userpath with python3 -c 'import site; print(site.getusersitepackages())'
replace python3 with the appropriate binary
hmmm /home/bs/.local/lib/python3.5/site-packages
which is where cookiecutter is
or rather there is a cookiecutter subdir
Here's one way to see what object files and libraries in a directory define memset: ```
nm -A find /Volumes/ThunderBay/src/gcc-arm-none-eabi-7-2018-q2-update/lib -name "*.o" -o -name "*.a" | grep memset | grep -v U
@umbral dagger trying cleaning and rebuilding
I mocked up a simple framework that lets you sleep and wait for a pin change (uses polling internally): https://github.com/deshipu/meanwhile
@slender iron I do.. constantly.
@umbral dagger also, you're using gcc 6.3.1; we use 7.3.1
@tulip sleet curious why you use 7.3.1, current version is 8.3 . I understand not going bleeding edge, just curious if there is a specific reason
@swift arrow we would like to upgrade - there is just some code that currently throws warnings under gcc8, and we need to fix it
ah
actually, maybe this was fixed now: https://github.com/hathach/tinyusb/issues/33 if everything's copacetic, we'd probably switch right after 4.0 is out.
sounds like you "guys" have it pretty close to ready. Exciting times!
@jwcooper @tylerdcooper I'd like work together with you to move forward with this as soon as is reasonable. I understand there may be other priorities.
I changed it because I was in there and better understand size_t can be used to support 64 bit in the future. Perhaps I should have left it to reduce the diff size.
@pastel panther if you're still having cookie woes, give me like 10 minutes and we can compare environments.
Thanks for testing this! We may need longer audio buffers but partial display updating should help as well.
The errors are from here: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/audiobusio/I2SOut.c#L146
They should probably be made less pin specific since it's checking for the combination of the two.
@tulip sleet another way of getting more space would be asf4 removal
I am running a NeoTrellis with CircuitPython 4.0.0 Beta 6.
Whenever I create any kind of compilation error I get the following
Adafruit CircuitPython 4.0.0-beta.6 on 2019-03-30; Adafruit Trellis M4 Express with samd51g19
estingOpen
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'estingOpen' is not defined:
Even if I fix the syntax issue, I still get that error, even if I revert to a previously working code.py file, I have to erase and r...
@slender iron yes, that's true, would look for the easiest things to remove first
@tulip sleet check the make_new functions for builtins (like I did for UART)
@dhalbert I think your "when" proposal has promise. I like the simplicity of it. And compared to other approaches, I think moving the interval outside the def is better because it makes the method more reusable and cleaner. From my perspective, the use of "callbacks" is not that hard for people to understand, whereas the use of await/yield requires explaining cooperative multitasking etc.
I'm interested to hear how your approach would handle terminating an interval. And did you consider gi...
I see, sorry, I thought it's related.
@pastel panther Ping me when you get back so I can show you the rest of the steps necessary when creating a CircuitPython GitHub repo. Thanks!
Since with async the interval is just a loop with a delay, you can easily control the number of repeats:
async def blink1(pin, interval, start_at, repeats):
await meanwhile.sleep(start_at)
for repeat in range(repeats):
pin.value = not pin.value
await meanwhile.sleep(interval)
meanwhile.run(blink1(pin_d2, 1.0, 0.5, 20))
I added a mock of a hypothetical implementation of an async framework if we had the select call available (just for file operations for now, but for sercoms or interrupts it would be similar): https://github.com/deshipu/meanwhile/blob/master/meanwhile_select.py
@kattni I can start on it this week, I hope.
For the script component (if possible), I'd like to follow the same process we use for the files.json (https://github.com/adafruit/circuitpython-org/blob/master/_data/files.json) circuitpython release process. For libraries, we could simply add a _data/libraries.json file that is pushed to this repository on each release. Then, we can just pull in that data in jekyll, etc.
Ya, I only switched one. Will push a larger refactor shortly.
@jwcooper,
Using the same process as files.json shouldn't be an issue. The idea was to have the script in adabot anyway. It will most likely run in a Travis cron job, vs the release builds on circuitpython. Submitting PRs can be the same...
I'll try and get a schema together soon, though it honestly may just come straight out of GitHub's API replies.
Ok, I've refactored everything so it touches many more files. Hopefully it all makes more sense. I did add a gc_never_free which is a catch all linked list from a root pointer for pointers that should live the whole rest of the heap. (Like SPI objects used by FourWire.)
I did add a
gc_never_freewhich is a catch all linked list from a root pointer for pointers that should live the whole rest of the heap. (Like SPI objects used by FourWire.)
That's a great idea!
closing this because I've started a new pull request ...
OK, so this is a new pull request at last for #1042, replacing #1610 which I've closed.
This version moves the code for flash access into ports/nrf/peripherals/nrf/nvm.c which is used by both ports/nrf/supervisor/internal_flash.c and by ports/nrf/common-hal/nvm/ByteArray.c.
The NVM store uses page(s) at the end of the FATFS page allocation, depending on the size of CIRCUITPY_INTERNAL_NVM_SIZE.
I have a keyboard that's built on circuitpython, and while on beta 4, I am able to plug the keyboard in, the code boots, and I can type. When testing on beta 5, 6, or even latest at the time of writing, I have to connect to the REPL for me to see output. Based on the lights on the keyboard, it appears to be running code, but it runs normal after connecting to REPL, so it's hard to check where the issue is.
ItsyBitsyM4
Code used to test was this https://github.com/KMKfw/kmk_firmware
This old code checked for writing identical contents to the flash page, and skipped if that were true. I don't see the same check in your refactored code.
supervisor_flash_flush() is called from supervisor/shared/filesystem.c, but I don't see it in your refactored code.
Also, could you make similar changes to the pca10056 build so it can use nvm?
Should this fix it?
diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
index af84bb807..bbe33c916 100644
--- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
+++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
@@ -147,7 +147,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self,
mp_raise_ValueError(translate("Invalid bit clock pin"));
}
if (ws_clock_unit == 0xff) {
- ...
Sorry, managed to break that while rebasing it I think ... have just pushed changes which puts it back together, and now I'm making clean and rerunning my tests!
See comments. Also BOARD=pca10059 doesn't build.
Yep, I've added in a catch this so that if CIRCUITPY_INTERNAL_NVM_SIZE isn't defined it defaults to zero.
OK so I also modified your adafruit_ble.uart.UARTServer code to write to flash while it was talking and that passes tests too so hopefully ...
Hello
defining secondary uart on custom pins works on reading but nor on writing
can somebody help or give a hint
G'day @makermelissa #1736 is merged & I think it works for my very small test case, can you confirm that this works okay for you now?
@tulip sleet Ah. Ok, I'll update and try
@tulip sleet same behaviour with 7.3.1
@umbral dagger did you do a make BOARD=xxxx clean before building
@solar whale yes, every time at this point
does it build OK for if you just use the unmodified repo - that is - without your changes?
@solar whale Yes, it is definitly the files I am adding that are causing the issue. I can't see how though.
@solar whale They're not defining the functions being complained about.
@umbral dagger odd.. is it possible they are including something that defines it. Do you have your fork on github? If so, post a link so we can better see what is going on.
Still getting the multiple definitions for memset()? I'd take a close look at the link line and see what's being included.
It could be something obscure like a ranlib problem.
@solar whale https://github.com/dastels/circuitpython/tree/modxml
@umbral dagger I'll be tied up for the next few hours (day job) but will look at it when I can
I'll give it a go. Wow, that's a nice README.
Hmm, seems to have an unresolved dependency ```
../../extmod/modxml.c:42:10: fatal error: mxml.h: No such file or directory
odd
oh. I believe I added the header path in the Makefile for the atmel boards.
That should be moved.
No.. I did that already.,
Looks like it may be an issue with CP, the (new) modxml seems incomplete?
I was able to replicate the memset error
If you look in py.mk 2 other mxml files are commented out. Add those in and you'll see a handfull of strnnn functions compaints of the same sort.
I.e. ```Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strncmp': <artificial>:(.text.strncmp+0x0): multiple definition of strncmp'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strncmp.o):strncmp.c:(.text.strncmp+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strcmp': <artificial>:(.text.strcmp+0x0): multiple definition of strcmp'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strcmp.o):(.text+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strlen': <artificial>:(.text.strlen+0x0): multiple definition of strlen'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strlen.o):(.text+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function memset': <artificial>:(.text.memset+0x0): multiple definition of memset'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memset.o):memset.c:(.text.memset+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function memcpy': <artificial>:(.text.memcpy+0x0): multiple definition of memcpy'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memcpy-stub.o):memcpy-stub.c:(.text.memcpy+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:309: recipe for target 'build-grandcentral_m4_express/firmware.elf' failed
make: *** [build-grandcentral_m4_express/firmware.elf] Error 1
Got past the mxml.h error, but weirdly I'm getting a completely different build failure. I wonder what I'm doing differently. ```
/var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T//ccLJQ2ny.ltrans25.ltrans.o: In function sync_window.part.2.lto_priv.1199': <artificial>:(.text.sync_window.part.2.lto_priv.1199+0x12): undefined reference to disk_write'
I wonder if I have some MicroPython stuff missing.
@main meteor did you do git submodule update --init --recursive after cloning?
🤔
I always forget to sync
I'll try it in my usual build arena and see what happens.
@main meteor I haven't seen that one. Oh.. I'm building against beta 3
intentionally
That should be a given from the fork, though
I figured. Do you know the tag/hash for that?
I have a lot of experience chasing down duplicate references like that, but I'm yak shaving trying to replicate your build environment so I can reproduce the problem. Perhaps CraigF is better at that part.
The last merge from master was from commit 35cfc61607dc22453aeffbdcfcc0a74af2a25071
@umbral dagger i believe you're running into a double inclusion with these here: https://github.com/dastels/circuitpython/blob/modxml/extmod/mxml/config.h#L17
after some searching, i finally understand all of the #ifndef SOANDSO_H stuff; they're include guards.
i imagine a simple test would be to just comment them out
@raven canopy Right, they prevent a header from being included multiple times.
Some of the config.h things might be wrong, but I don't see how that would cause the problem.. they typically switch on the provision of local implementation for more esoteric string functions.
Yeah, inclusion is a compile-time issue, it might define entry points, but the multiple definition is a link-time issue.
Basically at compile time, requirements for references (undefined references) are generated. At link time, the linker matches up defined references with undefined ones (so something asking for strcpy is linked to the definition of strcpy). The problem arises when strcpy is defined in more than one place (which can happen in one of several ways).
what generated the config.h ?
configure script
But I've edited it since
Original lib is here: https://github.com/michaelrsweet/mxml
If you build it with V=2 it'll show the actual link command. I'd suggest eyeballing that for duplicated libraries.
Note it's a huge line with over 500 arguments 😃
Eyeing it, I'm wondering if something's breaking the library grouping.
That said, I just backdated the build environment to that beta3 tag and it built properly, so I still am unable to replicate the failure. 🤔
In particular, if you break up the link line by spaces and go down toward the end, there should be something like ```
-Wl,--start-group
-lgcc
-lc
-Wl,--end-group
Yes. Right at the end
Hmm. Those symbols are defined in 4 different libraries (-lc, -lg, -lc_nano and -lg_nano). Maybe grep out all the -l callouts and see if there are any others lurking somewher?
you should only have one libc and one libg. We don't use the _nano versions.
I'm guessing you should have libc OR libg: having both would cause the multiple definition problem.
I think libg is the "debug" (-g) version of libc.
libgcc is a separate thing.
@C47D probably! We should test it to be sure. I'd change the messages to "Invalid %q pin", MP_QSTR_bit_clock style to so that there is only 1 message to translate. (save a little space too)
Does the board crash after the traceback? what is the code.py you are using?
And thanks for testing Beta 6 @Joe-Davidson1802 ! We'll get these bugs squished soon.
Ok, I will fix it and send a PR if you don't mind.
UART.write will return before the last byte is actually transmitted. This is usually fine because it has time to finish while other Python code runs. However, if the write is at the end of the code.py, the SERCOM will be reset early and corrupt the last byte.
We should replace ASF4 here and manage the dma ourselves.
DMA code that isn't messy ASF4? I'm interested
I tried to write something that copied asf4 and it was garbage
looks like you need something called "dma descriptor" that says where from and to copy the data, how much, etc.
I don't believe it can be too messy, since it only has 16 bytes
yeah but there's a whole mess of library code
using it's not terribly messy, but if you don't have asf4 and you want to copy the asf4 implementation, you're gonna have a bad time
I don't plan on copying the asf4 implementation
I suppose that's what the official examples all use
yeah, I didn't really mean "you" I meant "I did this and it was awful"
so I'm interested to see what you guys come up with
@exotic pumice adafruit_zerodma doesn't use ASF
we pulled it out a few months ago
@tidal kiln heya im in meetings but if you want to try a couple things with ESP32 + EPD i can give you Hints
@meager fog cool I'll check it out
@meager fog cool. please do.
@tidal kiln ok first up change SRAM_CS and BUSY to -1
so we dont use the SRAM (in case thats being weird) and busy isnt actually used
id stick to hardware SPI tho, software SPI is more scary
then, theres an EPD_DEBUG thingy you can turn on in Adafruit_EPD - try that
it may slow things down enough
Ok, I think this next run should pass. I fixed boards without shared busses, removed audiobusio from hallowing and removed touchio from pirkey to gain space back.
@meager fog SRAM_CS/BUSY=-1 = same thing
let me go back to HW SPI and re-verify that didn't work (i tried that initially)
yep - uncommented the #def in lib just to be sure
seems to be hanging in ::begin()
here's the ctor:
Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
yep. doesn't look like there are any debug prints in ::begin:
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L146
also SRAM_CS = -1
maybe litter some println()s
yep
I have been testing a "slideshow" using a feather_m4_express and an feather_nrf52840 wiht a TFT featherewing (ILI9341).
It runs fine on the feather_m4_express
but it does not work on the feather_nrf52840
It starts up OK, but only displays a small part of each image then eventually (after a few images) goes to a white screen.
This used to work on the nrf52840, but if I recall correctly, some changes were made to accommodate the BLE timing.
The REPL response is very sluggish on the n...
@meager fog after much littering....
Looks like it has to do with SPI.beginTransactionbeing called twice, this line in csLow():
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L635
first called here:
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L503
and then the next line calls SPItransfer which calls it again here:
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L584
and it hangs on that second call to SPI.beginTransaction in csLow()
@tulip sleet finally got Travis happy: https://github.com/adafruit/circuitpython/pull/1756
I think it may be related to #1758 — the SPI speed is no longer hardcoded, and the nrf's defaults may be wrong for that display? Can you try adding display_bus.configure(baudrate=12000000) in there before you create the FourWire bus?
@hexthat yup I meant the filename. Both versions were ok to have although I know the simplified chinese won't work with the displayio terminal due to the font size.
Did you find a font that works for pinyin as well? I think I'll need to add a way to change the font for a language but it shouldn't be too hard.
I did an additional merge and will merge this if Travis gives the ok.
[adafruit/circuitpython] New comment on pull request #1631: Port Arduino MKR1010 and NINAESP32 error
Please reopen this PR or make a new one if you want the MKR1010 merged in. I believe it's blocked on getting wifi going at the moment.
@dmazzella Please describe what you are using this for.
Closing this. New PRs can be made once a design is determined in https://github.com/adafruit/circuitpython/issues/1380
FrequencyIn is now checked in so please start with that if you still need this functionality. Thanks!
I don't understand -- display_bus is created by the line
display_bus = displayio.FourWire(board.SPI(), command=board.D10, chip_select=board.D9)
when should I execute the display_bus.configure(baudrate=12000000) - after that?
@slender iron I'm testing Nick's nrf nvm PR: something peculiar going on (nvm bytearray subscripts all out of range), trying to debug, and CIRCUITPY not appearing on a debug build 😦 so currently in a rathole
does the main build work ok?
[adafruit/circuitpython] New comment on pull request #1631: Port Arduino MKR1010 and NINAESP32 error
Yes, Insufficient memory, thanks
[adafruit/circuitpython] Pull request opened: #1772 Check that a never free pointer is on the heap\.
This fixes a crash on boards with built-in displays which statically
allocate the display bus. When the pointer is provided to never
free, it tries to allocate on the non-existant heap and crashes.
restarting hallowing build subjob, after latest fix reducing its size
Is there a way to trigger the bootloader without pressing the reset button? i.e. via software
Thanks
I've seen similar behaviour under 4.0.0 Beta 6, running both the quotes code and weather station code. After several hours of running, the code would hang, and the NeoPixel status light would be steady yellow. A hard reset would fix the issue. When running from USB power supply only, it may run for 24 hours between crashes.
I made this font by editing the default.
Hi all, are you aware of anyone working on a dashboard/ gauge for the PyPortal? I'd like to render the Adafruit IO gauge on the PyPortal. I think the hacky way to do it is to render 100 different images for 0-100% (ok, maybe 101 😃 ) but I'd rather not go down that route if there's a different image rendering method.
This PR prevents recursive calls to run_background_tasks().
In the nrf port, the filesystem flush code was setting the on-board NeoPixel. This code is often called from the background. The NeoPixel code has a long wait in it, and it runs background code while waiting. So background code was calling background code on the nrf port. This caused a debug build to hang up or run very slowly, and possibly had performance impacts on the regular build as well.
Re sparkfun lumidrive: I had just squeezed it by reducing CFLAGS_INLINE_LIMIT in mpconfigboard.mk. So that could be reduced further. I was reluctant to make a judgment about which feature might be turned off, since it's not our board. But it's a special-purpose board and perhaps there is some obvious feature to turn off.
@slender iron How are you adding commits to other people's PR's? I thought I had to do that via a new PR based on theirs (at least that's what seemed true when I googled it).
by default you give project mods rights to edit your branch
so you can either edit through github or by pushing to their remote branch
you can try it with mine 😃
ya, it's relatively new
I only do it if I plan on merging after
otherwise it could confuse people that their remote branch doesn't match their local one
@slender iron I cannot push to your branch, at least via https. hmm. I could try the edit in your repo, I guess.
really? what command are you trying?
halbert@salmonx:~/repos/tannewt/circuitpython/ports/atmel-samd$ git push
remote: Permission to tannewt/circuitpython.git denied to dhalbert.
fatal: unable to access 'https://github.com/tannewt/circuitpython/': The requested URL returned error: 403
halbert@salmonx:~/repos/tannewt/circuitpython/ports/atmel-samd$ git branch
* fix_gc_never_free
fix_uart_timeout
master
pulseio_too_fast
that is a direct clone of your repo, not a remote in mine
have you done it with a push instead of on github?
i'll add it as a remote first and see if that works, but it might be https vs git
that didn't help, so I did it from github
hrm, interesting
well, it supposed to work, even with https: https://help.github.com/en/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork
- Update pybadge pins and flash for rev D
- TileGrid now validates the type of the pixel_shader.
- Display actually handles incoming subclass objects.
- MicroPython will inspect native parents to see if special accessors are used.
@timber mango I was kinda, maybe eventually going to do it but haven't gotten past thinking about it. You could probably have one bmp for the frame/scale and use shapes to draw the gauge
@pastel panther yep. I went down a rabbit hole looking for cool graphics since it's pretty trivial to do bmps 😃
@slender iron @idle owl GraphQL Explorer access requested. still not sure who notifications would be sent to; it only mentioned "owners"...
@raven canopy approved
thanks! it'll be queries only for some time... manipulations are a ways down the road. 😄
variables aren't working in the explorer, so narrowing down by condition is impossible. but...it is an impressive protocol, even though its hard to understand.
#include "supervisor/shared/board_busses.h" in pins.c is now obsolete.
Also fixed a doc bug in UART timeout parameter (int -> float)
@tidal kiln ahh dont forget you have to bump lib.properties
so do 2.1.1
i need to get adabot to warn ya
no human can keep up with it
I cancelled this build because it needs PR #1775 to finish successfully. Once #1775 is merged this can be restarted.
I cancelled this build because it needs PR #1775 to finish successfully. Once #1775 is merged this can be restarted.
Hi,
I'm trying to get familiar with CP codebase and i think this is a good issue for that, so bear with me.
As i understand, instead of sending the color data to the neopixel LED the colors should be separated in R, G, B and set the PWM to the proper value to drive RGB LEDs?
Is there a macro to know when to use RGB status LED instead of WS2812-like LEDs?
Check the mpconfigboard.h files for, say, Itsy Bitsy M4, and Metro M4, and you'll see different definitions for DotStar vs NeoPixel. A discrete RGB LED could be similar. But it might be better to regularize all this instead of depending on checking for those definitions. See for example how the CIRCUITPY_xxx stuff is done in mpconfigboard.mk and elsewhere.
Heh, I was wondering why my Feather M4 Express wasn't working. I put newly compiled firmware on there and everything and then I looked closer and saw that it was actually my Feather M0 Express. 😆
Whoops! I've done that!
Too many times...
Hi,
At the top of rgb_led_status.c are some #ifdef checking for defined symbols which i assume are defned on the mpconfigboard.mk, like so:
#ifdef MICROPY_HW_NEOPIXEL
uint8_t rgb_status_brightness = 63;
#include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/neopixel_write/__init__.h"
static uint8_t status_neopixel_color[3];
static digitalio_digitalinout_obj_t status_neopixel;
#endif
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SC...
nailed it
How do you set the timers for PWM outputs when building custom CircuitPython boards?
I am getting an error at the moment about conflicting timers. However, everything should work fine using alternative timers on the SAMD21G (if it knows which to use).
All timers for this pin are in use.
<img width="301" alt="WeChat Image_20190410162543" src="https://user-images.githubusercontent.com/11770912/55856487-c9864300-5bad-11e9-909a-69cec398eee6.png">
This is running on a SAMD...
SERVO1 and SERVO3 are conflicting.
As a follow up to this... the pins in use at the moment are the following:
| Descriptor | CircuitPython | Port | TCC/TC | Alt TCC/TCC |
|---|---|---|---|---|
| SERVO_1 | SERVO1 | PA16 | TCC2[0] | TCC0[6] |
| SERVO_2 | SERVO2 | PA17 | TCC2[1] | TCC0[7] |
| SERVO_3 | SERVO3 | PA18 | TCC0[2] | TC3[0] |
| SERVO_4 | SERVO4 | PA19 | TCC0[3] | TC3[1] |
| SERVO_5 | SERVO5 | PA11 | TCC... |
You might be able to get it working by creating the pwm objects in different order.
Hey @deshipu ,
I have tried that and I still get the same two outputs conflicting. SERVO1 and SERVO3. None of the others conflict at this point. It's very strange.
@deshipu
how do I set the baudrate as you suggested?
nevermind -- this is now working with the current master.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.6-72-gde38ce798 on 2019-04-10; Adafruit Feather nRF52840 Express with nRF52840
>>>
>>>
>>> import slideshow_sd
cat_rug_320x240.bmp Size: 153.7 KB
cats_320x240.bmp Size: 163.3 KB
sibs_320x240.bmp Size: 153.7 KB
skye320x240.bmp Size: 153.7 KB
Update pins to match the new MOSI pin and add all other named pins!
@tulip sleet was the "background task" the issue that was fixed for the nrf52840 and tft display? -- it now works fine. running eddystone beacon and slideshow...
just pulled latest commits -- still works 😉
I think that #1773 may have fixed this.
I didn't know if it was going to fix your problem, but it was interfering with my testing on nrf for something else. It made debug builds be unusable.
Seems to have done the trick.
@nickzoic - hi, I started reviewing this yesterday, but was getting errors when trying to subscript nvm on a Feather 52840. And then I ran into #1773, which interfered with debugging. Will go back to testing this todya.
I'll merge #1774 after it builds successfully, and then double-check it against this.
@tulip sleet any reason not to close https://github.com/adafruit/circuitpython/issues/1686
GitHub
I have been running the slideshowsd.py example bleow as code.py on a PyPortal with current master with no data connection, just a wall supply. After a few hours, the slideshow stops and I see on th...
@solar whale we can close, but we do need more testing, thanks for noticing
thanks - this is mostly for 'beta testin' and will change again once final hardware is shipping since we are moving the backlight pin
>>> spi = busio.SPI(clock=board.BUTTON_CLOCK, MISO=board.BUTTON_OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid pins
that is a bit of a shame, I thought I could cheat and use spi to read a shift register :P
but I could probably use bitbangio for it
@meager fog I don't suppose it would be possible to change the shift register on the PyBadge to something that latches all the time, and not just on the falling edge?
@tulip sleet @main meteor It looks like maybe the culprit is lib/libc/string0.c It defines the functions being complained about.
@stuck elbow this is the only chip really, and its cheap
you can bitbang it very easily
@meager fog the problem is that if I do anything else that takes time, I will miss keypresses
basically, I need "was any button pressed since I last checked" and not "is any button pressed right now"
I had the same problem with joywing
it's fine if all you do is sit in a loop and wait for the user to press a button, but if you need to actually run the game as well, it gets tricky
@stuck elbow yeah we def need a C helper for this
that's why I wrote the gamepad module
@slender iron ^ were youthinking the same?
in arduino we would have a 1ms tick checker
but it's for the wasteful option of a pin for every button
yah this would be nearly identical to gamepad, but it twiddles 3 pins instead of reading 8 😃
do you want to adapt gamepad to allow a shift register?
how fast can you read that shift register?
CMOS logic is pretty sweet 😄
note it ISNT quite SPI
so you really do need to bitbang it
its not worth wasting a sercom
ok if thats fast enough!
oh, right, that may be a problem
but yah i recommend C, running it beween 1-10ms intervals
10ms means it 'self debounces'
in gamepad I actually require it to be low for two cycles
adding to gamepad would be sweet and is a good spot for it
for debouncing
yah either way!
we didnt have enough pins to give one per button
so this was my best option
rad
but this is obviously cheaper and faster
hard to beet the price and simplicity of a '165 😄 ive been using that chip for 15 years
👍
by the way, maybe we could also add that logic to seesaw?
me and the 165 are best buddies
Please link to the code when you have it @stuck elbow
@stuck elbow we kinda did? check neotrellis code
I’m close to needing it too
@slender iron well, when I have the gamepad code, I will make a PR
@slender iron I have python code already
@slender iron linked here: https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/pull/38#issuecomment-481727223
gotta run
so rad! 🎮
@umbral dagger Seems to me that would be half the problem: the trick is to define each symbol exactly once, so it's defined in (at least) one more place to cause the error (at which time the problem reduces to which duplicate to remove and how).
@main meteor I expect that are in lbc as well.
I figured lib/libc/string0.c was part of libc already, but I may be tripping over my own (mis)assumptions.
@umbral dagger are you including two libc's still?
also, CPy has its own definitions of some things
I don't think I was including 2 libcs
the _nano version
I don't know how that's getting pulled in
does the library have its own Makefile??
@tulip sleet No
I'd take apart the link command, and do some shell scripting to use nm to extract the symbol table out of everything it references and grep for the duplicate symbols. I was going to do this for you, but fell on my sword in my attempt to replicate the issue in the first place.
@umbral dagger is the code with a problem in a repo I can pull and build?
I didn't have time to pay attn to this yesterday
@tulip sleet https://github.com/dastels/circuitpython/tree/modxml
I think libc_nano being used because -specs=nano.specs is in the makefile
in the LDFLAGS
@tulip sleet If I comment out the bit pf py.mk pertaining to my module (lines 109-124) it builds fine
That's in the standard codebase as well
What CraigF mentions makes a lot of sense to me, and that would certainly do it.
what board should i build?
grandcentral_m4_express
I was building pyportal and got the same error
Once you've captured the link command, you could try re-running it without the -lc library and see what happens.
Or without the -specs=nano.specs argument.
Sure enough, nano.specs includes the -lc_nano library
(along with a bunch of other tweaks)
ok, so nano.specs is in the original make stuff, so that's fine, so there's something new in the xml stuff that's confliciting
so I wouldn't remove it
we use memset all over the place, so it's not new
Yeah, removing the nano.specs bit doesn't change anything
Hmm, it does end up using -lc_nano in mine.
To get an even more specific view of what's going on, capture the linker command and run it again with a -v option: then it will emit the actual command it's running internally, with the references expanded.
I'm thinking this is a link line ordering problem
You're looking for a command called collect2 (instead of the old ln name). It should have a bunch of -L options showing the actual library search path, the loader script, the object files, and the actual library options used.
I'm going to diff the build logs
@meager fog just a heads up -- I tried updating an ESP32Huzzah breakout to NINA-W102-1.3.0 .binand it connected to my SSID once, then would never connect again - kept giving the "No such ssid" error. I reverted to the older NINA-W102.bin and it started connecting again. I can't create an issue on the nina-fw repo so I just wanted to let you know. I have to go AFK for a few hours -- I'll try to do more testing later. This was with a FEATHER_M4_Express and the esp32 breakout
@solar whale that's interesting....I have to admit - I didn't test the firmware against non-Enterprise WiFi as I was working on that code, but I also never touched any of the non-Enterprise code in there. Makes me wonder if there is something odd/broken with the Espressif environment I used to compile the code 🤔
I can test that when I get home tonight after work
what version of esp-idf did you use?
@sly falcon great! -- This was my first test of the new version - I tried one I compiled myself and your version -- same results with both. I usually see on failed attempt to connect then it succeeds on the second try.
@celest zenith "latest"...whatever that means. I'd have to check that, as well, when I get home
I have the esp-idf from sometime in February.
the upstream uses 3.1.3 but 3.2 and 3.3 branches exist
the one I have would have been from a few weeks ago
sorry I have to run -- good luck -- I hope it's just something on my end...
I'm betting it would have been 3.2 or 3.3...I didn't grab a specific branch - I just did a clone w/o the branch option
@solar whale thanks! I'll let you know more tonight
It might be good to use a specific tag so it is easy to recreate.
@celest zenith I agree, but there was no mention of the specific branch that ladayada used, so I just grabbed what I assumed was "the latest", as per one of her commit comments
I'll get things sorted out later tonight
@umbral dagger I think this has to do with mxml config.h thinking there is no vsnprintf (though there is, in lib/utils/printf.c). But I can't fix it by saying there is vsnprintf.
I'd suggest instead of using extmod that you use the shared-bindings and shared-module structure we use now. We're trying to get stuff out of extmod.
The build logs I saw seem to be OK, but the mxml files and command line args are showing up not in the order I'd expect. But the link line looks ok.
@tulip sleet ok
@tulip sleet I was aiming to echo the structure and approach of the json support
the json support style is from MicroPython. We will make it a shared-module eventually
Ah, ok.
for @solar whale when he is back, or anyone else who would like to try out an experimental build of the NINA firmware 1.3.0 file, I put a copy up on GitHub: https://gist.github.com/docmollo/3ca3669174a63908efa4e81d1bd3e71b
This version was compiled using a fresh clone of the v3.2 branch of the ESP-IDF.
I'm heading off to lunch....I'll be back in about an hour
@wallarug How are you creating the PWMOuts? What version of CircuitPython are you using? (I feel like we fixed a bug with PWM recently so try Beta 6 if you haven't.)
@meager fog cool...good to know. Thanks! I don't have hardware at my office to test with today, so I'll have to wait until tonight to test
Add a second class to the gamepad module to handle the shift register on the PyBadge.
This code looks correct, but doesn't work correctly in practice. Either I missed something obvious, or the timings are too fast after all.
Here is the code to test it:
import gamepad
import board
import digitalio
import time
data = digitalio.DigitalInOut(board.BUTTON_OUT)
clock = digitalio.DigitalInOut(board.BUTTON_CLOCK)
latch = digitalio.DigitalInOut(board.BUTTON_LATCH)
gp = gamepad.GamePadShift(data, clock, latch)
while True:
print(bin(gp.get_pressed()))...
Ah yes: we fixed a TCC allocation bug: https://github.com/adafruit/circuitpython/pull/1184
I think I need to rewrite it to read one bit per timer tick.
@meager fog @sly falcon what commands do you use to falsh the ESP32?
I'm curious how the Certificates are updated (I have my own little CA I use for testing).
@solar whale I use the commands here for the PyPortal...they work for the HUZZAH, too
https://learn.adafruit.com/adafruit-pyportal/updating-esp32-firmware#turn-your-pyportal-into-a-usb-serial-converter-24-2
hmm @meager fog @sly falcon I tried "pre erasing" the flash before loading 1.3.0 and it is now working
wooo!
may have just been bad karma...
@solar whale is this the v1.3.0 firmware on the Learn Guide, or my experimental build I did earlier today?
this was from the learn guide
OK, cool
I'm going to try my own build next
good luck!
sorry for the false aloarm
I'll think happy thoughts about the magic smoke staying put 😉
no worries....added a bit of excitement to an otherwise boring day at the office 😉 lol
sigh -- my "local" build also works now -- possibly erasing was helpful -- who knows -- I'll do it from now on!
that's a good tip....I'll keep that in mind in case I run into any weirdness
I get the same results with one bit per two system clock cycles, so this can't be a timing thing. I can't see what could possibly be wrong here. It receives the last bit correctly, the one-but-last bit is always 1, and the rest is always 0. Here is a test program that uses the same logic in python and in gamepad -- the python version works, the gamepad one doesn't:
import gamepad
import board
import digitalio
import time
data = digitalio.DigitalInOut(board.BUTTON_OUT)
c...
@sly falcon @meager fog Hopefully this is my last post regarding NINA 1.3.0. -- I just tried uploading without first erasing to a feather Huzzah ESP32 and it is working fine. Clearly my issue was a fluke. If anyone has problems. erasing may be a good thing to try, but I'm I'm happy it it working. I'll try a pyportal next ... but proably not until later tonight or tomorrow.
@solar whale wooooo! No worries about another message...I appreciate the feedback!
Heck - if you let me know how the pyportal attempt goes, I'd love to hear that, too haha
This was my first contribution of code to an Adafruit thing......I was nervous as heck and wondered what sort of testing I should do, or others would do...so this has all been a good thing for me 😀
It was a great thing to add -I'm sure it will get a lot of use!
Thanks - I hope so!
@sly falcon had a few minutes -- pyportal update is working fine!! Thanks!
@solar whale cool beans! You're welcome and thank you, too!
@solar whale no biggie, its not too hard to update - so im shipping the pyportals + airlifts with 1.2.2
we'll have AirLift boards in stock within a day
so if you wanted one of em please sign up
signs up
ships with 1.2.2 cause i got a lil spooked
Is there a reason to use the AirLift instead of the HUZZAH breakout?
airlift is simpler, smaller, has RGB leds on it
and has a tristater on MOSI so you can share the SPI bus
the breakout isn't great for it, which is why i'm not promoting it for that use
its more of a development board - also a little more $
Thanks. Now to decide if I need a development board or just the AirLift 😃
@meager fog how do you reprogram an airlift?
Never mind. I see tx/rx
I forgot they were broken out.
@meager fog heh....I got super panicked...I'm glad there was still time to decide to not ship the code and allow a bit more testing 😁
I am pretty sure this was latest pull from 2019-04-08 direct from github. So version 4.0.0 of CircuitPython. Not sure of the exact version. I can double check tomorrow.
@tannewt cycling through all the servos starting at 1 to 8. Creating the PWMOuts based on SeeSaw's libraries (so hidden). I didn't have this issue with the circuitpython built in Feb / March 2019. The SeeSaw firmware that I built is ok - it uses the correct timers that were specified.
from Adafruit_CircuitPython_RoboHat.rm_robohat import RoboMM1
import time
from digitalio import DigitalInOut, Pull, Direction
from adafruit_seesaw.pwmout import PWMOut
from adafruit_seesaw.sees...
Will the CircuitPython ESP32SPI library get controls for the R,G,B LEDs of the Airlift breakout? Not sure how that works in Arduino... is that in the NINA firmware? It's nice to have some signs of life on something like that.
i didnt realize it existed till i designed this board
it is in the arduino lib, i dont have any immediate plans to add it to python
but it is not hard, will get to it eventually 😃
@slender iron I missed what you suggested might be wrong with HID in the latest 4.0. Could you repeat? tnx
if hid is checking to see if usb is connected
but the connection state might depend on cdc
it completely does depend on cdc
so that's wrong
ok, got it, will look more carefully tomw
thanks!
Hi @nickzoic - This is your PR with some additions. Subscripting was not working when I tested nvm on nrf. I think there were some more rebase issues. I've corrected that and changed a few types. Could you test? If it's ok I'll merge this one and close the other one. I've tried pushing new commits to a PR, and though it's supposed to work based on the permissions we have set up, it does not seem to.
@jwcooper,
How does the below schema work for you all?
Truncated Raw Example:
[
{
"library_updates": {
"new": {
"Adafruit_CircuitPython_LIFX": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_LIFX"
},
"updated": {
"Adafruit_CircuitPython_INA260": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_INA260",
"Adafruit_CircuitPython_RA8875": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_R...
Ha! And in true fashion, now I notice that its using the API URL for library updates. Easy fix.
? lol what i say that gets blocked
Still feather_m0_express_crickit and metro_m0_express are to big with the Polish translation. I will go through the translation and try to use shorter sentences.
@upbeat plover It looks to me like the "bot" does not like one of the words as it is transliterated - it matches a British profanity.
Still feather_m0_express_crickit French and German builds are failing. I'm going to remove gamepad from it.
@stuck elbow hihi did you work out the shift register
i was swamped yesterday & couldnt look at yr PR
@meager fog I did, I spent 3 hours yesterday debugging it, because I made a typo and my code wasn't being called at all -- only found it today morning
lol oh nooo
thats the worst
likey ou keep tryig thing and the realize you're editing the wrong file
@stuck elbow ok feel free to ask any other hardware design Q - maybe i made a mistake too
@meager fog I wonder if we could make it default to 24MHz for the SPI clock — it's technically out of spec for the display, but it works reliably in practice
and makes the screen refresh slightly faster
yeah i do it on arduino 😃
it is totally out of spec but ill say something we do on Pi is we do the commands at 16mhz then data at 80mhz and its fine
so i would continue to do commands slower if possible
interesting, but I don't think we can do more than 24MHz on the samd, and the commands still seem to work with that, so...
yes samd SPI is technically 24mhz max
however, the screen is really small
thats why pyportal we did 8bit
for 320x240 its worth it. on the little display, SPI @ 24mhz is plenty. anyways you DMA it
that is something we cant do anything about really - there's no TE pin
i think the sort of games we're doing, 30 fps is plenty fast
right, but faster clock means there is smaller difference between when the top gets updated and when the bottom does, and that means the snake in my game crawls more like a snake than a caterpillar
I'm not sure we are getting 2fps at the moment, tbh
yah thats because the whole screen updates all at once
we'll be doing a ton of optimizations once the displayio is stable
you could use RGBdisplay if you wanted to, for now
That is (slightly) out of spec for the display, but it works reliably.
well, I'm going to use that library I wrote for µGame for now, just need to make it work with fourwire
by the way, nice bootloader on the pybadge
with screen support
ah, so it's not just one big bitmap, nice
huh, and now my code mysteriously stopped working
eh, "I will just do a small refactor, it doesn't change anything, so no need to test it"
😃
The formatting looks great other than maybe dropping the outer array (unless there will be multiple library_updates and open_issues sections)?
Should be quite easy to get that displayed with liquid. I'll use that as the test schema, and let you know if I need any other changes.
Thanks!
@tulip sleet OK, I moved it to shared-* and added build flags as per the others. disabling it results in a clean build, enabling it results in link error. Experimentally trying it with CP master next.
@tulip sleet Identical results
@raven canopy hey when you're around i have a question about adabot for arduino libs
@meager fog I'm in and out on my phone, throughout the day. Can answer sporadically, or we can wait till I'm home later.
np - @timber mango and i were trying to run adabot for checkingf the arduino libraries and not being terribly successful
So, I want to make an addon for the hallowing that will add some buttons to it, and I'm thinking about a name for it. What do you think aboud "hallobutt"?
it would be fish-shaped, of course: https://en.wikipedia.org/wiki/Halibut
sure go for it, m0 is kinda weak for gaming :/
it's enough for chess ;-)
@meager fog Do you have the environment setup, with the token and everything?
yeah we get..
$ python3 -m adabot.arduino_libraries
Running Arduino Library Checks
Getting list of libraries to check...
Found 242 Arduino libraries to check
0 requests remaining this hour
0 requests remaining this hour
0 requests remaining this hour
0 requests remaining this hour
then like 100 more lines
Libraries have commits since last release: (3)
Repo Latest Release Commits Behind
---- -------------- --------------
Adafruit_SoftServo 1.0.0 2
🤔 has it been run a lot within the hour?
Looking at yesterday's cron, Arduino report uses about 800 requests per run. Running it 6 times in an hour could eat up the rate limit. Per token...
Yep. It's on S3.
Yep, that's the folder. I'll try to repro tonight, to make sure it isn't related to my recent refactor...
@stuck elbow saw an article recently where someone wrote a chest program using 377 bytes. http://chesskelet.x10host.com/
@raven canopy np this output is great for onw
@solar whale 😃 😃 😃
OH SWEET, missed the news of the AirLift dropping into the store, somehow...
you were out! 😄
@prime flower I think going forward, instead of a direct email, please file an issue on the applicable repo when you've gotten RTD as far as you can, tag me, I will finish it, and close the issue. This will be better for tracking and visibility.
@idle owl Sounds good to me. That'll help non-adafruit folks as well with this process.
@prime flower That's what I was thinking as well.
@umbral dagger Ping me when you're online either here or over PM so we can set up RTD for itertools
I don't imagine there will be multiple update/issues section. Will drop the outer array.
@hard dove hihi do you have a rough idea when yr around
Now I'm confused. How does Seesaw play into this? Can you link to the robohat library please?
@hexthat Nice! Can you include the updated font in a new directory under tools and hook it in? That should fix the build. Thanks!
Travis passed but failed to update GitHub fully.
Hi - I tried this with the simple test below as main.py, using a PyPortal (so I could see any errors), and I did not see this issue. If I plug the board in, it starts typing a's in whatever area the mouse is in, even without connecting via the REPL. I am using the latest version of master.
Could you make a simple test case, based on your code in some way? Thanks.
@meager fog I think you want @gilded cradle
I assume it's an old account
ooh ok
Yeah, I have a couple email addresses. My discord user in makermelissa
oki! @gilded cradle hihi do you have a rough idea when yr around
ok thanx! ill check with ya later
👌
@stuck elbow for hallowing addon - maybe something "crossbones" related somehow?
This way we can list different board styles and track their
downloads without a completely new binary.
Fixes #1673
I've had some issues with my CP devices lately.
- I have a desktop USB hub, using that at times I can't get a CircuitPython device to enumerate to Windows 10
- I have had a good number of issues after upgrading from Mu 1.01 to beta to 1.0.2 getting the serial window to open properly. I cleaned out the unused COM ports in Windows Device Manager as a first try, still issues maybe related to #1.
Or it could be #2 is due to #1.
Issue logged per request of @dhalbert
@tannewt I don't know how to do that. Is that in the CP github guide? I'm working on Japanese Romaji translate currently.
Please use the object's type to determine what to do.
This is a bit ugly. Instead, how about casting the gamepad singleton to gamepadshift once we know what it is?
Why move this into shared-bindings? I think it should be in shared-module.
Is rotaryio officially MIA from the latest distrubution? import rotaryio can't find the module.
@slender iron Thanks!
I am planning on doing a release later or tomorrow
@slender iron idk how to hook the font thing like you said, and i was wondering if any glyph need to be added so that one font will work with all or most translations, also im working on japanese romaji translation, i got it already in JP characters from MS translate, now im using google translate for Romaji translation.. I'm hoping no accents will be needed in the font for it.
@upbeat plover create a folder for fonts under tools, add the font and then change https://github.com/adafruit/circuitpython/blob/master/supervisor/supervisor.mk#L104 to point to it
Hey @idle owl I have a documentation suggestion - or maybe I was just being slow and it took me longer than most to see the problem.
I have a pile of Trinket M0s that I bought for a keyboard interface - I use them for all kinds of wonderful stuff. But they all have the version 2.0.0 CP that they shipped with:
Adafruit CircuitPython 2.0.0 on 2017-09-12; Adafruit Trinket M0 with samd21e18
I'll upgrade (no problem) and I see a note saying that 2.0.0 isn't supported (again, np!). But I actually went straight to the AnalogIn section of CircuitPython Essentials and when I read from AnalogIn(board.A2) I got "module has no A2 defined"). I switched to "D0" which is the digital pin number and it worked, and I'll upgrade at least to 3.x to be sane, but it wouldn't hurt to add a note that says
"If you get pin not defined, make sure you're running 3.x or higher".
@tough flax Did A1 work properly before upgrading?
Ok.
I think it was only defined for the Analog Out pin
I'm sure someone has a memory of that 😃
It's just because the example didn't work that I raised it
I'm good either way
Is that the exact wording of the error you received? module has no A2 defined ?
Hold on, I'll get it
Thank you
AttributeError: 'module' object has no attribute 'A1'
Thanks!
Also, I'm CERTAIN that there's a reason D0 is named A2 not A0 (@meager fog doesn't do things like that by mistake), but I've made that mistake like 1000 times 😃
Warning added to guide, thanks
Hello pythonions
Any good how to's on creating circuitpython librarys, or at least understanding them
Specifically i2c libraries
The guide we have is more about the technical side of creating the library (GitHub, etc), not so much about writing it. We now use a library called register to write our CircuitPython libraries. You'd need to start with the datasheet, find the registers, then use register and bus_device (needed for I2C) to write the library. There are a couple of examples of using registerto access an I2C board.
But they're library examples, not documented examples.
I'm using that board with that i2c relay, running 4.0 beta 6
I used this guide for I2C https://learn.adafruit.com/circuitpython-basics-i2c-and-spi
This library is for an ambient light sensor that uses I2C. https://github.com/adafruit/Adafruit_CircuitPython_VEML7700/blob/master/adafruit_veml7700.py
register is somewhat documented, so if you combine that with a working example, you might be able to get it sorted.
We can also answer questions. 😃
@idle owl thank you!!
register is designed to make writing libraries a lot simpler - it handles a lot of things in the background.
I'm still pretty new to all this
As was I when I wrote the library I linked you to 😃
Changed default font location and updated file.
dargh i didnt mean to merge my chinese font pull with the new default font pull..... oh well
Does adafruit sell the proper jst connectors/wires to fit in the 2 jst ports on the pyportal
I'll see if I can sort it out. It may be a phantom issue that actually stems from not getting a value to set that detects if it is connected to USB or just power. If that detection fails, the code may hang there. I'll take a look.
@modest atlas Yes.
@idle owl maybe we should add some suggested products for the JST connections to the main learn guide
I added NeoPixels
SAM32 board is already on the master CP branch, kicksat-sprite will be added shortly.
- pictures for both boards will be updated shortly
3893 and 3894 are useful as well ...
Ok I added a bunch.
ok thanks. one of the PIDs you linked was wrong, so I didn't try to figure out what you meant.
oops, 3950. I'll add it. 3590 is definitely someting else
It uses less space like that, and it's much easier to debug having all the code in one place.
Not sure how that would be done. Do you have an example?
@river quest - you could ask Particle to contribute a CircuitPython library for their mesh network 😃
@river quest Sorry - was away -- First congratulate them on a very nice set of products! -- Would be really nice if the Argon could support the SPI interface to the ESP32!
@tulip sleet Dan @idle owl Katy possibly add speaker options aswell
What learn guild would they be added to, pyportal?
@slender iron do you have any idea what I might be doing wrong? I copied board.c from hallowing to ugame10, defined all the buses and pins etc., but when I try to compile it, I get <artificial>:(.text.startup.main+0x1fa): undefined reference to `common_hal_board_create_spi' — it worked before the refactoring, when it was just board_spi()
ah, I see, I don't have DEFAULT_SPI_BUS_MISO
@meager fog Nope. I've done very little with Lua, and that was just in the context of WoW addons.
@dhalbert I think that I sorted out what the issue was.
https://github.com/KMKfw/kmk_firmware/blob/8bb55c84cdb00bbe8ffc6e4ba00d133df5a100c1/kmk/firmware.py#L142
return supervisor.runtime.serial_connected
I think I was exploiting a bug and using it as a feature in beta 4. This was used to see if the board was powered directly by 5V power or had USB data lines available. In beta 4, this returns True even if I am not connected to a REPL, and False if powered my 5V power directly. In the new...
Also, make the _stage library work with the fourwire bus, to re-use the
display.
@jerryneedell sorry, I didn't see your questions. You have it resolved, but just for reference, you would do:
spi = board.SPI
spi.configure(baudrate=12000000)
display_bus = displayio.FourWire(spi, command=board.D10, chip_select=board.D9)
Can someone tell me the pin out of the i2c a and gpio ther are broken out on the pyportal
Nvm find it
I'm also experiencing this issue ✋
I must have goofed with the fork. Will need to make new PR
New PR due to something weird I did with the fork.
Added new board to proper Travis build.
@DTV96Calibre What version are you using and what is your code.py? Can you try a build from S3? It'll include a number of fixes. (I plan on releasing it tomorrow.)
Looks like you needed to git submodule sync && git submodule update --init --recursive .
@meager fog, I'm around now
@tannewt I was using 4.0.0-beta.6
Unfortunately after reflashing and fixing a bug in my code I haven't been able to reproduce the bug (I've been saving directly to the board without any version control so I can't look back at the old code). I'm dealing with a new bug though where the interpreter doesn't seem to see some attributes of objects.
That new bug isn't addressed in S3
@kdb424 We use a low-level call to the TinyUSB library, tud_hid_generic_ready() to see if there's an HID connection. That value is not exposed directly, but it's used by the HID report sending code, which will throw an exception if it's not available after waiting two seconds. See https://github.com/adafruit/circuitpython/blob/master/shared-module/usb_hid/Device.c#L48.
So you could test this indirectly just by sending a do-nothing report (like a keyboard report with no keys pressed), and...
trying to get the pyportal alarm clock working. It seems the touch screen is not responding.
Hey @tannewt ,
Apologies for causing any confusion.
I was using SeeSaw to test that the custom board was not faulty (rule out hardware issue). I think I have also sent the incorrect sample code, which compounded confusion.
Effectively, when using the PWMOut function it says: "All timers for this pin are in use." after calling SERVO1 then SERVO3. It would look like the TCs are possibly being ignored as an option in CirucitPython.
Code
CircuitPython: https://github.com/ro...