#circuitpython-dev
1 messages Β· Page 249 of 1
yeah
only 44kb and OFL
also doesnt look too bad
Yeah, Hebrew font sizes weren't an issue at least π
you may have to enter in the text backwards to make it display
but thats not too terrible
and worth showing
Yeah, like reverse the string, which should work fine.
Always interesting watching how you guys work @meager fog and @gilded cradle : )
π
π
@gilded cradle can you actually call reverse()? in theory it should do the right thing
but unicode is Weird
Yeah, I was just looking up some Python methods to reverse it.
In [2]: reversed = line[::-1]
In [2]: print reversed
ΧΧΧΧ```
I got a NotImplemented error with a slice with negative steps
NotImplementedError: only slices with step=1 (aka None) are supported
Yeah, if I can't get any of the shortcuts to work
NAME_STRING = ''.join(reversed(NAME_STRING)) worked
yay do that then
I'm thinking we could take one of the free, say, Google, fonts, and trim out all but roman, accented roman, kana, kanji, hebrew, and korean
i.e. take out all the ideographs
yeah
we couldnt find one thats just that
would be a useful font, all the simplest characters only
me neither. the font melissa is using has a lot of empty glyphs, as opposed to missing glhyphs (which it also has). Maybe the empty ones are takign a lot of space
i dunno much about this, but was just looking at it in fontforge. This is interesting and could be a starting point for trimming a universal font: https://stackoverflow.com/questions/14557944/downsizing-an-otf-font-by-removing-glyphs
In paritcular this answer: https://stackoverflow.com/a/37159128/142996
yeah wefound taht but was like "omg i do not have time for this" and just found a kana only font
well, maybe I'll take a look later, and make up a list of codes that we need
too tired now
π
during R/O week, an upperclass person told us that sleep was where it's at", when we new freshlings wanted to stay up all night talking
ok, π€ for me really
@gilded cradle ill take a look at a screenshot if/when you have one
just to verify the text is showing right
looks good! wanna make font bigger?
or we could stick with this
i guess its a one-word name, which isnt common
I just went with 18pt all around.
@gilded cradle ok u can merge once travis reruns
Thanks π
@gilded cradle ^^ is reversed() available for non-express boards now?
Iβm not sure. This was for the PyBadge specifically.
Ah. Not an issue, then.
Yeah
FYI -- looks like it's excluded from Express boards according to readthedocs:
okay, I can go back to lurking now. π
Is simpleio meant to be a built-in now?
Saw in in the light docs for the CPX, for map_range but it isn't on my CPX.
no, it's a library written in Python that's in the bundle
I resorted to doing peak = int((cpx.light / 320) * 10) which worked
we didn't have room to freeze it in the CPX
ah okay
we should probably move map_range elsewhere, because it's generally useful
and doesn't need to be part of simpleio
sounds good!
<@&356864093652516868> Here is the notes doc for today's CircuitPython Weekly. Everyone is welcome! Please add your notes to the doc even if you're going to be present for the meeting. It's super helpful! If you can't make it, feel free to add your notes to the doc as well, and I'll read them during the meeting. Thanks! https://docs.google.com/document/d/1ErgKcxoebEFgdZWQK-mTj65dnsHfS5dH5e1DNzuxci4/edit
CircuitPython Weekly for 28 May 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 li...
ok graph in atom now limited to 20 points, might push this as it works pretty well for me
@rare geode speaking as a person with colorblindness, I cannot see any plot on the graph at all: is it in red?
It is all dark grey, but I was just looking at how I can change this
it's in black on black
ok, tnx!
I've never worked with this graphing library before so I'm just trying to find my way around the configuration options
@tulip sleet what do you think of this?
@gpshead Closing this for now. Let's remove the extra argument to be compatible with CPython.
@gpshead Closing this for now. Let's remove the extra argument to be compatible with CPython.
MicroPython ubinascii added a second argument to hexlify(), which specified a separator. This is not compatible with standard Python binascii.hexlify(), and does not add much significant functionality. Let's remove it.
Okay, think I'm just about done with the plotter, I've added curves and more points and it's pretty performant. If anyone gets a chance to try it out please let me now what you think
Color-blind palette example (haven't verified independently): https://gist.github.com/thriveth/8560036
Given a regular Python install and the seaborn library, could see what colorblind options are used at https://chrisalbon.com/python/data_visualization/seaborn_color_palettes/
Color palettes in Seaborn.
I would use it in light mode anyway.
Right now colors are randomly generated with rgb values of between 100 and 255
can you tell whether you're in light or dark mode?
a random color with rgb's of 255 or near that could be near invisible
the lowest line there is difficult to see for me
Right, maybe I'll aim for between 100 and 200 .
few of the randomly generated colours there
How many potential lines on a graph?
and should one be invisible to someone, it's just a matter of closing the plotter and reopening to get new ones
Unlimited theoretically
can you fetch the background color value and choose values to contrast with that?
How many potential lines realistically?
I'll have a look in atom docs to see what's possible π
Depends entirely on your system
I've got 100 lines on right now
this did make my laptop fans start to whir though
I've almost certainly missed some context. I've always had a relatively limited number of lines to consider if I had to deal with colorblind-accessible applications.
Ohh, I thought you were talking about the limits of just how many lines it could display, my bad
Well, there is no constant palette, colours are randomly generated with rgb between 100 and 200, this makes them stand out well from both light and dark themes
but I'm looking into finding the background color and changing that range dependent on the color behind the graph
@tulip sleet Good to know that reversed is back in the core for non-express boards. Thanks!
Okay, didn't manage to get a background color but I've added a config option
will tie it all together after I've had tea
done, settings now have light and dark theme to make it as accessible as possible
@rare geode Would you like to be added to the circuitpythonistas role? We ping once or twice a week about the CircuitPython weekly meeting we have most weeks. You're welcome to join us as well, if you'd like.
Also we ping if there's something important CircuitPython related, but that's not very often that it's the type of important to warrant that.
Sure! That'd be awesome
@rare geode Welcome to circuitpythonistas!
Thank you!
@idle owl I'll just be lurking this week -- at work
@solar whale Thanks for letting me know
<@&356864093652516868> CircuitPython weekly starts in ~8 minutes. Everyone is welcome!
@pastel panther You want to jump into the audio chat to make sure OBS is still working?
sure
lurking
HUGS
- kattni - for help fixing pypi on MCP230xx (which i broke with a refactor)
- dan - for continued efforts in forums
- and others i'm probably forgetting....so....group hug!
Did the function signature of busio/i2c change in 4.x? Cant seem to change the frequency per https://circuitpython.readthedocs.io/en/4.x/shared-bindings/busio/I2C.html#busio.I2C
Lurking
I'm lurking today also
Lurking too today.
@rare geode Are you lurking today as well?
I don't have much to comment on, so I can comment on the atom thing but not much else
for now anyway π
That'll be great! You'll get a feel for the meeting as we go π
Lurking from the studio again today.
Lurking for now
is lurking
@mighty hedge we're having our weekly meeting in the CircuitPython voice channel. you're more than welcome to join, even if you just want to listen.
CircuitPython Organization
i am lurking
thanks for the work on the Atom plugin @rare geode π
Now Unlurking
@rare geode just wondering what is your package for atom going to do?
@rare geode Could you make this plugin be a prerequisite/dependency for yours? https://atom.io/packages/fsync-on-save I worked up this minimal plugin to do safe saving on Windows and Linux
@soft moat are you lurking in the meeting, or do you have any hugs/status?
dan, i mentioned that last night. APM doesn't do dependencies (that we could find), so there is a note in the readme.
π
the code is really small - you could just duplicate it
Hey @tulip sleet, I coudn't find a way to require it but I've put a warning in the README. I'll open a forum post on Atom to see if I can require
hehe. well, yeah, there's that approach. π
Ah yeah, that would also be a solution, I'll give that a shot if there is no other way.
@soft moat are you going to participate with Hug Reports and Status Updates, or are you just listening in?
@inland tusk basically what the Mu integration does, serial and graphs
See the images in the README, they display the serial & plotter https://github.com/jos-b/atom-circuitpython
@rare geode maybe you saaw this already: https://discuss.atom.io/t/depending-on-other-packages/2360/5
New fonts! Great work @gilded cradle
Ah, I saw the git dependencies, does that register the package? If so I can stick a link to the adafruit github repo in there
I'll give it a shot post-meeting π
@pastel panther sorry about that, just lurking!
Thanks @turbid radish
@soft moat no worries! we just wanted to make sure that if you wanted to participate, that you had the chance.
yep, just listening in since it was around 4.0 release.
Cya there @pastel panther π
sha-weet @prime flower
Not normally in on thurs but I'll make an exception for ya π
I'm not coming in until Friday, so you're all good
Despite being a kwarg within the constructor (https://circuitpython.readthedocs.io/en/4.x/shared-bindings/busio/I2C.html#busio.I2C), Frequency is not a set-able property.
Would it be possible to set the frequency via a call to i2c.Frequency.
>>> i2c.
deinit readfrom_into scan try_lock
unlock writeto
π @ruby tiger. you just lurking, or do you have anything you want to say/type?
Added description text and link to the New Products Youtube instead of Top Secret.
@tulip sleet i'm more than willing to do some of the more "maintenance" stuff like build-triage.
@raven canopy Thanks! will see what I can pass to you
Thanks everyone!
l8r all!
Thanks all!
Thanks!
later!
Thanks everyone
thanks everyone
thanks!
Subscribe to the CircuitPython newsletter https://www.adafruitdaily.com/
π
Add description and link to where the product is shown in New Products on YouTube.
@tulip sleet and/or @idle owl For later, https://travis-ci.com/rhooper/Adafruit_CircuitPython_NeoPixel => I guess I need to figure out what's involved in getting pypixelbuf available for pip (which involves getting https://github.com/rhooper/Adafruit_CircuitPython_PyPixelBuf into the adafruit repo, I imagine, and getting the module into pypi)
@ruby atlas That will be me. That will help you with that. That's my domain. π
OK we'll sort that out together later.
I'm looking to make a GPS laptimer using pygamer (when it's available for order again). As a stop-gap, I've ordered an ItsyBitsy M4 to start developing. The system will use the GPS (ideally at 5 Hz), parse the NMEA sentences (hopefully filtering to just two per interval) and perform some maths to see if the last coords and previous coord intersect a virtual start/finish line, then do some very minimal screen updates if it intersects. Do we think that this can be performed OK on the ATSAMD51 using CircuitPython, or would I need to use Arduino C/C++ code?
I wouldn't think that doing a set of calculations a few times per second would be a big deal. The data transferred from the GPS device to the microcontroller per second isn't too high, either, is it?
5 Hz sounds reasonable yeah
Cheers π
It really depends on how complex the maths is
I think that for testing for intersection you should be alright
Yeah thought it would be line-line intersection
I worked with this equation when doing raycasting in python
It's not particularly intensive math
Though that might not quite be right in all cases. Might not consider what happens if the intersection point is outside the boundary of the four points given.
Hey @tulip sleet, since it was unclear about whether installing via git would activate the package automatically I've just copied the code from your repository over to the package, cheers for the recommendation π
@gilded cradle im around when u r
also, light & dark lines have been added to the settings panel now so that can be changed by theme
dark mode
very vaporwvae
and light mode (sorry for delay, had a nightmare with node-gyp again)
Is this the right place to ask for pointer on the hallowing too?
I'm not sure where to look for information about sending text (as opposed to bmp's) to the screen.
@errant jetty Circuitpython would probably work great for that. For the timer itself, I'd recommend using time.monotinic instead of the time from the GPS as you won't have to worry about setting the time-zone, which can be kind of finnicky.
@spice tendon #help-with-circuitpython is more help-oriented than developer-oriented, but might not matter much.
Hi @meager fog, I'm here
hiiii welcome back
Thanks
quest is - try to make a 'gif' that flips thru the different languages
and thats the thumbnail gif
try ezgif.com
you should be able to upload a bunch o images and make a 'flip' book, with 1 second per
you will get 5 GP and 3 EXP
π
Ok, Quest accepted. π
Thanks π
@tidal kiln wanna release CP lib 1.8.4? i just mergeded
sure. np. on it.
Looks like ezgif.com's Gif Maker is down. I could try an animated PNG or use another tool
I'll try giphy, that seems to be working
as long as it doesnt watermark
zis isnt workin? https://ezgif.com/maker
what happens when u try?
@meager fog done. thanks for the discussion and merge. will close issue when forum poster reports success.
Nope
hmm can you get to ezgif at all
I'm trying to disable extensions and stuff
I can access all other ezgif pages
Can't access it through my phone either. Same error
really
weird
ok
ill do the gif for ya
do you by chance hav eall the images in front of you
you can zip for me
if not i can extract em from the guide
Yes, I have them, but I'd like to really quick so the PyBadge doesn't appear to move around so much.
Should take like 10 minutes
Sounds good
Yβall probably already know this, but ImageMagick can make animated gifs: http://www.imagemagick.org/Usage/anim_basics/
imagemagick is fine by me, but ezgif doesnt require reading a man page π
@gilded cradle afterwards, we'll need some text here
Accounts
dunno if mike gave you some pointers on how we make up those pages
Yeah, he gave me a little bit to go on. I'll work on that after I get the pics taken. I had to restart my computer.
rad ill be in another window, just tag me or email me when its ready 4 me to look at again π
Ok, getting close
Ok @meager fog, done
I mean I got the images prepped
You can download from https://github.com/makermelissa/Nametag/blob/master/Animation.zip
@gilded cradle will get to it soon, on a vidcall
No problem. I'm using a local tool to create it
Ok, I got the image replaced with the animation. I'm gonna work on the setup page.
@meager fog, it's ready whenever you are.
Sounds good. I'll go onto something else then.
Cool
gif is good!
Thanks
i think its super powerful to show the langs
Yeah, definitely.
I moved the stuff from the last page to the setup page and fleshed it out more.
Yay!
oh sorry one more favor can you add the hebrew to the gif
It should be in the gif
ok
thats odd i dont see it
Like bewtween the japanese and english
Ok, that is odd. It's showing on https://learn.adafruit.com/guides/latest
You can, I just used photoshop to create. I had to resize the pics to 640x480 or it wasn't centered
Is it showing up now?
Yes
gr8 u wil blog this too π
I figured that's why you were asking π
i am not subtle
lol π
Ok, I think I should clarify. I've blogged before on my own websites, but I don't think I have access to blog on Adafruit's blog.
oh ask mike to show you how then
Ok, cool
π
hi @gilded cradle good work on this! https://learn.adafruit.com/pybadge-conference-badge-multi-language-unicode-fonts
Thanks π
Congrats, Melissa!
Thanks @fathom basalt
Love the Japanese βburinkΔβ!
Nice...
comment to subscribe since I am doing hid gamepad example in arduino :)
@rare geode @scarlet maple @trim elm thanks all for help in my first foray into Circuitpython!
No problem!
@tulip sleet, @idle owl, and @raven canopy I have written a little of my thoughts on touch and directional inputs and a small proposal to add to displayio. the specific proposed changes to displayio are listed at the bottom.
https://docs.google.com/document/d/1y7apHqMdSQ_KJDERY215SmLzgpEGxtRmjI07WIjV91Y/edit?usp=sharing
I have am trying to add some of this but am pretty over my head π
sorry about the multiple pings, it was an accident.
@split ocean I just added a new feature to adafruit_portal to allow the NASA viewer for PyPortal to work with YouTube videos. This was noted as an issue on: https://forums.adafruit.com/viewtopic.php?f=56&t=151409 . The code is currently at https://github.com/kevinjwalters/Adafruit_Learning_System_Guides/blob/master/PyPortal_NASA/nasa.py and https://github.com/kevinjwalters/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py
Just to be clear and to avoid over excitement, it just grabs a still image, doesn't convert the video! It also includes a minor change to pick up the NASA API key from secrets.py
Very nice, @simple pulsar thanks for that!
hey @tulip sleet is there no Feather M4 eraser? If there is, it appears to be missing from the guide:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#old-way-for-the-circuit-playground-express-feather-m0-express-and-metro-m0-express-20-25
form this thread:
https://forums.adafruit.com/viewtopic.php?f=60&t=152323
@pastel panther I didn't make those; Limor did; yes, it's missing, but https://github.com/adafruit/Adafruit_QSPI/blob/master/examples/flash_erase/flash_erase.ino has support for Feather M4, so we could add one.
@tulip sleet Those uf2s were generated by that script?
maybe - I'm going to build one and see if it works
@pastel panther - ok I have a working eraser, just need to make a .uf2
awesome
@pastel panther ok added to guide
@tulip sleet awesome! Thanks
typing in wrong channel
is the extending cp guid still up to date? i am on the mpconfigport.h part near the bottom and cannot find where to add the extern const struct _mp_obj_module_t in the config header file https://learn.adafruit.com/extending-circuitpython/inside-the-virtual-machine
Hi, is there a chance to get the adafruits boards (only, not circuitpython specific modules) backported to micropython ?
@slim stratus answering your question in the forums: https://forums.adafruit.com/viewtopic.php?f=60&t=152352
Thanks π
@wild garnet What is the issue?
@wild garnet If you are looking for help using CircuitPython it may be best to ask in #help-with-circuitpython -- If you have found a bug or have questions about the development of Circuitpython, then this is the right channel -- but in any case, go ahead and ask.
import analogio
import board
import time
Create analog inputs for each ADXL335 axis.
x_axis = analogio.AnalogIn(board.A1)
y_axis = analogio.AnalogIn(board.A2)
z_axis = analogio.AnalogIn(board.A3)
Define function to convert raw analog values to gravities.
def accel_value(axis):
# Convert axis value to float within 0...1 range.
val = axis.value / 65535
# Shift values to true center (0.5).
val -= 0.5
# Convert to gravities.
return val * 3.0
Main loop prints acceleration every second.
while True:
x = accel_value(x_axis)
y = accel_value(y_axis)
z = accel_value(z_axis)
print("Acceleration (G): ({0}, {1}, {2})".format(x, y, z))
time.sleep(1.0)
this code is used for acquire and print the data in adafruit circuitpython
I am using the "MU" adafruit circuitpython APPLICATION
here write these code then click the serial botton
the output is "Blinkblink" countineouslly
@umbral dagger i'm curious if the extending cp guide is still concurrent with 4.x* i am working on teh last port of teh mympdule exercise and it looks like mpconfigport.h file no longer has a EXTRA_BUILTIN_MODULES macro. (i've tried adding in the line outside of a macro for kicks but it did not work).
i am getting this error:
../../shared-bindings/mymodule/MyClass.c:22:28: error: passing argument 2 of 'mp_arg_check_num' makes pointer from integer without a cast [-Werror=int-conversion]
mp_arg_check_num(n_args, n_kw, 0, 0, true);
^~~~
In file included from ../../shared-bindings/mymodule/MyClass.c:5:0:
../../py/runtime.h:80:6: note: expected 'mp_map_t * {aka struct _mp_map_t *}' but argument is of type 'size_t {aka unsigned int}'
void mp_arg_check_num(size_t n_args, mp_map_t *kw_args, size_t n_args_min, size_t n_args_max, bool takes_kw);
^~~~~~~~~~~~~~~~
../../shared-bindings/mymodule/MyClass.c: At top level:
../../shared-bindings/mymodule/MyClass.c:100:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.make_new = mymodule_myclass_make_new,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../shared-bindings/mymodule/MyClass.c:100:17: note: (near initialization for 'mymodule_myclass_type.make_new')
cc1: all warnings being treated as errors
make: *** [build-metro_m4_express/shared-bindings/mymodule/MyClass.o] Error 1
Looks like an argument has changed type.
@wild garnet what filename did you save the program as?
@wild garnet what filename did you save the program as?
@tidal kiln, he cross-posted to #help-with-circuitpython where I started asking a few questions too. No answers yet. Don't even know which board he is using, and if he even have a <board>PY drive
@scarlet maple Thank you for the info. I'll try there.
@main meteor okay... tahnk you for pointing that out. there have been some changes from the article to the current cp. some arguments are in a different order and how to link a module in.
speciifaclly i think this does not work: ```
First we need to add our new module. Look for a comment very similar to
// extra built in modules to add to the list of known ones
Add a line to the list immediately following it, similar to the rest. The difference in what you add will be that it mentions your new module:
extern const struct _mp_obj_module_t mymodule_module;
The second thing to do is add your module to the EXTRA_BUILTIN_MODULES macro, with a line like the others there:
{ MP_OBJ_NEW_QSTR(MP_QSTR_mymodule), (mp_obj_t)&mymodule_module }, \
Don't forget that reverse slash at the end of the line. ```
how does it not work?
there is no EXTRA_BUILTIN_MODULESmacro in /ports/atmel-samd/mpconfigport.h
I think most of it's been moved to py/circuitpy_* files
ah found it; building
build failed. think i have a typo. thank you @slender iron i'll work on a pr for the guide
so it's compiling and almost working: when i try to import mymodule i get an error saying it doesn't exist but i can reference it and see what's inside of it. like so: ```>>> import mymodule
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'mymodule'
dir()
['name']
dir(mymodule)
['class', 'name', 'MyClass']
that is what happens when it is not in this list: https://github.com/adafruit/circuitpython/blob/master/py/circuitpy_mpconfig.h#L556
thank you @slender iron ! ```>>> import mymodule
dir()
['name', 'mymodule']
@slender iron if i wanna subclass group in the cp source code should i just copy paste a version?
I don't know how to subclass between native objects
are you doing it for the poke module? I don't think it needs to be done in C
yes it is, my though to doing it in c is that the events will be looked at every-time the display is refreshed
what do you mean by "looked at"?
go through the events and manipulate the pointer location . that way the display refresh and pointer will always be synchronized and the python user doesn't need to call a process_events() function.
I don't think you'll want that natively done because the movement may need to be tweaked on a case-by-case basis
I wouldn't change the C until you know a specific thing that needs to be faster or data that needs to be exposed that isn't
okay, i'll work on it script side for now π
kk, that'll be easier to iterate on too
event propagation and tab order can be very complicated. The HTML dom is the closest thing to what you are wanting I think
agreed, the Group type seems close enough to dom tree. (I've been revisiting displayio and i like the changes )
great!
@marble hornet It likely needs some updating.
i took a look at the adafuit learn guide repo and greped for extending and a few other words but could not find the source
@marble hornet the guide source is not in the github repo. only the code source. use the feedback link to submit a request for it to be updated
do we want new boards added to master or to 4.0.x?
@slender iron I think it makes sense to have them in the current stable so they are available ASAP. I'd do a new stable release.
so 4.0.x then
π
Thanks for grabbing circuitpython-stubs! I'm tannewt on pypi too and I can add our adafruit accounts we have after I get additional ownership.
For author I'd do "CircuitPythonistas" and "circuitpython@adafruit.com" for the email.
I think this should be 0.3.0 because it's the latest at this time.
Running against a pylint error I can't figure out. Erroring on no-member while denit exists within pwmout (https://circuitpython.readthedocs.io/en/4.x/shared-bindings/pulseio/PWMOut.html#pulseio.PWMOut.deinit) (https://travis-ci.com/brentru/CircuitPython_RGBLED/builds/113806920#L277), (https://github.com/brentru/CircuitPython_RGBLED/blob/master/adafruit_rgbled.py#L68)
Isn't Travis using blinka ? Does PulseIO.PWMOut in blinka have a deinit member?
hmmmm, i remember it was a software-based pwm in blinka
Can't find it : https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py
Yes, but the blinka version has its own code and is missing deinit
Yeah, I just looked at that file. I'll file an issue. Thanks @lofty nova
yw
little things that make me look into the dark corner of CircuitPython. make me learn a lot π
i wonder if we should actually expand the ignore-modules in .pylint.rc. not everything in Blinka will match the core. with the specific case of PWMOut, it looks like only the Coral and Giant Board will have PWMOut... RPi only has PulseIn. https://github.com/adafruit/Adafruit_Blinka/blob/master/src/pulseio.py
i'm sure this will be a larger part of the discussion when pylint version is bumped to current....
@prime flower pylint: disable= that specific line. It's an issue with the way the modules work.
Nevermind, it's a bigger issue than that. Check the GitHub thread. @prime flower
Python Bytes podcast delivers headlines directly to your earbuds.
CircuitPython is first on the list!
@somber coral you around?
This reduces output from #1915 dramatically.
do you have a file named code.py or code.txt already in your CIRCUITPY folder?
@gilded cradle do you have a Google Coral board set-up rn?
No, I donβt have one at all.
Oh, thought you did. Np!
Itβs ok. π
I have some odroid boards and an Orange Pi R1. Maybe thatβs what you were thinking of.
anyone want to handle this issue? https://github.com/adafruit/Adafruit_CircuitPython_BME280/issues/25
@slender iron - did you by chance talk with Michael Kennedy at PyCon?
It would be great to see you on Talk Python to Me
well "hear" you
@old smelt I didn't unfortunately. I did chat with brian okken
He has a CPX
just got an email from mkennedy because I emailed about circuitpython 4.0 and it was mentioned on python bytes
It was still in the bag last time he showed it to me, though. That was a while ago.
ah, I offered to answer any questions about circuitpython to him
That's cool.
@slender iron , Just got my hand on a BME280, so I can have a look. A quick word about what I should look at ?
Is this just about removing frozenset( ) ?
I can have a look to the 3 others issues too
@lofty nova yup, I think frozenset can just be replaced with a tuple
ok. If I look into the other issues, should I submit 1 PR per issue or all-in-one ?
1 per ideally
Just tried it on another board, def not a caching thing...
what happens if you just try one of the imports at REPL?
from adafruit_mcp230xx.mcp23008 import MCP23008
or
from adafruit_mcp230xx.mcp23017 import MCP23017
@prime flower this one works for me on Feather M4 with a PID 292:
https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/blob/master/examples/charlcd_i2c_mono_simpletest.py
@tidal kiln still get the from adafruit_mcp230xx.mcp23017 import MCP23017
er
ImportError: no module named 'adafruit_mcp230xx'
you're using a metro?
yup, a m4
how'd you copy PR version of library to the metro?
I'm sitting at dcf1613db5cee295f040c1a950eaf7aecc7a98e7 on the iss36 branch
but how'd the files get on to the metro?
I just did a `mv adafruit_character_lcd/ /Volumes/CIRCUITPY/lib
Contains a fix to the _data/libraries.json auto updating script. A typo was causing the git updates to not occur.
Hi, there is a strange code in the BME280 lib which is pointed by pylint:
if var1 == 0:
return 0
if var1:
pressure = 1048576.0 - adc
pressure = ((pressure - var2 / 4096.0) * 6250.0) / var1
var1 = self._pressure_calib[8] * pressure * pressure / 2147483648.0
var2 = pressure * self._pressure_calib[7] / 32768.0
pressure = pressure + (var1 + var2 + self._pressure_calib[6]) / 16.0
pressure /= 100
if pressure < _BME280_PRESSURE_MIN_HPA:
return _BME280_PRESSURE_MIN_HPA
if pressure > _BME280_PRESSURE_MAX_HPA:
return _BME280_PRESSURE_MAX_HPA
return pressure
else:
return _BME280_PRESSURE_MIN_HPA```
As var1 as been already tested to 0 above, I feel that the test if var1: is useless
Which make the final else: useless too (which is the line pointed by pylint)
@lofty nova Could you put all that in an issue for the library?
I'm already working on an PR for that library
It's the pylint before submitting
π
π OK, then I would say go ahead and fix it and note it in your PR.
Thanks
Can you confirm my reading that if var1:is useless as it follows if var1 == 0:
You will get a change in behaviour
this code may have been translated from the corresponding Arduino library, so you might want to compare it with that and sees if there's actually some kind of error: https://github.com/adafruit/Adafruit_BME280_Library
Also there's this older Python library: https://github.com/adafruit/Adafruit_Python_BME280
which is deprecated
As var1 has already been tested against 0, the if var1: should always be true ? SO never go to the else (as pointed by pylint). So we can remove 1 level of blockl
yes, can remove the if var1:
π
but it would be nice to know what's really right. I wonder if the test for zero was added as some kind of hack
One test is needed to avoid div by zero
I'll check the history. The Arduino lib also has the test agaisnt 0 but not the other tests.
@slender iron i'm digging into the build-tools failure on ImageLoad. appears my path walking doesn't like double nested folders.
@lofty nova what is your github username? gonna add you as a librarian so I can assign issues to you π
barbudor is the name π
@raven canopy perfect! I was just about to pull up travis
kk, not always the same π
@lofty nova invited!
Thanks
no problem!
- package files: adafruit_imageload | [....,
'adafruit_imageload/pnm/pbm_binary.py',
'adafruit_imageload/pgm/ascii.py`,
@slender iron yep...its dropping a parent folder. that last line should be imageload/pnm/pgm/ascii.py.
@raven canopy want me to fix it or review?
well, you'll probably have a quicker fix, if i'm being honest. π
do you have time to look now? I'm in the middle of stuff
actually it's probably not super urgent either
i can work it. nothing pressing on my end...
ok, thanks. I'm gonna bughunt my displayio pr
hah. i'd say that def takes precedence.
@lofty nova you could also catch the divide-by-zero instead of testing in advance, and throw some kind of error. The behavior of returning zero maybe be left over from the Arduino driver, and perhaps it would be better to actually throw an error. But I don't know the use cases. Also compare how the other similar drivers (BMP280, BME680, etc.) act.
Ok. I'll do that tomorrow. π time now. Thanks
@slender iron got build-tools sub-subfolders working; about to run a full bundle to regression test.
but, its failing on mpy-cross now for imageload/tests/. displayio_shared_bindings to be exact, which i assume is because of the type annotations in it. i have an issue open on build-tools that touches on this subject. unit-tests, imo, shouldn't be in the package folder.
Ok, I fixed the off-by-one error. This should be good to go if Travis is happy.
i don't have a problem with that overall, tbh. but, for our distro system, should they be included? if they should be kept for dev, i'm fine with it; we'd just need to add the corner case to not include in the bundle.
I'll just move it, it's the second option listed π
ohh! π€¦ browser opened up not maximized, and scrolled down to the "inline" option. lol
regression looks good. want me to wait for imageload updates to test before pushing? its now the only lib with sub-subfolders.
Thoughts on packaging python libraries β Note This is about packaging libraries, not applications. βΈ» All the advice here is implemented in a project template (with full support for C...
ya, I sent the link to the second
π
@raven canopy is there a pr to review for build bundles?
just put it in! had to start dinner π½
k. about to eat. i can release after that...
I can if it's nothing more than tagging it
yep. just tagging for the pypi deployment.
kk, will do
Added you as owner to the package on PyPI. I'll update the PR when I get the chance this weekend.
Hello, kindly request review of the PR for BME280 driver.
@lofty nova i'll take a look. also, you can add the adafruit/circuitpythonlibrarians to the reviewers and everyone will get a notification that a PR is ready for review.
sorry, yeah i did it.
question: have you experienced any occurrences of the calibration data resulting in var1 == 0?
no, but I didn't let the chip run for long
As I explain in the commit, the only reason I see for var1 ending to 0 is that the reading of the calibration registers at start returns 0
var1 = (1.0 + var1 / 32768.0) * self._pressure_calib[0]
ok, not 100% true if var1 enters this formula with -32768.0
I have to double check again
But Bosch original C code has this test without any explaination to what could cause var1 to become 0
yeah, i saw that. and reading through the datasheet, i can't really come across anything that explicitly states that * 0 should be guarded against. but, nothing works 100% correctly, 100% of the time.
That's why I think only an hardware error could lead to this which would mean that the coefficients values couldn't/shouldn't be trusted. So better raise an exception which point that, than silently return 0 or a minimal valid pressure
i tend to agree with that. since the calibration values are factory set, and static, i wonder if its better to just read them at init and store them... but that is separate from this PR
wait a sec though. that may already be happening. this file is loooonng. π
hehe. yep, it is.
@lofty nova i approved, but didn't merge it yet. called in a second opinion... π
I'm looking also into the issue reported by the guys who was claiming about a wrong formula to compute altitude. My thermodynamics are so faaaaar away ..
sounds good. i never really found my thermodynamics, so i can kind of empathize. hehe
Hi, I'm flashing the Circuitpython bootloader and application to a SAMD21 based board, I'm using a jlink and gdb
How can I debug the CP code and not the bootloader code when the board is out of reset?
@granite crow have you read through this guide?
I haven't, but taking a quick look at it and I noticed a couple of things I was doing wrong
I was using arm-none-eabi-gdb instead of arm-none-eabi-gdb-py, I guess that's because the microbuffer stuff
And I was using target remote instead of extended remote
well, use the GCC from the current build instructions. i think that guide is a little out of date on that.
the gcc-arm-embedded from the ppa repository works fine for me.
no worries!
In the docs for displayio the first parameter starts with the word or instead of displayio.FourWire
docs: https://circuitpython.readthedocs.io/en/4.x/shared-bindings/displayio/Display.html
source: https://github.com/adafruit/circuitpython/blob/aae7cb3eb0ba547b1253b4bf55488465915a9ce4/shared-bindings/displayio/Display.c#L81
I'm able to debug CP :+1:, I'm compiling it with debug symbols but can't set a breakpoint in rgb_led_status_init function, let's keep trying
This board doesn't have status color, so maybe that function isn't included on the bin
@granite crow try turning off -flto in the makefile
<@&356864093652516868> meeting notes for the meeting on Monday at 11am Pacific / 2 pm Eastern: https://docs.google.com/document/d/1xLEidiYfibYYL06EkBm_KXCGcEtFPjUCRFp3XlnYeHs/edit?usp=sharing
I will @slender iron
It doesn't fit the Flash without lto, target is samd21e18
@granite crow when compiled with LTO, functions may have names like rgb_led_status_init.123.something or similar, so type the first part of the name, and the press the <tab> key to see what's available
It's not available, I guess it's being optimized because it's doing nothing when CP is compiled for my board
I'm guessing hehe
if no status color, yeah, it would not be compiled in
I'm testing the addition of rgb leds as status indicators, for my custom CP build i can see the new_status_color function, but now the board is being continually reset
Just hit reset_into_safe_mode, will try to debug the reason
Seems like I was using a wrong timer to pwmout the green led, I will send a PR because I think I need a little help from now on
working with the new adafruit_featherwing and it seems odd to me that when I set the minitft.backlight property, the value I get back is 1-value_set
This example display a CircuitPython console and
print which button that is being pressed if any
"""
import time
import board
import math
from adafruit_featherwing import minitft_featherwing
minitft = minitft_featherwing.MiniTFTFeatherWing(cs=board.D11, dc=board.D12)
old = minitft.buttons
while True:
buttons = minitft.buttons
if buttons.right and not old.right:
print("Button RIGHT! %s" % minitft.backlight)
minitft.backlight = 0.125
print('backlight %s' % minitft.backlight)
if buttons.down and not old.down:
print("Button DOWN! %s" % minitft.backlight)
minitft.backlight = 1.0
print('backlight %s' % minitft.backlight)
if buttons.left and not old.left:
print("Button LEFT!%s" % minitft.backlight)
minitft.backlight = 0.875
print('backlight %s' % minitft.backlight)
if buttons.up and not old.up:
print("Button UP! %s" % minitft.backlight)
minitft.backlight = 0.0
print('backlight %s' % minitft.backlight)
if buttons.select and not old.select:
print("Button SELECT!")
if buttons.a and not old.a:
print("Button A!")
if buttons.b and not old.b:
print("Button B!")
old = buttons```
OK, my bad. nevermind.
the weird is due to float/integer roundoff and not reading my own code.
OK, I am not crazy. The value returned is 1-set_value ```"""
This example display a CircuitPython console and
print which button that is being pressed if any
"""
import time
import board
import math
from adafruit_featherwing import minitft_featherwing
minitft = minitft_featherwing.MiniTFTFeatherWing(cs=board.D11, dc=board.D12)
old = minitft.buttons
while True:
buttons = minitft.buttons
if buttons.right and not old.right:
print("Button RIGHT!")
minitft.backlight = 0.125
print('backlight %g %g' % (.125, minitft.backlight))
if buttons.left and not old.left:
print("Button LEFT!")
minitft.backlight = 0.875
print('backlight now %g %g' % (.875, minitft.backlight))``` produces ```Button RIGHT!
backlight 0.125 0.87451
Button LEFT!
backlight now 0.875 0.121569```
submitted bug report #43 on github repo Adafruit_CircuitPython_FeatherWing
not crazy. There is a (1-brightness) in the setter function, but not in the getter. lines 98 & 105: https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/blob/master/adafruit_featherwing/minitft_featherwing.py
you could download that .py and change line 98 to return 1-(self._backlight.duty_cycle / 255) and that should do it until it gets fixed and rereleased upstream
Hi, is the documentation of the C backend of circuitpython available somewhere online or only on the source code?
@granite crow do you mean native (C) modules like digitalio? The doc is available in readthedocs.
@danh Hi, not really, I was looking for the documentation of common_hal_pulseio_pwmout_construct and such
@granite crow no, there is no internal documentation except for some general discussion of the code structure: https://circuitpython.readthedocs.io/en/latest/docs/common_hal.html
Thanks for the info :)
Hi, I try to play (from my MAC and with an android phone) with my FeathernRF52840 Express but I have a few problem...
First when copying the library package, there is not enough space (despite being an "Express") for all the file. My trick was to delete unecessary file during the copy... with "rm lib/._*"
If I do that, I don't need to choose what library to keep or not (I know most of those are not needed for my usecase, but it is sill an issue).
Hi yall,
I have been working on this and feel like i'm almost there, i got a green blink when i plug in the test board but after that the LED stays off, i would love to get this working before sending a PR, mind taking a look at it when you got some time?
First i defined a new board, a copy of the Bast pro mini m0, and edited the mpconfigboard.h by adding the following symbols.
#define CP_RGB_STATUS_R (&pin_PA15)
#define CP_RGB_STATUS_G (&pin_PA23)
#define CP_RGB_STATUS_B (&pin_...
I believe the "block" size might be too big for those little *.mpy files. It could help to reduce that (if possible)... most of the problem is 0SX fault, but still, a popular OS.
Second: I am trying the color picker program from https://learn.adafruit.com/circuitpython-nrf52840/neopixel-color
But the color always come back to green (after having displayed my color of choice). I don't see the line that turn it back to green, but it is not the line 23 "pixel.fill(packet.color)" as I added a print("Change Requested") line, and this only print when I pick, not when returning to green within the second.
@indigo yokelaude Here's some more information about avoiding creating useless files on Mac OS: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#running-out-of-file-space-on-non-express-boards-20-39. The block size is 512 bytes on this filesystem. Will look at the color picker code and get back to you
Thanks @tulip sleet I knew about those trick because I have GemaM0 and TrinkedM0 board too... but your library size has exploded, and I did not expect that kind of problem with "Express" board.
Maybe it is time to split your library bundle in different parts.
We have stopped recommending that you copy the whole bundle any more. The guides have been revised to recommend that you copy only the libraries you need.
Like you could have all the graphic board related piece put together.
The bundle is now just a convenient download mechanism
Ok, well, I don't re-read the guide... I did what I used to do. π
One thing about the board right now, is that the "CHG" LED is blinking very quickly. This is unexpected and might be a hint that something wrong is going on.
The CHG light blinking is just the battery charge detection circuit turn on and off rapidly. It's distracting but it's innocuous.
I agree it's confusing.
To summarize what I did today: (1) Update the Bootloader (2) Put the latest Circuit Python (3) Put the lattest bundled (4) Copy an past Colorpick in code.py (5) Install Adafruit Android BT LE app (6) Try to change color.
I just tried the color picker and it's working for me.
Do not worry, I will try to troubleshoot that by putting more printf in the code. π
There is a bug in the BLE code that causes the program to throw an exception with the latest CPy. I only discovered this a day or two ago, and am planning on fixing.
if you want to try my current code, get the library from https://github.com/dhalbert/Adafruit_CircuitPython_BLE, branch python-advertisement-data, and I can give you a test .uf2 for CPy also
Yeah maybe this is early to try BLE with Circuit Python... but I have that board since so long, and not being able to use it yet, so I gave it a try.
There should be a beta 4.1 with BLE improvements and fixed libraries in relatively short order.
Thanks, I'll stop for today, my timezone is in the middle of the night now.
^for feather '840. but yes, feel free to wait if you don't want to be bleeding edge right now
Hi, thank you for your perfect analysis, I have the same problem in a different context, and I spent days to find a solution. I'm not sure to find one now, but I know what to try.
If my case can help to motivate MS to fix this trouble: we use a custom ioT, which has 1MB of flash with USB port. It is used to configurate it, and to copy some data. People tend to forget to eject properly USB mass storage (because it is synced now), and it is difficult to explain that the filesystem will be corr...
@oldav There is some news about this: we are now in contact with MS about this, and some people there interested in CircuitPython are trying to pursue it.
One more manual update, as adabot is still buggy.
Does CP for the Particle Argon support WiFi?
I saw thread on the Particle forums that seemed to indicate that it doesn't.
@old smelt I think @solar whale got it working over the uart iirc
Ok. Thanks.
@old smelt There is support for the Argon vie the ESP_ATcontol library https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32
Thanks @solar whale
@old smelt you have to replace the ESP32 firmware and it is not as reliable as the ESP32SPI library. It works, but it is no longer supported
Ok. As it turns out, when Amazon delivered what I expected to be my Argon a few minutes ago, this was inside the envelope instead.
It's eye-catching and everything. But I don't see a port for it on GitHub. So, I'll need to wait a while longer. π
Hmm-- interesting substition π
Unless you really have to use the Argon, I would recommend using an ESP32-Airlift with an M4 or nrf52840 board and the ESP32SPI library.
Ok - I'll check it out. Thanks! I want the Argon for other purposes, as well, but maybe I'll try the other boards for CP.
One thing on my todo list is verifying that I can restore an Argon to its Particle firmware successfully. It "should" be possible, but I have not does it myself.
π
<@&356864093652516868> Here is the notes doc for today's CircuitPython Weekly meeting. Everyone is welcome! Please add your hug reports and status updates, even if you'll be in the meeting. It's super helpful! If you're going to miss the meeting, you can add notes and we'll read them off during the meeting. Thanks! https://docs.google.com/document/d/1xLEidiYfibYYL06EkBm_KXCGcEtFPjUCRFp3XlnYeHs/edit#
@idle owl any reason why this download couldn't just point to the website now?
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/circuitpython-code#install-cpx-special-build-24-2
@tidal kiln If it's built on circuitpython.org, then it should be pointed there.
Then yeah for sure, it should link there.
@tidal kiln I'm testing the I2C character LCD shield on a Metro M4 with the latest stable build of CircuitPython, and the simpletest examples work. Limor said that people are complaining about it not working. Do you have any specifics on what isn't working?
hmmm. only issue i know of is with M0. that's what motivated the refactor.
but hopefully should work now
with the refactor'd CMP230xx lib and the CharLCD library updated to use it
Ok, I downloaded the most recent just now and loaded them. But on an M4.
could be worth testing on M4 also just to make sure I didn't break anything
brent did some testing also:
https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/pull/39
M4 works.
Thanks for the invitation in the circuitpythonistas family, but apologies for not being able to join the meeting but unfortunately this is (my-other) family diner time here.
@lofty nova No worries! We can always read your notes off during the meeting. π
is meeting back to normal this week?
yup! 5 minutes until it @inland tusk
@inland tusk Yes - very good thanks -- and you?
@solar whale Well.
<@&356864093652516868> Two minutes or so until the meeting
check for leaks in the helium lines
@inland tusk Please mute. Thanks!
Thanks
π @gilded cradle !!
YAY
π
i'll update my notes... π€£
CircuitPython Organization
π³
CircuitPython Weekly: Treefall Edition.
lol
timecode for timber?
well done Seattle Lumberjacks Troupe!! π
@neat folio π―!!!!
π€ for a quiet season... (selfish request, as i'm on the Gulf Coast)
also have an "in /after the weeds question"
@neat folio go ahead and put the subject up in here, and we'll add it to the notes
What would be involved in getting a circuitpython editor up and running on an iPad pro?
added to the notes.
@idle owl what board are you testing MCP9600 i2C on?
@solar whale Metro M0. With the shield and the I2C simple test for RGB display (it's the one I had)
OK - just curious.. I thought clock-stretching was working OK in CP
I read that wrong.
Feather M4.
Thought you were asking about CharLCD π
@solar whale I thought it was working as well.
@solar whale The clock-stretching is a guess. It may not be the issue.
a good thing to suspect! Good luck!
Thanks, I'm going to need it.
Today: In the trees?
the tree is now in the weeds
in the branches
Renamed.
"yet".
I have to go -- work calls π¦ have a great week!
that sounds right, the answer is more user education (omo)
"If you make it easy enough for a monkey to do it, they will hire monkeys to do it." π¦
@tidal kiln As I said in the meeting, M0 fails with MemoryError.
Nothing else on the board. Running I2C RGB char lcd shield, and the applicable simpletest. Metro M0.
File "code.py", line 15, in <module>
File "adafruit_character_lcd/character_lcd_rgb_i2c.py", line 86, in __init__
File "adafruit_mcp230xx/mcp23017.py", line 34, in <module>
MemoryError: memory allocation failed, allocating 64 bytes```
@idle owl that's with one of these?
https://www.adafruit.com/product/714
@tidal kiln Yes
ok. guess more refinement needs to be done. i'm somewhat limited with current HW for testing. i'll order one of those and see what i can do.
want to add your commentary here?
https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/issues/36
will just keep that open and keep trying...
@tidal kiln Will do
cool. thanks for testing with m0.
You're welcome.
found the sprite language:
>>> feather = "adafruit-circuitpython-feather_m0_rfm9x-fr-4.0.1.uf2"
>>> kicksat = "adafruit-circuitpython-kicksat-sprite-fr-4.0.1.uf2"
>>> feather.split("-")
['adafruit', 'circuitpython', 'feather_m0_rfm9x', 'fr', '4.0.1.uf2']
>>> kicksat.split("-")
['adafruit', 'circuitpython', 'kicksat', 'sprite', 'fr', '4.0.1.uf2']
>>> feather.split("-")[3]
'fr'
>>> kicksat.split("-")[3]
'sprite'
>>>
due to the kicksat-sprite naming convention. π
oh, oops!
all good. it needs a tweak anyway. stable auto-assumes English, and only checks for other languages based on the additional - with RC/beta release names.
personally, its another excuse to apply my budding knowledge of regex. π
@prime flower on PWMOut exceptions, shouldn't the _sets also check? might be better to have an _is_deinited() and just call them in _write_pin_attr and _read_pin_attr?
@raven canopy Yeah, that'd be a better idea
hmm. though the other ValueError exceptions may get...mangled?
Does close/open call those methods?
Yeah just checked it does
I think returning right before it starts doing os operations is a good move @raven canopy
yeah. it'll be the first call. i am expecting the exception to get chained in the _get calls though. fairly certain it will show up as while handling the above exception, the following exception occurred, and print both ValueErrors. let me ruminate a few minutes. π
might be able to pull it off with raise ValueError("blah") from None. but that's a new trick i learned so let me check...
hmm. nope. don't think that's going to work.
really wish i could test this locally haha. @prime flower i'll push it, and we'll see how it acts? i mean, Python is all about quick iteration, right?
@raven canopy yup, I can test it from here
I'm gonna set up the coral real quick...
@prime flower pushed
@raven canopy looks good!
does it chain the exceptions? i could just be flat wrong on expecting it to...
hrmmm lemmie try
@raven canopy doesnt look like it's chaining them, here's a console log
ahh. it is..
ValueError: Object has been deinitialize and can no longer be used. Create a new object.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py", line 235, in _get_frequency
return 1.0 / self._get_period()
File "/usr/local/lib/python3.5/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py", line 159, in _get_period
raise PWMError(None, "Unknown period value: \"%s\"" % period_ns)
π€
Also period doesn't seem to catch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'PWMOut' object has no attribute 'period'```
well that's weird. i'm staring at the call... π
Very weird
It's the same calling convention as get_duty_cycle
@raven canopy period doesn't have the call to `period = property(getter, setter) like duty_cycle
huh. in fact it doesn't... that might be an issue. π
Yeah I'll open a sep. one for that
Let's fix the exception chain in this PR, though
k. i have a hack in mind...but its super ugly. give me some time to think and research some more.
np
@raven canopy opened up a sep. pr, thanks for testing this with me and finding some issues
@raven canopy checking it out rn
@raven canopy doesn't look like it's chaining them anymore, nice work!
just a matter of moving around some bits.. π
aaand released π
How does sample playing work in CircuitPython when the wav file is larger than memory?
I suppose I can try this but can I play at 100kHz like that? I'm just playing around with some non audio samples.
Perhaps I'm limited by the frequencies a wav can support too
its likely limited to 44.1khz
wikipedia suggests the sample rate in wave is simply a 32 bit unsigned. I'll give it a go tomorrow and see what it does.
our decoder logic may not permit it
A 96kHz wav loads in but show up as 30464 which happens to be 96000-65536 and it sounds like it really does playback at 30464 sample per sec
8bit 64kHz wav plays ok a CPX , it looks like the first limitation is use of a 16bit unsigned somewhere to represent sample_rate
I wanted to experiement with some non audio playback and made some 8bit wavs to check playback. 64000 is ok but this one plays slowly and inspecting sample_rate shows why:
>>> wave_file = open("Evillaugh.96000.8bit.mono.wav", "rb")
>>> wave = audioio.WaveFile(wave_file)
>>> wave.sample_rate
30464
>>> 30464+65536
96000
I'd also be interested in any bottlenecks I'll encounter as I try faster sample_rate. Will CPX be capable to playing 100000 or 350000 8bit (or 16bit?) sam...
Hey everyone, I am just starting my hunt right now but is anyone logging data into Google sheets with a #MetroAirlift? If so any direction on adding the info for circuitpython for that?
Adafruit.io -> ITTT -> Google sheets. The CP part should be pretty pretty simple
@quasi fjord Thanks!
The following code:
import time
from adafruit_featherwing import minitft_featherwing
minitft = minitft_featherwing.MiniTFTFeatherWing()
print('hello')
while True:
pass
Produces the following image with noise on the left side:

This noise persists even if the display is more substantially over-written as in:
import...
@dark silo https://learn.adafruit.com/time-tracking-cube uses Zapier, IO and Google Sheets
Hi, which version of CircuitPython are you running this with? I tried it with 4.0.1 and it didn't produce this.
I see on the forum, you grabbed an s3 build. I'm going to try compiling CP with the latest master to see if I can get this to reproduce.
Ok, I was able to reproduce this with the latest build. It appears that the initial screen draw is not completely drawing everything.
@makermelissa I can take a look at this. I changed a good amount of this code so I'm not surprised there are bugs.
WIP Yet...
Script to resize originally uploaded files to two different sizes, optimize sizes and load them properly for viewport size.
Current /downloads size: 29.23MB
New /downloads size: 1.47MB
To start, we'll either need people to upload 3 images for new boards (original, 300 px width, 700 px width), or run the script after adding a new board. Updated readme for the instructions on adding 3 images.
Is it possible to fall back to the scaled original if it is only available?
We can do it with javascript, but I haven't found a way with only html/css that works reliably. I'll add the javascript fallback before we're ready to review.
I've written about a quarter of the code to do this. I'm not sure if this has got general interest as it's a bit niche but I started to look at this to allow a MakeCode program to send data to a CircuitPython program: https://github.com/adafruit/Adafruit_CircuitPython_IRRemote/issues/26 - I'd be interested in feedback on this.
WioHoo! in stock https://www.adafruit.com/product/4264
I'm a little surprised Adafruit doesn't have order limits on popular items with <100 in stock. I ordered enough to get started, but not as many as I want. Hopefully they come back in stock soon after they sell out.
Hi folks, is there a way to list multiple SSIDs in the secrets.py file for the PyPortal and other WiFi boards?
I think secrets.py is just a convenient place to put private stuff. Could make WiFi credentials an iterable, and randomize or cycle through in your code.
The PyPortal class has code for managing the secrets file - I'm asking if that has any ability to use multiples.
@tough flax What's the use case for that? Portability between different places?
@simple pulsar yes
i think it's pretty hard wired:
https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py#L633
Ok, I'll have to work around it
Hi folks, I have a project that needs the PyPortal to download multiple .wav, .bmp, and .json files from a server. It then caches them on the SD card.
I am getting these errors when downloading multiple files:
`Fetching stream from http://api.atmakers.org/sounds/Joey/next.wav
Traceback (most recent call last):
File "code.py", line 92, in <module>
File "code.py", line 54, in loadBoard
File "code.py", line 42, in cacheFile
File "adafruit_pyportal.py", line 600, in wget
File...
@C47D Please make a PR with it and mark it as a draft. That will make it easier to comment on particular portions of the changes. Thanks!
@tough flax Not sure when/if it will get done but I noted your effective RFE in https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/issues/40
This is easily added by detecting if the SSID and password are not strings and iterating over them. ATMakersBill: Hi folks, is there a way to list multiple SSIDs in the secrets.py file for the PyPo...
Ok, thank you
I think we need to split the type out of :param: and then define it with :type: I think. Example here: http://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists
Where is the mapping between pins and timers done for each board in the CP core?
@ntavish Sorry this has taken a while. Would you mind reopening a PR on the 4.0.x branch so that it gets released with the next stable release? We'll then merge 4.0.x back into master. master will be released as unstable next.
@crimson ferry it is complicated for SAMD chips. Each pin supports zero, one or two timers, and various channels on those timers. It is not a crossbar. So using one pin may block another pin from using the same timer, if they share that timer.
also there are two kinds of timers, one basic and one more sophisticated
I'm going to need to read the SAMD datasheets π Ah, that's the code I was looking for in the other channel. Thanks, @tulip sleet !
Thanks @tulip sleet. With my PyPortal, I can setup D3 as a PWM output, but not D4.
I'll check it out, as well.
[Update]: And would you look at that!
No PWM on: D3
Thanks Dan!
Could we use Jekyll to do it?
@tannewt Hi, no problem. I modified this PR to do that. Hope that's fine also.
Great idea, will try that quick. Looks like you can test if a file exists with jekyll.
hiya bill, for issues with adafruit_esp32spi please post the issue in that library repo! :)
Did you rebase? It looks like there are a number of commits that are being brought in from master again.
Appears to me it's because sample_rate is an uint16_t in the audioio_wavefile_obj_t type.
Yes, I rebased and squashed my commits.
Could you please poke it so that the pr shows only one commit? If you don't know how, then let me know and I can help.
Should have been that way, I guess I had messed up. Now it looks ok (just 1 commit on top of 'master')
If you need some sort of demo, a video perhaps, "proving" the module works, feel free to ask.
Nah, I trust you tested it. Others will test too and we can always fix any issues that come up.
Does it take a minute to update or did I add it in the wrong place?
Never mind, it just took a minute to update.
@makermelissa yah, takes a few mins.
@slender iron there isn't a way to make a dispio compatible object without inheriting from one right?
Can someone tell me what repository contains the source for the Circuit Playground Express library? Search engines aren't finding it for me.
found it thanks to jerryn
β¦tatus.
Tested with custom board definition based on the Bast Pro Mini M0, this is the mpconfigboard.h contents:
#define MICROPY_HW_BOARD_NAME "Electronic Cats Bast Pro Mini RGB M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define CP_RGB_STATUS_R (&pin_PA15)
#define CP_RGB_STATUS_G (&pin_PA23)
#define CP_RGB_STATUS_B (&pin_PA06)
...
β¦o uint32_t so it matches the sample rate type parsed from the WAV header format, fix #1922
@marble hornet there isn't
I checked other uses of sample_rate in other audio native classes, and they are uint32. The WAV file header itself uses 4 bytes for sample rate. So this looks safe and consistent.
@slender iron FYI I'm debugging an issue @tough flax found reading touch inputs in a pyportal program. Just a heads up that if this looks fixable easily, we should include it in in the next bugfix release. NO issue yet, still characterizing it.
@dhalbert Hi, i was planning to check what is the maximum sample rate allowed for wav files. But as you say it seems its safe to merge.
For reference:
Appears to me it's because
sample_rateis anuint16_tin theaudioio_wavefile_obj_ttype.While the parsed
sample_rateof the wave header format isuint32_t:
https://github.com/adafru...
(I apologize if this is a "dumb request") is it possible to get a mpy-cross for High Sierra (for CP 4)? I could take the time to build it i guess. The challenge is that will take me more time than it should because i haven't played around with c code in awhile, etc....
I can upload a copy for you if you like.
@idle owl is there an FAQ or something else somewhere in Learn that discusses what happens for simple programs that don't end in a loop? there have been several "it works via REPL, but not code.py" things due to this
@tidal kiln Not that I'm aware of.
think it's worth adding? i was looking here
https://learn.adafruit.com/welcome-to-circuitpython/creating-and-editing-code#loop-de-loops-7-25
like maybe add an FAQ entry there?
If you're answering questions about it, then it's worth adding.
ok. i can add something. does that seem like best place?
Yeah i think it works. And it'll be easy to link to
@tidal kiln Yeah sounds good.
okie doke. can always tweak as needed. we'll see if it helps.
Thanks for adding that!
thanks for proofing!
May be not in that guide. May be in readthedocs. I'm searching ....
In https://circuitpython.readthedocs.io/en/latest/README.html, "Behavior" says:
"""code.py (or main.py) is run after every reload until it finishes or is interrupted. After it is done running, the vm and hardware is reinitialized. This means you cannot read state from code.py in the REPL anymore."""
It is in the difference-with-micropython section. So may be not obvious for beginenrs
ah. good find.
Which remind me a question I wanted to ask to the team : Does code.py inherit of anything from boot.py ?
If I am correct, in micropython, anything imported or created in boot.py is available to the code in main.py.
Is that or not the case with CircuitPython ?
not sure, so tried it...
boot.py
foo = 23
print(foo)
and...
Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit ItsyBitsy M4 Express with samd51g19
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 1, in <module>
NameError: name 'foo' is not defined
thanks @tidal kiln . I should have tried it myself :)
So definitively no inheritance.
Except for the filesystem mount as it is in boot.py that we can remount the file system in read-write.
But nothing from the VM
i could be doing it wrong though π
@bronze geyser @lofty nova the mpy-cross for CPy 3 will actually work fine for CPy 4.
We'll now fallback to the original image if the large or small sizes do not exist (using jekyll).
hi @tulip sleet, yes I keep on using the one downloaded from the v3.1.2 release
there was no change in the .mpy format between CPy 3 and 4.
the next time we merge from upstream, there will be a change and we'll need to bump those. Nevertheless, we should publish the mpy-cross's in a release somewhere or on circuitpython.org
So there are plans to merge some of micropython v1.11 ?
at some point we'll merge from upstream; it may not be that soon, and it may not be v1.11. Our last merge was at an intermediate commit that Damien recommended as containing good fixes, but it was not at a version tag
ok.
@slender iron have you got time for a video chat re bill binko's bug. seems to have to do with replacing the pyportal.splash group multiple times, and also generating lots of garbage quickly
@tulip sleet I can meet a little later. I've been deep in displayio and need lunch
@slender iron that's fine; I'm going to start cooking dinner soon
k, want to ping me after? I can chat before the internal meeting if that's ok with you
sure
@slender iron all done with dinner; I think I figured out the problem but would like to check with you on the diagnosis
kk
@tulip sleet thank you for your help earlier. using the old mpy-cross did work.
i've got a challenge. wondering if it is a bug. i am getting OverflowError: value must fit in 1 byte(s) when I do the code (which worked in CP 3?).... spi.write(bytearray([address])) spi.write(bytearray([first_byte])) spi.write(bytearray([value]))
where address = 0x70... value = 0x789a, first_byte = value >> 8
value is bigger than a byte
>>> bytearray([0x789A])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: value must fit in 1 byte(s)
>>>
congrats @gilded cradle !
cool projects on adding Blinka to new boards and being @odd flax now π
Thanks @swift arrow
now comes the fun part...running and evaling tests. π¬
https://gist.github.com/sommersoft/f975309ce1d187677f0efa36c19f91a8
oh lord...that's a large picture. π€£
as discussed before (@timber mango) I would like to do my own board (in a special form factor)
the decision is now that it will have the same "core" (MCU) than feather M4 express .
@tulip sleet mentioned that I have to use my own USB VID/PID then.
Question 1: do I have to use one set of USB VID/PID for the UF2 Bootloader and another(!) set of USB VID/PID for the Serial (CDC) of the running firmware ?
Question 2: if I do that, does the Win7 drivers* from adafruit stop to work then (cause of the different USB VID/PID) ?
*(https://github.com/adafruit/Adafruit_Windows_Drivers/releases/latest)
q1) I suspect it would confuse the hell out of Windows to have the same ID report different descriptors at "random". q2) Yup. If it's just for your use you can force the Win7 drivers on your VID/PID. Or you could just forget about Windows 7
I was thinking about this a bit more. This can be picked up by the compiler but the warning isn't commonly enabled perhaps because of the traditional habits of the typical C programmer. gcc's -Wall and -Wextra do not enable this warning but -Wconversion does, an example:
$ cat -n integer-assignment-size.c | sed -n '12,15p; 21,22p'
12 unsigned int a;
13 uint32_t b;
14 unsigned short c;
15 uint16_t d;
21 c = a;
22 d = (uint16_t)b...
Never mind, I didn't realize it was included twice.
It sounds like the output is being reset even though never reset is used. I'd suggest breaking on common_hal_pulseio_pwmout_set_duty_cycle to track that the correct values make it to the pwmout class. If that's true, then I'd make sure the TC and pins aren't accidentally reset.
Hi, thanks for the reply, i will debug it later today and let yall know any information i get. I tried to upload a video to YT for you to see it but i wasn't able to do so (until now).
I am not sure if i'm missing something on the other configuration files, my mpconfigboard.mk, [board.c](https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/bast_pro_min...
@slender iron I added the displays objects to the root pointers, but discovered that since they are not on the heap, they will not be scanned as root pointers. They need to outlive the heap betweeen VM instantiations but still be on the heap from the point of view of gc. What do you think is the best way to accomplish this? Perhaps I need to copy the contents and stash them away between VMs. Or is there some storage that looks like it's part of the heap but isn't reset between VMs?
Are there other objects that outlive the heap but are still Python objects, and need to be root pointers?
@tulip sleet how about modifying the collect phase to manually mark them?
eek, well, maybe, maybe this is a new class of object
it's something the port is already responsible for
are you away from desk? we can talk further when you return?
just got back to it
maybe let's video for efficiency
kk
whenever
@tulip sleet I'm running some code, and the code appears to be running, but the status LED on my Feather is red. I'm not sure what to make of that.
I'm getting data to the serial console, is how I think it appears to be running.
@idle owl which feather? want me to try also?
@idle owl I missed the notification. Is it any code, or just that code
It's green now. Feather M4 with an unreleased library on it... I have no idea what's going on with it.
The Group object in Display was not being marked during gc. Because the display objects are not on the heap, they can't be added to the root pointer list. So gc them explicitly.
Also:
- Added a
gc_collect_ptr()routine to gc a single pointer, for convenience. - Fixed some
#ifdefs that should have been#ifs. - Added some missing
#ifs innrfport. - Removed redundant
#ifguard inreset_displays(). - Removed a
SAMD21platform setting from some doc.
In the long ru...
Why not just rename gc_mark?
I thought of calling gc_mark directly, but thought someday we might want gc_collect_ptr() to do something else before it calls gc_mark(). Having a routine called gc_mark() is really clear about what it does. It marks and only marks.
sounds fun π
@ATMakersBill did test this and he no longers sees the crashes.
@tulip sleet For the mpy change you mentioned, two questions 1) can Circuit/Micropython read both the old and new verison mpy files and 2) do the mpy files have the mpy version recorded in the them?
they do have the version number inside, to check compatibility. can't read both; there's no real reason to provide backward compatibility, cause you can just recompile
It's convenient to support a few versions but I can see with the size constraints why they this doesn't make sense here.
What will happen if you run some code with an import that picks up an old version mpy? Friendly, informatiive error?
iirc there is a specific exception thrown. don't recall its exact name/language though.
i'm looking in the code
@simple pulsar
mp_raise_MpyError(translate("Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info."));
@tidal kiln For users getting confused/surprised by exit behaviour in CircuitPython, are they inexperienced users or are they Arduino programmers who are used to placing code in loop() ?
could be all of the above
beginners for sure, but maybe also arduino people since CP doesn't require a loop()
It's an interesting difference from Arduino land and from traditional C's main
i think the other confusing point is REPL vs. some_file.py