#circuitpython-dev

1 messages Β· Page 249 of 1

meager fog
#

or we can find a new font

gilded cradle
#

yeah

meager fog
#

there will be plenty iwth english+hebrew

#

most docs are written in both

gilded cradle
#

That sounds like a better idea

#

Finding a new font with both, that is

meager fog
#

only 44kb and OFL

#

also doesnt look too bad

gilded cradle
#

Yeah, Hebrew font sizes weren't an issue at least πŸ˜ƒ

meager fog
#

you may have to enter in the text backwards to make it display

#

but thats not too terrible

#

and worth showing

gilded cradle
#

Yeah, like reverse the string, which should work fine.

idle spindle
#

Always interesting watching how you guys work @meager fog and @gilded cradle : )

gilded cradle
#

πŸ˜ƒ

idle spindle
#

πŸ˜ƒ

meager fog
#

@gilded cradle can you actually call reverse()? in theory it should do the right thing

#

but unicode is Weird

gilded cradle
#

Yeah, I was just looking up some Python methods to reverse it.

meager fog
#

In [2]: reversed = line[::-1]

In [2]: print reversed
דגבא```
gilded cradle
#

I got a NotImplemented error with a slice with negative steps

#

NotImplementedError: only slices with step=1 (aka None) are supported

meager fog
#

oh right

#

may have to just DIY

#

iterating

gilded cradle
#

Yeah, if I can't get any of the shortcuts to work

#

NAME_STRING = ''.join(reversed(NAME_STRING)) worked

meager fog
#

yay do that then

tulip sleet
#

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

meager fog
#

yeah

#

we couldnt find one thats just that

#

would be a useful font, all the simplest characters only

tulip sleet
#

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

meager fog
#

yeah wefound taht but was like "omg i do not have time for this" and just found a kana only font

tulip sleet
#

well, maybe I'll take a look later, and make up a list of codes that we need

#

too tired now

meager fog
#

thast what i said!!! πŸ’€

#

lol

gilded cradle
#

πŸ˜ƒ

tulip sleet
#

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

meager fog
#

@gilded cradle ill take a look at a screenshot if/when you have one

#

just to verify the text is showing right

gilded cradle
#

Ok...

meager fog
#

looks good! wanna make font bigger?

#

or we could stick with this

#

i guess its a one-word name, which isnt common

gilded cradle
#

I just went with 18pt all around.

meager fog
#

np

#

looks good - ship it!

#

or at least, add to guide, mike'll review tomorrow

gilded cradle
#

Ok, I'm just adding the section to the guide real quick

#

Ok, that'll work

meager fog
#

@gilded cradle ok u can merge once travis reruns

gilded cradle
#

Thanks πŸ˜ƒ

errant grail
#

@gilded cradle ^^ is reversed() available for non-express boards now?

gilded cradle
#

I’m not sure. This was for the PyBadge specifically.

errant grail
#

Ah. Not an issue, then.

gilded cradle
#

Yeah

errant grail
#

okay, I can go back to lurking now. πŸ˜‰

manic glacierBOT
manic glacierBOT
tulip sleet
#

@errant grail it's now turned on for all boards

#

we need to fix the doc

rare geode
#

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.

tulip sleet
#

no, it's a library written in Python that's in the bundle

rare geode
#

I resorted to doing peak = int((cpx.light / 320) * 10) which worked

tulip sleet
#

we didn't have room to freeze it in the CPX

rare geode
#

ah okay

tulip sleet
#

we should probably move map_range elsewhere, because it's generally useful

#

and doesn't need to be part of simpleio

rare geode
#

right

#

I might try see if I can get plotting into the atom plugin today

tulip sleet
#

sounds good!

rare geode
#

Need to tidy it up a little, but live plotting works

idle owl
#

<@&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

rare geode
#

ok graph in atom now limited to 20 points, might push this as it works pretty well for me

tulip sleet
#

@rare geode speaking as a person with colorblindness, I cannot see any plot on the graph at all: is it in red?

rare geode
#

It is all dark grey, but I was just looking at how I can change this

stuck elbow
#

it's in black on black

rare geode
#

Yeah

#

I'm going to assign brighter random colours to the lines now

tulip sleet
#

ok, tnx!

rare geode
#

I've never worked with this graphing library before so I'm just trying to find my way around the configuration options

rare geode
manic glacierBOT
rare geode
#

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

prime flower
#

Nice plotter!

#

also have somewhat of a colorblindness and i can see it well.

scarlet maple
tulip sleet
#

I would use it in light mode anyway.

rare geode
#

Right now colors are randomly generated with rgb values of between 100 and 255

tulip sleet
#

can you tell whether you're in light or dark mode?

rare geode
#

I'll send screenshots of the plotter in both light and dark now

tulip sleet
#

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

rare geode
#

Right, maybe I'll aim for between 100 and 200 .

#

few of the randomly generated colours there

scarlet maple
#

How many potential lines on a graph?

rare geode
#

and should one be invisible to someone, it's just a matter of closing the plotter and reopening to get new ones

#

Unlimited theoretically

tulip sleet
#

can you fetch the background color value and choose values to contrast with that?

scarlet maple
#

How many potential lines realistically?

rare geode
#

I'll have a look in atom docs to see what's possible πŸ‘

#

Depends entirely on your system

#

this did make my laptop fans start to whir though

scarlet maple
#

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.

rare geode
#

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

errant grail
#

@tulip sleet Good to know that reversed is back in the core for non-express boards. Thanks!

rare geode
#

will tie it all together after I've had tea

rare geode
#

done, settings now have light and dark theme to make it as accessible as possible

idle owl
#

@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.

rare geode
#

Sure! That'd be awesome

idle owl
#

@rare geode Welcome to circuitpythonistas!

rare geode
#

Thank you!

solar whale
#

@idle owl I'll just be lurking this week -- at work

idle owl
#

@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?

pastel panther
#

sure

tidal kiln
#

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!
prime flower
sterile bronze
#

Lurking

turbid radish
#

I'm lurking today also

ruby atlas
#

Lurking too today.

idle owl
#

@rare geode Are you lurking today as well?

rare geode
#

I don't have much to comment on, so I can comment on the atom thing but not much else

#

for now anyway πŸ˜„

idle owl
#

That'll be great! You'll get a feel for the meeting as we go πŸ˜ƒ

errant grail
#

Lurking from the studio again today.

marble hornet
#

Lurking for now

sly falcon
#

is lurking

idle owl
raven canopy
#

@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.

idle owl
inland tusk
#

i am lurking

pastel panther
#

thanks for the work on the Atom plugin @rare geode πŸ˜ƒ

marble hornet
#

Now Unlurking

inland tusk
#

@rare geode just wondering what is your package for atom going to do?

tulip sleet
raven canopy
#

@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.

turbid radish
#

πŸ˜ƒ

tulip sleet
#

the code is really small - you could just duplicate it

rare geode
#

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

raven canopy
#

hehe. well, yeah, there's that approach. πŸ˜„

rare geode
#

Ah yeah, that would also be a solution, I'll give that a shot if there is no other way.

pastel panther
#

@soft moat are you going to participate with Hug Reports and Status Updates, or are you just listening in?

rare geode
#

@inland tusk basically what the Mu integration does, serial and graphs

tulip sleet
turbid radish
#

New fonts! Great work @gilded cradle

rare geode
#

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 πŸ‘

soft moat
#

@pastel panther sorry about that, just lurking!

gilded cradle
#

Thanks @turbid radish

raven canopy
#

@soft moat no worries! we just wanted to make sure that if you wanted to participate, that you had the chance.

soft moat
#

yep, just listening in since it was around 4.0 release.

prime flower
#

Cya there @pastel panther πŸ˜„

pastel panther
#

sha-weet @prime flower

prime flower
#

Not normally in on thurs but I'll make an exception for ya πŸ˜ƒ

pastel panther
#

I'm not coming in until Friday, so you're all good

manic glacierBOT
raven canopy
#

πŸ‘‹ @ruby tiger. you just lurking, or do you have anything you want to say/type?

orchid basinBOT
ruby tiger
#

@raven canopy just lurking!

#

they're just lurking too

#

:)

#

pydis invasion!

raven canopy
#

@tulip sleet i'm more than willing to do some of the more "maintenance" stuff like build-triage.

tulip sleet
#

@raven canopy Thanks! will see what I can pass to you

turbid radish
#

Thanks everyone!

tidal kiln
#

l8r all!

rare geode
#

Thanks all!

errant grail
#

Thanks!

prime flower
#

later!

gilded cradle
#

Thanks everyone

fierce lion
#

thanks everyone

ruby tiger
#

thanks!

turbid radish
fierce lion
#

πŸ‘‹

lone sandalBOT
orchid basinBOT
ruby atlas
idle owl
#

@ruby atlas That will be me. That will help you with that. That's my domain. πŸ˜ƒ

ruby atlas
#

OK we'll sort that out together later.

errant jetty
#

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?

scarlet maple
#

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?

rare geode
#

5 Hz sounds reasonable yeah

errant jetty
#

Cheers πŸ˜€

rare geode
#

It really depends on how complex the maths is

#

I think that for testing for intersection you should be alright

scarlet maple
rare geode
#

Yeah thought it would be line-line intersection

#

I worked with this equation when doing raycasting in python

#

It's not particularly intensive math

scarlet maple
#

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.

rare geode
#

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 πŸ‘

meager fog
#

@gilded cradle im around when u r

rare geode
#

also, light & dark lines have been added to the settings panel now so that can be changed by theme

meager fog
#

very vaporwvae

rare geode
spice tendon
#

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.

trim elm
#

@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.

scarlet maple
gilded cradle
#

Hi @meager fog, I'm here

meager fog
#

hiiii welcome back

gilded cradle
#

Thanks

meager fog
#

i was gonna go thru your guide now

#

i have a QUEST

gilded cradle
#

Ok

#

What is the quest?

meager fog
#

quest is - try to make a 'gif' that flips thru the different languages

#

and thats the thumbnail gif

#

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

#

🎊

gilded cradle
#

Ok, Quest accepted. πŸ˜ƒ

meager fog
#

i am now a sidequest cat

#

ok try it out!

#

ill review the rest

gilded cradle
#

Thanks πŸ˜ƒ

meager fog
#

@tidal kiln wanna release CP lib 1.8.4? i just mergeded

tidal kiln
#

sure. np. on it.

gilded cradle
#

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

meager fog
#

as long as it doesnt watermark

#

what happens when u try?

gilded cradle
#

Ok, I'll test real quick

#

I get 502 Bad Gateway for that URL

tidal kiln
#

@meager fog done. thanks for the discussion and merge. will close issue when forum poster reports success.

meager fog
#

thank u πŸ˜ƒ

#

@gilded cradle huh are you on a vpn or somethin?

gilded cradle
#

Nope

meager fog
#

hmm can you get to ezgif at all

gilded cradle
#

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

meager fog
#

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

gilded cradle
#

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

meager fog
#

ok

#

tag me - ill do other stuff meanwhile πŸ˜ƒ

#

plenty to do πŸ˜„

gilded cradle
#

Sounds good

scarlet maple
meager fog
#

imagemagick is fine by me, but ezgif doesnt require reading a man page πŸ˜„

#

@gilded cradle afterwards, we'll need some text here

#

dunno if mike gave you some pointers on how we make up those pages

gilded cradle
#

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.

meager fog
#

rad ill be in another window, just tag me or email me when its ready 4 me to look at again πŸ‘€

gilded cradle
#

Ok, getting close

#

Ok @meager fog, done

#

I mean I got the images prepped

meager fog
#

@gilded cradle will get to it soon, on a vidcall

gilded cradle
#

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.

gilded cradle
#

@meager fog, it's ready whenever you are.

meager fog
#

still videzing πŸ˜ƒ

#

almost done

gilded cradle
#

Sounds good. I'll go onto something else then.

meager fog
#

np

#

@gilded cradle ok whew back

gilded cradle
#

Cool

meager fog
#

gif is good!

gilded cradle
#

Thanks

meager fog
#

i think its super powerful to show the langs

gilded cradle
#

Yeah, definitely.

#

I moved the stuff from the last page to the setup page and fleshed it out more.

meager fog
#

perfect

#

its live now πŸ˜ƒ

gilded cradle
#

Yay!

meager fog
#

oh sorry one more favor can you add the hebrew to the gif

gilded cradle
#

It should be in the gif

meager fog
#

hmm

#

one moment maybe gif didnt loop

gilded cradle
#

ok

meager fog
#

thats odd i dont see it

gilded cradle
#

Like bewtween the japanese and english

meager fog
#

hmm nope it skips

#

it flickers for a millisecond maybe?

#

want me to edit the gif?

gilded cradle
#

You can, I just used photoshop to create. I had to resize the pics to 640x480 or it wasn't centered

meager fog
#

np

#

one moment

#

thats so odd

#

ok well

#

its fine for now

#

🀷

gilded cradle
#

Is it showing up now?

meager fog
#

no but its probably me

#

hav eyou blogged before?

gilded cradle
#

Yes

meager fog
#

gr8 u wil blog this too πŸ˜„

gilded cradle
#

I figured that's why you were asking πŸ˜„

meager fog
#

i am not subtle

gilded cradle
#

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.

meager fog
#

oh ask mike to show you how then

gilded cradle
#

Ok, cool

meager fog
#

πŸ‘

river quest
gilded cradle
#

Thanks πŸ˜ƒ

fathom basalt
#

Congrats, Melissa!

gilded cradle
#

Thanks @fathom basalt

fathom basalt
#

Love the Japanese ”burinkΔβ€œ!

idle spindle
#

Awesome!

#

Wait... I never did finish that case did I? Aw crap.

fathom basalt
idle spindle
#

Nice...

manic glacierBOT
manic glacierBOT
errant jetty
#

@rare geode @scarlet maple @trim elm thanks all for help in my first foray into Circuitpython!

rare geode
#

No problem!

manic glacierBOT
lone sandalBOT
manic glacierBOT
marble hornet
#

@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.

simple pulsar
#

@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

split ocean
#

Very nice, @simple pulsar thanks for that!

pastel panther
tulip sleet
lone sandalBOT
pastel panther
#

@tulip sleet Those uf2s were generated by that script?

tulip sleet
#

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

pastel panther
#

awesome

tulip sleet
#

@pastel panther ok added to guide

pastel panther
#

@tulip sleet awesome! Thanks

tulip sleet
#

typing in wrong channel

marble hornet
slim stratus
#

Hi, is there a chance to get the adafruits boards (only, not circuitpython specific modules) backported to micropython ?

tulip sleet
slim stratus
#

Thanks πŸ˜ƒ

lone sandalBOT
manic glacierBOT
wild garnet
#

hello

#

Good evening

#

i have a issue with adafruit circuit python

solar whale
#

@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.

wild garnet
#

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

marble hornet
#

@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
main meteor
#

Looks like an argument has changed type.

tidal kiln
#

@wild garnet what filename did you save the program as?

tidal kiln
#

@wild garnet what filename did you save the program as?

lofty nova
#

@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

spice tendon
#

@scarlet maple Thank you for the info. I'll try there.

marble hornet
#

@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. ```

slender iron
#

how does it not work?

marble hornet
#

there is no EXTRA_BUILTIN_MODULESmacro in /ports/atmel-samd/mpconfigport.h

slender iron
#

I think most of it's been moved to py/circuitpy_* files

marble hornet
#

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']

slender iron
marble hornet
#

thank you @slender iron ! ```>>> import mymodule

dir()
['name', 'mymodule']

marble hornet
#

@slender iron if i wanna subclass group in the cp source code should i just copy paste a version?

slender iron
#

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

marble hornet
#

yes it is, my though to doing it in c is that the events will be looked at every-time the display is refreshed

slender iron
#

what do you mean by "looked at"?

marble hornet
#

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.

slender iron
#

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

marble hornet
#

okay, i'll work on it script side for now πŸ˜ƒ

slender iron
#

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

manic glacierBOT
marble hornet
#

agreed, the Group type seems close enough to dom tree. (I've been revisiting displayio and i like the changes )

slender iron
#

great!

umbral dagger
#

@marble hornet It likely needs some updating.

marble hornet
#

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

slender iron
#

@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

manic glacierBOT
slender iron
#

do we want new boards added to master or to 4.0.x?

idle owl
#

@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.

slender iron
#

so 4.0.x then

idle owl
#

πŸ‘

manic glacierBOT
prime flower
#
lofty nova
#

Isn't Travis using blinka ? Does PulseIO.PWMOut in blinka have a deinit member?

prime flower
#

hmmmm, i remember it was a software-based pwm in blinka

lofty nova
#

Yes, but the blinka version has its own code and is missing deinit

prime flower
#

Yeah, I just looked at that file. I'll file an issue. Thanks @lofty nova

lofty nova
#

yw

#

little things that make me look into the dark corner of CircuitPython. make me learn a lot πŸ˜‰

raven canopy
#

i'm sure this will be a larger part of the discussion when pylint version is bumped to current....

idle owl
#

@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

slender iron
#

CircuitPython is first on the list!

slender iron
#

@somber coral you around?

manic glacierBOT
wild garnet
#

@tidal kiln save to program as "main.py"

tidal kiln
#

do you have a file named code.py or code.txt already in your CIRCUITPY folder?

prime flower
#

@gilded cradle do you have a Google Coral board set-up rn?

gilded cradle
#

No, I don’t have one at all.

prime flower
#

Oh, thought you did. Np!

gilded cradle
#

It’s ok. πŸ™‚

#

I have some odroid boards and an Orange Pi R1. Maybe that’s what you were thinking of.

slender iron
old smelt
#

@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

slender iron
#

@old smelt I didn't unfortunately. I did chat with brian okken

old smelt
#

He has a CPX

slender iron
#

just got an email from mkennedy because I emailed about circuitpython 4.0 and it was mentioned on python bytes

old smelt
#

It was still in the bag last time he showed it to me, though. That was a while ago.

slender iron
#

ah, I offered to answer any questions about circuitpython to him

old smelt
#

That's cool.

lofty nova
#

@slender iron , Just got my hand on a BME280, so I can have a look. A quick word about what I should look at ?

manic glacierBOT
lofty nova
#

Is this just about removing frozenset( ) ?

#

I can have a look to the 3 others issues too

slender iron
#

@lofty nova yup, I think frozenset can just be replaced with a tuple

lofty nova
#

ok. If I look into the other issues, should I submit 1 PR per issue or all-in-one ?

slender iron
#

1 per ideally

prime flower
#

@tidal kiln heyhey

#

which example did you use to test that PR?

tidal kiln
#

hmm. not sure. been a while.

#

let me just try and repeat it

prime flower
#

Just tried it on another board, def not a caching thing...

tidal kiln
#

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
#

@tidal kiln still get the from adafruit_mcp230xx.mcp23017 import MCP23017

#

er

#

ImportError: no module named 'adafruit_mcp230xx'

tidal kiln
#

you're using a metro?

prime flower
#

yup, a m4

tidal kiln
#

how'd you copy PR version of library to the metro?

prime flower
#

I'm sitting at dcf1613db5cee295f040c1a950eaf7aecc7a98e7 on the iss36 branch

tidal kiln
#

but how'd the files get on to the metro?

prime flower
#

I just did a `mv adafruit_character_lcd/ /Volumes/CIRCUITPY/lib

tidal kiln
#

do an ls /Volumes/CIRCUITPY/lib/adafruit_character_lcd/*mpy

#

see anything?

prime flower
#

nope

#

This is the latest from the PR though, looking at the files

orchid basinBOT
lofty nova
#

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)

tulip sleet
#

@lofty nova Could you put all that in an issue for the library?

lofty nova
#

I'm already working on an PR for that library

#

It's the pylint before submitting

#

πŸ˜ƒ

tulip sleet
#

πŸ˜ƒ OK, then I would say go ahead and fix it and note it in your PR.

lofty nova
#

Thanks

#

Can you confirm my reading that if var1:is useless as it follows if var1 == 0:

simple pulsar
#

You will get a change in behaviour

tulip sleet
lofty nova
#

ok. I'll do

#

@simple pulsar, can you please leaborate ?

simple pulsar
#

If _BME280_PRESSURE_MIN_HPA is not 0

#

Depending on how you fix it

tulip sleet
#

which is deprecated

lofty nova
#

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

tulip sleet
#

yes, can remove the if var1:

lofty nova
#

πŸ‘

tulip sleet
#

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

simple pulsar
#

One test is needed to avoid div by zero

lofty nova
#

I'll check the history. The Arduino lib also has the test agaisnt 0 but not the other tests.

raven canopy
#

@slender iron i'm digging into the build-tools failure on ImageLoad. appears my path walking doesn't like double nested folders.

slender iron
#

@lofty nova what is your github username? gonna add you as a librarian so I can assign issues to you πŸ˜ƒ

lofty nova
#

barbudor is the name πŸ˜‰

slender iron
#

@raven canopy perfect! I was just about to pull up travis

#

kk, not always the same πŸ˜ƒ

#

@lofty nova invited!

lofty nova
#

Thanks

slender iron
#

no problem!

raven canopy
#
- 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.

slender iron
#

@raven canopy want me to fix it or review?

raven canopy
#

well, you'll probably have a quicker fix, if i'm being honest. πŸ˜‰

slender iron
#

do you have time to look now? I'm in the middle of stuff

#

actually it's probably not super urgent either

raven canopy
#

i can work it. nothing pressing on my end...

slender iron
#

ok, thanks. I'm gonna bughunt my displayio pr

raven canopy
#

hah. i'd say that def takes precedence.

tulip sleet
#

@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.

lofty nova
#

Ok. I'll do that tomorrow. πŸ› time now. Thanks

raven canopy
#

@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.

slender iron
#

ah, ya

#

I feel like I just saw that somewhere else too. lemme look

manic glacierBOT
slender iron
#

I can switch it over

raven canopy
#

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.

slender iron
#

I'll just move it, it's the second option listed πŸ˜ƒ

raven canopy
#

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.

slender iron
#

ya, I sent the link to the second

#

πŸ˜ƒ

slender iron
#

@raven canopy is there a pr to review for build bundles?

raven canopy
#

just put it in! had to start dinner 🍽

slender iron
#

kk, cool!

#

@raven canopy merged

raven canopy
#

k. about to eat. i can release after that...

slender iron
#

I can if it's nothing more than tagging it

raven canopy
#

yep. just tagging for the pypi deployment.

slender iron
#

kk, will do

manic glacierBOT
manic glacierBOT
lofty nova
#

Hello, kindly request review of the PR for BME280 driver.

manic glacierBOT
lone sandalBOT
raven canopy
#

@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.

lofty nova
#

Thanks @raven canopy , I'll do

#

It's already done. Have you done it ?

raven canopy
#

sorry, yeah i did it.

#

question: have you experienced any occurrences of the calibration data resulting in var1 == 0?

lofty nova
#

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

raven canopy
#

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.

lofty nova
#

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

raven canopy
#

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.

raven canopy
#

@lofty nova i approved, but didn't merge it yet. called in a second opinion... πŸ˜„

lofty nova
#

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 ..

raven canopy
#

sounds good. i never really found my thermodynamics, so i can kind of empathize. hehe

manic glacierBOT
granite crow
#

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?

raven canopy
#

@granite crow have you read through this guide?

granite crow
#

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

raven canopy
#

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.

granite crow
#

Yes, I'm already using it

#

Excuse my English, it isn't my first language 😬

raven canopy
#

no worries!

granite crow
#

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

slender iron
#

@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

granite crow
#

I will @slender iron

granite crow
#

It doesn't fit the Flash without lto, target is samd21e18

tulip sleet
#

@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

granite crow
#

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

tulip sleet
#

if no status color, yeah, it would not be compiled in

granite crow
#

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

granite crow
#

Just hit reset_into_safe_mode, will try to debug the reason

granite crow
#

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

obsidian dome
#

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

quasi fjord
#

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

granite crow
#

Hi, is the documentation of the C backend of circuitpython available somewhere online or only on the source code?

tulip sleet
#

@granite crow do you mean native (C) modules like digitalio? The doc is available in readthedocs.

manic glacierBOT
granite crow
#

@danh Hi, not really, I was looking for the documentation of common_hal_pulseio_pwmout_construct and such

manic glacierBOT
tulip sleet
granite crow
#

Thanks for the info :)

half sedge
#

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).

manic glacierBOT
#

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_...
half sedge
#

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.

#

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.

tulip sleet
half sedge
#

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.

tulip sleet
#

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.

half sedge
#

Like you could have all the graphic board related piece put together.

tulip sleet
#

The bundle is now just a convenient download mechanism

half sedge
#

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.

tulip sleet
#

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.

half sedge
#

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.

tulip sleet
#

I just tried the color picker and it's working for me.

half sedge
#

Do not worry, I will try to troubleshoot that by putting more printf in the code. πŸ˜‰

tulip sleet
#

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.

half sedge
#

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.

tulip sleet
#

There should be a beta 4.1 with BLE improvements and fixed libraries in relatively short order.

half sedge
#

Thanks, I'll stop for today, my timezone is in the middle of the night now.

tulip sleet
#

^for feather '840. but yes, feel free to wait if you don't want to be bleeding edge right now

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
orchid basinBOT
old smelt
#

Does CP for the Particle Argon support WiFi?

#

I saw thread on the Particle forums that seemed to indicate that it doesn't.

slender iron
#

@old smelt I think @solar whale got it working over the uart iirc

old smelt
#

Ok. Thanks.

meager fog
#

@gilded cradle heya melissa

#

are you hackin' with us now πŸ˜ƒ

gilded cradle
#

Hi

#

Yes

#

I'm working on the Orange Pi guide at the moment. πŸ˜ƒ

solar whale
old smelt
#

Thanks @solar whale

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

old smelt
#

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. πŸ˜‰

solar whale
#

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.

old smelt
#

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.

solar whale
#

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.

old smelt
#

πŸ‘

idle owl
#

<@&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#

tidal kiln
idle owl
idle owl
#

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?

tidal kiln
#

hmmm. only issue i know of is with M0. that's what motivated the refactor.

idle owl
#

Oh, hmph. Ok.

#

I'll dig up an M0 then.

tidal kiln
#

but hopefully should work now

#

with the refactor'd CMP230xx lib and the CharLCD library updated to use it

idle owl
#

Ok, I downloaded the most recent just now and loaded them. But on an M4.

tidal kiln
#

could be worth testing on M4 also just to make sure I didn't break anything

idle owl
#

M4 works.

lofty nova
#

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.

idle owl
#

@lofty nova No worries! We can always read your notes off during the meeting. πŸ˜ƒ

inland tusk
#

is meeting back to normal this week?

slender iron
#

yup! 5 minutes until it @inland tusk

inland tusk
#

thanks I will be there.

#

@solar whale hello there, have a good week?

solar whale
#

@inland tusk Yes - very good thanks -- and you?

inland tusk
#

@solar whale Well.

slender iron
#

<@&356864093652516868> Two minutes or so until the meeting

neat folio
#

check for leaks in the helium lines

idle owl
#

@inland tusk Please mute. Thanks!

gilded cradle
#

Thanks

idle owl
#

πŸŽ‰ @gilded cradle !!

tulip sleet
#

YAY

slender iron
#

πŸŽ‰

river quest
raven canopy
#

i'll update my notes... 🀣

idle owl
neat folio
#

🌳

idle owl
#

CircuitPython Weekly: Treefall Edition.

gilded cradle
#

lol

neat folio
#

timecode for timber?

raven canopy
#

well done Seattle Lumberjacks Troupe!! πŸŽ‰

#

@neat folio πŸ’―!!!!

#

🀞 for a quiet season... (selfish request, as i'm on the Gulf Coast)

neat folio
#

also have an "in /after the weeds question"

raven canopy
#

@neat folio go ahead and put the subject up in here, and we'll add it to the notes

neat folio
#

What would be involved in getting a circuitpython editor up and running on an iPad pro?

raven canopy
#

added to the notes.

solar whale
#

@idle owl what board are you testing MCP9600 i2C on?

idle owl
#

@solar whale Metro M0. With the shield and the I2C simple test for RGB display (it's the one I had)

solar whale
#

OK - just curious.. I thought clock-stretching was working OK in CP

idle owl
#

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.

solar whale
#

a good thing to suspect! Good luck!

idle owl
#

Thanks, I'm going to need it.

ruby atlas
#

Today: In the trees?

neat folio
#

the tree is now in the weeds

inland tusk
#

in the branches

idle owl
#

Renamed.

raven canopy
#

"yet".

solar whale
#

I have to go -- work calls 😦 have a great week!

raven canopy
neat folio
#

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." 😦

idle owl
#

@tidal kiln As I said in the meeting, M0 fails with MemoryError.

tidal kiln
#

😦

#

how/what're you running?

idle owl
#

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```
tidal kiln
idle owl
#

@tidal kiln Yes

tidal kiln
#

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.

#

will just keep that open and keep trying...

manic glacierBOT
idle owl
#

@tidal kiln Will do

tidal kiln
#

cool. thanks for testing with m0.

idle owl
#

You're welcome.

raven canopy
#

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. πŸ˜†

slender iron
#

oh, oops!

raven canopy
#

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. πŸ˜„

raven canopy
#

@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?

prime flower
#

@raven canopy Yeah, that'd be a better idea

raven canopy
#

hmm. though the other ValueError exceptions may get...mangled?

prime flower
#

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

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?

prime flower
#

@raven canopy yup, I can test it from here

#

I'm gonna set up the coral real quick...

raven canopy
#

@prime flower pushed

prime flower
#

@raven canopy looks good!

raven canopy
#

does it chain the exceptions? i could just be flat wrong on expecting it to...

prime flower
#

hrmmm lemmie try

#

@raven canopy doesnt look like it's chaining them, here's a console log

raven canopy
#

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)
#

πŸ€”

prime flower
#

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'```
raven canopy
#

well that's weird. i'm staring at the call... πŸ˜„

prime flower
#

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

raven canopy
#

huh. in fact it doesn't... that might be an issue. πŸ˜„

prime flower
#

Yeah I'll open a sep. one for that

#

Let's fix the exception chain in this PR, though

raven canopy
#

k. i have a hack in mind...but its super ugly. give me some time to think and research some more.

prime flower
#

np

prime flower
#

@raven canopy opened up a sep. pr, thanks for testing this with me and finding some issues

raven canopy
#

πŸ‘

#

@prime flower new push. its the least ugly way i can think of...

prime flower
#

@raven canopy checking it out rn

#

@raven canopy doesn't look like it's chaining them anymore, nice work!

raven canopy
#

just a matter of moving around some bits.. πŸ˜‰

prime flower
#

aaand released πŸ˜ƒ

simple pulsar
#

How does sample playing work in CircuitPython when the wav file is larger than memory?

meager fog
#

it loads it on the fly

#

thats why QSPI is best, SD is slower

simple pulsar
#

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

meager fog
#

its likely limited to 44.1khz

simple pulsar
#

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.

meager fog
#

our decoder logic may not permit it

simple pulsar
#

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

manic glacierBOT
#

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...

dark silo
#

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?

quasi fjord
#

Adafruit.io -> ITTT -> Google sheets. The CP part should be pretty pretty simple

dark silo
#

@quasi fjord Thanks!

manic glacierBOT
prime flower
manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
#

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.

orchid basinBOT
simple pulsar
#

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.

solar whale
crimson ferry
#

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.

tough flax
#

Hi folks, is there a way to list multiple SSIDs in the secrets.py file for the PyPortal and other WiFi boards?

crimson ferry
#

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.

tough flax
#

The PyPortal class has code for managing the secrets file - I'm asking if that has any ability to use multiples.

simple pulsar
#

@tough flax What's the use case for that? Portability between different places?

tough flax
#

@simple pulsar yes

tidal kiln
tough flax
#

Ok, I'll have to work around it

manic glacierBOT
#

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...

simple pulsar
tough flax
#

Ok, thank you

manic glacierBOT
crimson ferry
#

Where is the mapping between pins and timers done for each board in the CP core?

manic glacierBOT
tulip sleet
#

@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

crimson ferry
#

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 !

old smelt
#

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!

orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
marble hornet
#

@slender iron there isn't a way to make a dispio compatible object without inheriting from one right?

obsidian dome
#

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

manic glacierBOT
#

…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)

...
slender iron
#

@marble hornet there isn't

manic glacierBOT
manic glacierBOT
tulip sleet
#

@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.

manic glacierBOT
#

@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_rate is an uint16_t in the audioio_wavefile_obj_t type.

https://github.com/adafruit/circuitpython/blob/c5a4e19d6f76a09cba73149d5e3d4548da320899/shared-module/audioio/WaveFile.h#L34-L55

While the parsed sample_rate of the wave header format is uint32_t:
https://github.com/adafru...

bronze geyser
#

(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....

main meteor
#

I can upload a copy for you if you like.

tidal kiln
#

@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

idle owl
#

@tidal kiln Not that I'm aware of.

tidal kiln
#

like maybe add an FAQ entry there?

idle owl
#

If you're answering questions about it, then it's worth adding.

tidal kiln
#

ok. i can add something. does that seem like best place?

idle owl
#

Yeah i think it works. And it'll be easy to link to

idle owl
#

@tidal kiln Yeah sounds good.

tidal kiln
#

okie doke. can always tweak as needed. we'll see if it helps.

idle owl
#

Thanks for adding that!

tidal kiln
#

thanks for proofing!

lofty nova
#

I think there is already a paragraph that says that when a main.py ends, it give back control to the REPL in a fresh new VM instance that do not inherit of any context from main.py. So may be your FAQ item should point to that paragraph for more explanation ?

#

May be not in that guide. May be in readthedocs. I'm searching ....

#

It is in the difference-with-micropython section. So may be not obvious for beginenrs

tidal kiln
#

ah. good find.

lofty nova
#

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 ?

tidal kiln
#

not sure, so tried it...
boot.py

foo = 23

code.py

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
manic glacierBOT
lofty nova
#

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

tidal kiln
#

i could be doing it wrong though πŸ˜ƒ

lofty nova
#

Ok, so just for you to gain trust in yourself, I did it and got the same result πŸ˜„

#

And also double checked in micropython and main.py inherit of the foo value set in boot.py as well as the REPL inherit of what main.py left

tulip sleet
#

@bronze geyser @lofty nova the mpy-cross for CPy 3 will actually work fine for CPy 4.

orchid basinBOT
lofty nova
#

hi @tulip sleet, yes I keep on using the one downloaded from the v3.1.2 release

tulip sleet
#

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

lofty nova
#

So there are plans to merge some of micropython v1.11 ?

tulip sleet
#

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

lofty nova
#

ok.

tulip sleet
#

@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

slender iron
#

@tulip sleet I can meet a little later. I've been deep in displayio and need lunch

tulip sleet
#

@slender iron that's fine; I'm going to start cooking dinner soon

slender iron
#

k, want to ping me after? I can chat before the internal meeting if that's ok with you

tulip sleet
#

sure

tulip sleet
#

@slender iron all done with dinner; I think I figured out the problem but would like to check with you on the diagnosis

slender iron
#

kk

bronze geyser
#

@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

tidal kiln
#

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)
>>> 
swift arrow
#

congrats @gilded cradle !

#

cool projects on adding Blinka to new boards and being @odd flax now πŸ˜ƒ

gilded cradle
#

Thanks @swift arrow

raven canopy
#

oh lord...that's a large picture. 🀣

timber mango
#

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 ?

quasi fjord
#

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

manic glacierBOT
#

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...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

tulip sleet
#

@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?

slender iron
#

@tulip sleet how about modifying the collect phase to manually mark them?

tulip sleet
#

eek, well, maybe, maybe this is a new class of object

slender iron
#

it's something the port is already responsible for

tulip sleet
#

are you away from desk? we can talk further when you return?

slender iron
#

just got back to it

tulip sleet
#

maybe let's video for efficiency

slender iron
#

kk

tulip sleet
#

whenever

idle owl
#

@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.

tidal kiln
#

@idle owl which feather? want me to try also?

tulip sleet
#

@idle owl I missed the notification. Is it any code, or just that code

idle owl
#

It's green now. Feather M4 with an unreleased library on it... I have no idea what's going on with it.

manic glacierBOT
#

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 in nrf port.
  • Removed redundant #if guard in reset_displays().
  • Removed a SAMD21 platform setting from some doc.

In the long ru...

tidal kiln
#

sounds fun πŸ˜ƒ

manic glacierBOT
simple pulsar
#

@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?

tulip sleet
#

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

simple pulsar
#

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?

raven canopy
#

iirc there is a specific exception thrown. don't recall its exact name/language though.

tulip sleet
#

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."));
simple pulsar
#

@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() ?

tidal kiln
#

could be all of the above

manic glacierBOT
tidal kiln
#

beginners for sure, but maybe also arduino people since CP doesn't require a loop()

simple pulsar
#

It's an interesting difference from Arduino land and from traditional C's main

tidal kiln
#

i think the other confusing point is REPL vs. some_file.py