#circuitpython-dev

1 messages ยท Page 201 of 1

tidal kiln
#

but it can do single ended and differential, like the ADS

slender iron
#

ah, I think thats why

#

how does ads do differential?

tidal kiln
#
chan = DifferentialAnalogIn(mcp, MCP3008.pin_0, MCP3008.pin_1)

vs.

chan = adc[(0, 1)]
slender iron
#

ah, hrm

#

whats your preference?

tidal kiln
#

to not decide ๐Ÿ˜ƒ

#

i can see +s and -s to both i guess, but don't feel like i'm enough of an API design ninja to sway one way or the other

slender iron
#

I think my preference is the mcp style because its much more obvious what it does

#

ideally the seesaw lib would be that style too

tidal kiln
#

and the ADS1x15 should change to match

#

which i'm fine with doing

slender iron
#

ya, sorry about that. its my failure having them different

tidal kiln
#

no worries. important thing is to get them consistent.

slender iron
#

totally, thanks!

tidal kiln
#

do you want to close out your review on the MCP lib, and leave a comment to the effect that you think the API there is the way to go?

#

i'll then also review, for whatever else may seem like it needs addressing

slender iron
#

kk, I'll dismiss my review

tidal kiln
#

cool. i've added myself for a review.

slender iron
#

you may need to make the changes too. I don't know how much time @prime flower has now

#

probably worth adding this info to the design guide too

#

its a pretty broad design pattern

tidal kiln
#

hmm. how's that work...any way to take over a PR?

slender iron
#

you can probably edit directly or create your own branch and pr

prime flower
#

is following this

tidal kiln
#

so it would end up as another PR, from my own branch

slender iron
#

or brent can help finish it

#

it should be close I think

tidal kiln
#

@prime flower is that an option for you?

manic glacierBOT
prime flower
#

@tidal kiln I'll be around to help finish it and review if that works for you?

manic glacierBOT
tidal kiln
#

Sounds good.

marble hornet
#

@slender iron did you have to re-export cp to add the device name changing feature?

slender iron
#

@marble hornet what do you mean re-export?

marble hornet
#

compile** sorry

slender iron
#

nope, it should be in there. I did run into a bug with it though

marble hornet
#

could I sneak a peak at the boot.py you used?

slender iron
#

its in the issue

marble hornet
#

ah, ๐Ÿ‘Œ sorry to bother

#

thanks

slender iron
#

np

marble hornet
#

it's not working at all for me, but i'm using 3.0.2

#

lemme try 4 alpha

slender iron
#

I have 4 alpha

marble hornet
#

4 a 1 ? or 4 a?

manic glacierBOT
slender iron
#

1 ish

marble hornet
#

oh it is working now! but on 3 !!!

#

but i flashed 4a1 then 302

#

๐Ÿคท why

#

thanks!

manic glacierBOT
slender iron
#

now has back catalog

tidal kiln
tulip sleet
#

what's the travis url?

tulip sleet
#
Warning, treated as error:
/home/travis/build/adafruit/Adafruit_CircuitPython_MCP3xxx/adafruit_mcp3xxx.py:docstring of adafruit_mcp3xxx:4:TODO entry found: Describe what the module does
#

There's a TODO in the docstring, it doesn't like that.

tidal kiln
#

where's that message at?

tulip sleet
#

in the build log, line 567

tidal kiln
#

the linting also didn't pass

tulip sleet
#

yeah, it's not installing the right version of pylint either. The .travis.yml doesn't appear to be current practice in several ways.

tidal kiln
#

the PR version seems better maybe?

tulip sleet
#

yeah, that's better, but it's still not doing pylint==1.9.2

#

i should have looked at the PR - sorry

#

otherwise it uses pylint 2.something, which introduces a whole new bunch of checks

tidal kiln
#

but it's not even showing a failed indication, at least not that i can see

tulip sleet
#

i know, that's confusing, where's the travis integration line in the PR conversation?

tidal kiln
#

i don't see it

#

but if you look at the commits, it was running (and failing), and then passed, and then stopped running

tulip sleet
#

that build is from a month ago??

tidal kiln
#

yes. this lib and PR has been neglected ๐Ÿ˜ฆ

#

trying to dust it off and get it wrapped up

#

adding readme, sphinx docs passed, and then the commits after that have no checks

tulip sleet
#

maybe this library has the wrong travis owner??

#

i can't remember where that's set (or if i'm confused)

tidal kiln
#

yah, i'm not sure what/where to check either

tulip sleet
#

@tidal kiln it's not hooked up to rtd, but the travis hookup looks ok.

tidal kiln
#

yep. nothings jumping out at me either.

tulip sleet
#

it's really weird, the other PR has a failed travis check, but this one doesn't

tidal kiln
#

on travis page, go to the "More options" drop down on right and select "Requests"

#

Could not parse .travis.yml

tulip sleet
#

aha

#

I just edited the .travis.yml from github to try to force the change, which did nothing. so I'll look again.

#

ok ,I added a missing hyphen

#
deploy:
- provider: releases
#

hyphen there was missing

#

that's a terrible UI

#

i mean where the "Could not parse" was hidden

#

ok, now it's happily failing

#

you want to take it from here?

tidal kiln
#

yes. awesome. thanks.

manic glacierBOT
#

Hi,

This is work in progress and before continuing i would like to get your opinion @carlosperate, about the translation of some words.

Example 1:
https://github.com/adafruit/circuitpython/blob/c23d2028a86d207fd02d274c809c62075f4595ed/py/argcheck.c#L64

Translated it as:

a la funciรณn le hacen falta %d argumentos posicionales requeridos

Example 2:
https://github.com/adafruit/circuitpython/blob/c23d2028a86d207fd02d274c809c62075f4595ed/py/argcheck.c#L44

Translated as:

la fu...

manic glacierBOT
raven canopy
#

haha. tried to pin the video, and discord yelled at me. there's a limit? what sort of 19th century rules are they working with? ๐Ÿ˜†

manic glacierBOT
#

There's two answers to that: does it work for my project? Not particularly - I needed the ability to flash over UF2/whatever the board in question uses and know for an absolute fact what code would be run on bootup, and that it wouldn't change (and wouldn't be skipped if there was a main.py already on the board somewhere).

Is it something I'd be willing to change this PR up to accomplish? Probably - time's a little crunched this week but I should have time towards the end of the week to ...

manic glacierBOT
#

I experimented with both native and viper yesterday, because I had some code that generates patterns for neopixels, and it was running too slow.
The biggest leap in speed I got by converting everything to integer. After that, neither native nor viper didn't bring any further improvement, but also didn't force me to write incompatible code.
But surely your code will look more c like, and less pythony.
I think that the bottleneck lies in the neopixel routines, and not in my code, hence the l...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tidal kiln
#

@pastel panther looks like getting/setting the thresholds has similar bit-foo issues. :(
dealing with this should be same as what you've already done. also - i played around with struct.unpack some and if you want to change to using that, i think i can show you how. but if you want to just do what you've already done so you can wrap this up, that's fine.

pastel panther
#

@tidal kiln (โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

I should have checked, sorry

tidal kiln
#

no worries. i should've checked sooner also. sorry this is dragging out.

pastel panther
#

It's a learning process

#

I'm happy to hear what you figured out about unpack

#

I was able to use it for the adxl345 temp register but it's bits fit nicely into two bytes which unpack likes. I figured that some adjustment would be needed either in the bytes given to unpack or to the format unpack is expecting

#

That's another thing that will have to change; the register reading fns will need to return bytes or just leave them in the buffer

tidal kiln
#

the trick for the odd sizes like the 19 bit one stored in 3 8 bytes registers is to just add an extra byte so unpack will like it

pastel panther
#

aaaah yes, of course

tidal kiln
#

but just realize that you effectively multiplied it by 2**8 in the process

#

so need to take that into account in the following math

pastel panther
#

right

tidal kiln
#

the other quirk was that unpack wants a buffer object for input

#

so you can't just give it the raw variable

#

i was using to_bytes to get around that

pastel panther
#

right, I mentioned above that the register fn might want to change

tidal kiln
#

oh. yep. that would be the other approach.

#

return the byte buffer, instead of shifting / or'ing it into a value

pastel panther
#

ya

tidal kiln
#

the LIS3DH does that

pastel panther
#

that was my model for the 345

tidal kiln
#

ok. sounds like you're on it.

pastel panther
#

thanks for figuring out that unpack extra byte thing; I probably would have got there eventually but it would have taken a while likely

#

I'm thinking this register reading/conversion stuff should maybe either be in the register module if it isn't already or a guide or both

tidal kiln
#

that could be another approach

#

i haven't used that module myself yet

#

there was some talk about it in the meeting

pastel panther
#

nor I; I was planning on possibly refactoring the max driver to use it as appropriate

#

As a concept it makes a lot of sense; there is a lot of the same type of getting/setting conversion for just about every driver

tidal kiln
#

yep

slender iron
manic glacierBOT
#

I haven't written them down since I've been focused on seeing if it was at all possible to convert stdlib.
But here's the last two that I remember:

From lib/logging/init.py:

import time

class LogRecord(object):
    def __init__(self, name, level, pathname, lineno,
                 msg, args, exc_info, func=None, sinfo=None, **kwargs):
        ct = time.time()
        self.created = ct

class Formatter(object):
    converter = time.localtime

    def __i...
tough flax
#

Hi all - good news/bad news on the serial_bytes_available() front ... on the upside, I have it working (yay!) It works just as we thought.

On the down side, I have a problem and a question. The problem is that Mu doesn't include the new method in autocomplete. Oddly, the REPL does... thoughts? Does Mu use some cached values or did I miss a change in the build?

On the question, why are there method on the module (ala supervisor.set_rgp_status_brightness()) and other methods on the singleton supervisor.runtime object (ala supervisor.runtime.serial_connected)? I have no problem with this but find it a bit odd.

idle owl
#

@slender iron Interesting.

#

So I'm realising to be able to rewrite Scott's original slideshow code, I need to add brightness control to the library and I'm failing to see how to do that. Everything I'm trying is breaking or doing nothing.

tidal kiln
#

@tough flax can't answer those questions. sry. but wondering if you saw my PR to airtalker?

idle owl
#

Scott's code changed the max brightness globally, so when the fades happen, they happen to the set brightness etc. So I need to make it so you can affect max brightness I assume. Which seems like a couple of properties or something.....

#

As the lib works now, it's got _MAX_BRIGHTNESS as a variable outside the class set to 2 ** 15. So I think I'm supposed to do something that allows that to change in the same manner as Scott's original code. It's all doing math with += and -= etc.

#

I really wish I knew I would have to add this when I was still working this in code.py because I am having a lot of trouble trying to make it work in the existing library.

#

Though I have no proof I would have had as much of a problem working it in code.

#

ยฏ_(ใƒ„)_/ยฏ

tidal kiln
#

can be done various ways. i'm not sure i've seen what scott's changes are. anyway to share current state of code?

idle owl
#

Scott didn't change anything. I'm referring to his original slideshow code to find out what needed to be added to the current lib code. To be able to control brightness, you have to work with backlight.duty_cycle and that can't be set both in the lib and in code.py without pin in use problems. So that's why I'm referencing his original code. I will link the current state and his original.

haughty bobcat
#

So I noticed CircuitPython 4.0 has more display features. How long until we can control an OLED display? Or is this already possible?

idle owl
#

And code.py currently looks like this: ```python
from adafruit_slideshow import PlayBackMode, SlideShow, PlayBackDirection
import touchio
import board

forward_button = touchio.TouchIn(board.TOUCH4)
back_button = touchio.TouchIn(board.TOUCH1)

brightness_up = touchio.TouchIn(board.TOUCH3)
brightness_down = touchio.TouchIn(board.TOUCH2)

max_brightness = 2 ** 15

slideshow = SlideShow()

slideshow.loop = False

slideshow.order = PlayBackMode.ALPHA
slideshow.fade_effect = False
slideshow.auto_advance = False
slideshow.dwell = 0

print(slideshow._file_list)

while True:
if forward_button.value:
slideshow.advance()
if back_button.value:
slideshow.advance(direction=PlayBackDirection.BACKWARD)

if brightness_up.value:
    max_brightness += 16
elif brightness_down.value:
    max_brightness -= 16
if max_brightness < 0:
    max_brightness = 0
elif max_brightness >= 2 ** 16:
    max_brightness = 2 ** 16 - 1
# backlight.duty_cycle = max_brightness
slideshow.update()
slender iron
#

@haughty bobcat it depends on when I get back to it. I've got some audio work to do first

haughty bobcat
#

What about the hallowing display?

#

Is that in the same boat?

idle owl
#

@haughty bobcat The code you're looking at above is a slideshow helper library we're working on for the Hallowing to display .bmp images

haughty bobcat
#

ah

slender iron
#

we have image display working for the hallowing but nowhere else

tidal kiln
#

@idle owl is the idea to change the target max brightness with the touches? so that it will fade in to that new setting?

slender iron
#

because the hallowing inits the display at boot instead of from python

tough flax
#

@tidal kiln - Just saw it (burried in "Forums" on GMail)... will review & accept. I did make you a contributor if you want to edit on the mainline (this is very new stuff

haughty bobcat
idle owl
#

@tidal kiln Um... not exactly. The idea is to be able to use any input to change the overall brightness period. Fade isn't necessarily part of it.

#

If you run Scott's code, you'll see you can change the overall brightness with the two middle teeth.

slender iron
#

@tough flax the runtime object is for the single vm rum while the module level stuff has a longer impact

idle owl
#

I mean touch makes a lot of sense, but you could use the light sensor too or something... so I want it to be something you can add in after an input

tough flax
#

@slender iron is that like a single-malt scotch?

#

:-b

slender iron
#

haha, ya

#

yay colemak

tough flax
#

@slender iron any idea on where Mu pulls its autocomplete from?

slender iron
#

nope

tough flax
#

@tidal kiln I appreciate the work on the config stuff... but... ๐Ÿ˜ƒ

#

That's not how I want it to work ๐Ÿ˜ƒ

tidal kiln
#

@tough flax no worries - that's why the PR approach is cool. you can comment there about why it doesn't work, etc. and I can try again

tough flax
#

I want to write a parser for their existing files. Two products (one defunct and one not) use the same(ish) format. So, I want to read that format (which is a butchered Windows INI file) and build the dicts that are currently put in the MorseMaps.py file

tidal kiln
#

is there a reason why continuing to use the existing config files is needed?

tough flax
#

If you'd like to take a stab at that, I'd LOVE the help ๐Ÿ˜ƒ I just added a sample config file

tidal kiln
#

could we do a one time translation to get that info into a new format, and then use the new format going forward?

tough flax
#

Yes, these folks have used exactly those options for 20+ years and it's their only way of communicating - we can certainly support multiple formats, but the "set of 8 dicts that we look up binary codes in" is more about efficiency than human understandable config files.

#

So a format that just says ".- = a" and "-...=b" is simpler than them splitting them up by length

manic glacierBOT
tough flax
#

I put the 8 dicts in a config file just to see if we can get the timing we need (we can)

slender iron
#

string parsing is easy with python too

tough flax
#

at config-time it is - at runtime, it'll kill our performance

slender iron
#

sure, just load it at the start and store it in memory

tough flax
#

right, I'm shifting bits into ints and then looking up the codes in a set of tables

#

This is about how we load the tables

haughty bobcat
#

I missed all Tony DiCola's amazing circuitpython hardware guides...

#

I like his stuff. Very well documented.

slender iron
#

beware they may be out of date

haughty bobcat
#

Yeah I see some micropython here and there

tidal kiln
#

@tough flax the table needed for performance could be generated from a more human readable table (or other config), this would happen at the start of runtime, so wouldn't cause a performance hit in the critical loop

tough flax
#

Yes. That's why I was saying I don't want to put the format we have (those tables) into a config file (except for testing)

#

@tidal kiln we are in heated affirmation

haughty bobcat
#

So when my Circuitypthon board is printing to serial how do I use REPL in mu?

tough flax
#

(@tidal kiln, it says your're typing... so I'm waiting... but I need to run ๐Ÿ˜ƒ

#

I'll be back in an hour or so

slender iron
#

@haughty bobcat not sure what you mean

tidal kiln
#

i wouldn't call that JIM_ADAP2UCFG.TXT file readable either. i can understand if there's setup in there they don't want to have to recreate.

tough flax
#

Agreed - but that's there for backward compatibility

#

heading out

tidal kiln
#

@tough flax ok. later then.

haughty bobcat
#

In my code I have my device send some numbers very quickly over serial. I would like to use the REPL to control the device, but since my code is printing to it I cannot type a character in MU to start controlling my device.

slender iron
#

@haughty bobcat I don't think there is a way to print stuff and listen for inputs at the same time

haughty bobcat
#

Well I don't need to do it at the same time

#

My code starts up and takes over before I can start the REPL

tidal kiln
#

@idle owl i think scott's code is doing what i'm saying. to change your code, you essentially need to change _MAX_BRIGHTNESS, but the current name kind of implies it is a const

haughty bobcat
#

the way I deal with it right now is adding a rogue space so my code doesn't run

slender iron
#

you can use input in your code to read from the serial

idle owl
#

@tidal kiln I think I did it....

slender iron
#

you can also ctrl-c to stop your code

idle owl
#

But it doesn't update until you change the image

#

Also I am pretty sure the way I did it is bad.

tidal kiln
#

using that code from above?

idle owl
#

No let me update what I did.

tidal kiln
#

ok. cause i don't see how that does anything to the class variable.

idle owl
#

I don't entirely know what you mean but I moved stuff around and added things to make it work

manic glacierBOT
idle owl
#

Code.py ```python
from adafruit_slideshow import PlayBackMode, SlideShow, PlayBackDirection
import touchio
import board

forward_button = touchio.TouchIn(board.TOUCH4)
back_button = touchio.TouchIn(board.TOUCH1)

brightness_up = touchio.TouchIn(board.TOUCH3)
brightness_down = touchio.TouchIn(board.TOUCH2)

slideshow = SlideShow()

slideshow.loop = False

slideshow.order = PlayBackMode.ALPHA
slideshow.fade_effect = False
slideshow.auto_advance = False
slideshow.dwell = 0

print(slideshow._file_list)

while True:
if forward_button.value:
slideshow.advance()
if back_button.value:
slideshow.advance(direction=PlayBackDirection.BACKWARD)

if brightness_up.value:
    slideshow.backlight_level_up()
    print(slideshow.current_brightness)
elif brightness_down.value:
    slideshow.backlight_level_down()
    print(slideshow.current_brightness)
slideshow.update()
#

I wasn't sure it was working so I was printing my current_brightness, that's not something I would include in the final.

#

And I know why it doesn't update until I change photos, because setting brightness happens in update()

#

I was simply noting the behavior.

tidal kiln
#

yep. that won't update until you change the image.

manic glacierBOT
tidal kiln
#

scott's was effectively the same. pressing forward/backward was equivalent to calling update

idle owl
#

except it changed brightness on the current photo

#

so I need to figure out where to put things to make that happen

tidal kiln
#

ok. i see that now...hmm...ok. slowly getting to what you're trying to do....

idle owl
#

I can't even believe I got it this far!

#

Also are those properties?

tidal kiln
#

maybe. still have the thought turkey in the oven....

idle owl
#

pokes the thought turkey hurry and cook already!

#

actually it fails if they're properties.

#

seems like I would need a "global brightness" function that you call in the while True loop in the code

tidal kiln
#

internally you are representing brightness as a duty cycle value

idle owl
#

that is constantly updating

#

right

#

because I thought it was

tidal kiln
#

you don't need to worry about "current" level

#

all you are doing is updating the max level

#

fade in = go from zero to max, fade out = go from max to zero

#

display current = show at max brightness

manic glacierBOT
tidal kiln
#

in the _SHOW_IMG state, just update to max, so add a:

self._backlight.duty_cycle = self._max_brightness

in there

#

self._max_brightness replaces _MAX_BRIGHTNESS (<-- that goes away)

#

there

idle owl
#

I'm confused

#

if I did what you're suggesting, it's not working. So I did it wrong presumably.

tidal kiln
#

ok. back up a bit. follow what i was saying here?

fade in = go from zero to max, fade out = go from max to zero
display current = show at max brightness
manic glacierBOT
idle owl
#

I guess? I feel like I do but that doesn't mean I do

tidal kiln
#

that's the general approach for how it works. not new. it's always been doing this.

manic glacierBOT
#

In this particular project I'm flashing a mechanical keyboard firmware, and it was both significantly slower and significantly less reliable/stable to flash entrypoints (main.py, in CircuitPython's case) with ampy or with USB MSC (this is also why I'm not thrilled that bossa deploys to M4 devices are currently broken on my system and I'm stuck with UF2, but that's an issue I need to do further debugging on before opening an issue here). If main.py isn't as expected, the user has no keyb...

idle owl
#

ok

tidal kiln
#

what's new is that max brightness can now change

#

otherwise, it's still the same

idle owl
#

right

#

so it needs to not be _MAX_BRIGHTNESS anymore is what you're saying because it's changing

tidal kiln
#

correct

idle owl
#

ok updated that

tidal kiln
#

but the important bit that was missing before was an update to the PWM output while the image was being shown

idle owl
#

right

#

so I added that in there but it's not doing anything so I assume I've added it wrong.

#

(so apparently I was following what you meant)

tidal kiln
#

that is currently just this:

        if self._current_state == _SHOW_IMG:
            if now - self._img_start > self.dwell:
                  self._current_state = _FADE_OUT if self.auto_advance else _WAIT
idle owl
#

now it's this: python if self._current_state == _SHOW_IMG: self._backlight.duty_cycle = self._current_backlight_level if now - self._img_start > self.dwell: self._current_state = _FADE_OUT if self.auto_advance else _WAIT

#

tried it below it too, or inside the other if, no dice

tidal kiln
#

first line is fine. you could add a conditional to see if it's changed. but for now, just set it every time (what you currently have)

idle owl
#

ok then what needs to happen to make it work...

#

Oh....

#

Because the _current_state is _WAIT because it's not in autoadvance.

tidal kiln
#

in your gist you have self.current_brightness = self._MAX_BRIGHTNESS
above you have self._current_backlight_level

idle owl
#

yah I changed what things were called, it didn't make sense how I had it.

tidal kiln
#

what handles _WAIT?

idle owl
#

Fixed it.

#

advance handles it I believe.

tidal kiln
#

oh. that gets called from the code. ok.

idle owl
#

I printed current_state in code.py and realised it was in _WAIT, not _SHOW_IMG because it's not in autoadvance mode.

tidal kiln
#

which sets state to _FADE_OUT

idle owl
#

that's why it wasn't updating with that line there.

#

yes

#

but only after you provide the input to advance to the next image

#

seems to work in automatic mode with fade_effect on too

tidal kiln
#

ah. fading is turn off-able now.

idle owl
#

Yes.

tidal kiln
#

this thing is getting fancy pantsy

idle owl
#

I did all the fade stuff myself. I point this out because much of this code was written by you and Roy and I am deeply grateful for that ๐Ÿ˜ƒ

#

I think, though, that this has reached the point that was desired. I can now rewrite Scott's code.

tidal kiln
#

cool. i guess the other thing to consider it if you want to @property the brightness control.

idle owl
#

I did and it failed

#

said 'int' object can't be called or something like that.

tidal kiln
#

sounds like a simple syntax issue

idle owl
#

oh did I need to drop the () in code.py?

tidal kiln
#

yep

#

and that's the error message i would expect

idle owl
#

hmm

#

PyCharm is complaining about code.py now but it works.

idle owl
#

Compare now to Scott's original: ```python
from adafruit_slideshow import PlayBackMode, SlideShow, PlayBackDirection
import touchio
import board

forward_button = touchio.TouchIn(board.TOUCH4)
back_button = touchio.TouchIn(board.TOUCH1)

brightness_up = touchio.TouchIn(board.TOUCH3)
brightness_down = touchio.TouchIn(board.TOUCH2)

slideshow = SlideShow()
slideshow.order = PlayBackMode.ALPHA
slideshow.auto_advance = False
slideshow.dwell = 0

while True:
if forward_button.value:
slideshow.advance()
if back_button.value:
slideshow.advance(direction=PlayBackDirection.BACKWARD)

if brightness_up.value:
    slideshow.backlight_level_up
elif brightness_down.value:
    slideshow.backlight_level_down
slideshow.update()
#

๐Ÿ˜ƒ

#

@slender iron I think I did it.

tidal kiln
#

the property version would look something like this maybe

    if brightness_up.value:
        slideshow.brightness += 16
    elif brightness_down.value:
        slideshow.brightness -= 16
    slideshow.update()
idle owl
#

um hmm.

#

it's happy at the moment....

#

with them being properties. and not under __init__ anymore.

tidal kiln
#

did you @property the two funcs backlight_level_up and backlight_level_down?

idle owl
#

yes

tidal kiln
#

it's functional, but not really how it was intended

idle owl
#

hmm.

#

I thought it would make the code easier to deal with if all the math was handled in the lib.

tidal kiln
#

good point. there may be a way to do both.

idle owl
#

why do both?

tidal kiln
#

options?

idle owl
#

I suppose, but that's a slippery slope. Like I opted not to add the option for random to reshuffle the list every time it loops because I decided not to.

tidal kiln
#

if you want to leave it as those two funcs, go back to having them as funcs

idle owl
#

I guess maybe I don't understand what the point of making them properties is/was in the first place. Or I simply don't understand properties is the other likely option.

tidal kiln
#

mainly just provides a different syntax to the user

idle owl
#

if you think having the option makes sense, we can add it. But that's where I started and had a lot of trouble figuring out how to do it.

tidal kiln
#

meh. i can't think of a reason to make it something needed.

#

but go back to just having them as funcs though:

    if brightness_up.value:
        slideshow.backlight_level_up()
    elif brightness_down.value:
        slideshow.backlight_level_down()
    slideshow.update()
manic glacierBOT
idle owl
#

ok

tidal kiln
manic glacierBOT
idle owl
#

@tidal kiln Na I like it. I'll add it.

#

kind of combined the options you were looking for.

tidal kiln
#

cool. yep. with the default being that magic 16 everyone seems to like.

idle owl
#

struggling to describe the parameter for the docstring though.

tidal kiln
#

amount by which current brightness will be increased/decreased, in units of..??PWM things

idle owl
#

๐Ÿ˜„ Obviously the design guide should be updated with that unit. PWM things

idle owl
#

Hah!

#

Added the docstring, saved, memory error. ๐Ÿ˜†

manic glacierBOT
idle owl
#

Hooray!

#

I don't think there are PWM units.

#

Hz ?

idle owl
#

ok

#

I put this: Specify the number of steps by which current backlight level will be decreased. Default is 16.

#

doesn't sound right to me, but...

tidal kiln
#

that's fine.

idle owl
#

ok good

manic glacierBOT
manic glacierBOT
idle owl
#

@solar whale You're always so fast! I responded in the PR but Travis failed on that for me and I pushed the update. Waiting on it to run again, but got in behind a CP build.

#

@solar whale What do you think overall? Only a few people have looked at it, and most of them helped write it, so more feedback is super useful

solar whale
#

@idle owl just happend to be in the right place! Was plaing with mine when I saw the PR ger posted. Seems to be working well on my quick tests of simepletest and touch.

idle owl
#

Ok great!

solar whale
#

I'll try to play with it more -- will have more time tomorrow.

idle owl
#

Ok, if you find anything, make an issue on the repo since I think we'll have it merged today for the initial release.

solar whale
#

Great! Congratulations -- It'll be great to have.

idle owl
#

@tidal kiln Can you review it again for me if you have a moment?

tidal kiln
#

looks like you're green on travis. review now?

idle owl
#

yes please ๐Ÿ˜ƒ

manic glacierBOT
tidal kiln
#

@idle owl done

idle owl
#

oi! Good catches!

manic glacierBOT
idle owl
#

@slender iron Do you want to review it as well?

slender iron
#

the slideshow stuff?

idle owl
#

yeah

slender iron
#

sure

slender iron
#

np!

tough flax
#

@slender iron and @tidal kiln - I have completed the "supervisor.runtime.serial_bytes_available()" and removed the optional input() parameter from my fork... I have tested it with a Trinket and added the code to the NRF port as well (which I can't test - no spare BLEs around).

#

I can make a pull request, but honestly I'd like to know which ports you guys want to at least build before a PR?

#

Is there a "make all standard ports" option or script?

#

Or do I just do the PR and let the CI system run?

#

I don't want to step on toes

tidal kiln
#

i'll let @slender iron answer that. sounds like you're wanting to PR to the main CP repo.

tough flax
#

Yes, last time it was rejected (correctly) because I was making it incompatible w/CPython... so I've redone it as requested. But I've only changed two ports (atsamd and nrf) and only test one (atsamd)... I just don't want to do a PR prematurely

#

Can I ask a stupid Git question?

slender iron
#

samd, nrf and esp are built on travis

#

feel free to PR and rely on travis

tough flax
#

Git says my fork is 3 commits ahead (which sounds right) and 112 commits behind (also sounds right) but that my changes are able to be merged

#

I'd prefer to rebase my fork and at least build

#

So I did 'git rebase' and it says it's up to date... I don't know what <upstream> to use to pull those

#

What am I missing?

idle owl
#

@tough flax That's not a stupid question. rebase is crazy magic. Your upstream should be adafruit/circuitpython I believe.

tough flax
#

The didnโ€™t work ๐Ÿ˜•

#

I tried it first ๐Ÿ˜ƒ

idle owl
#

hmm

#

Can you link me to your PR and/or fork

tough flax
#

I will as soon as Iโ€™m not driving

idle owl
#

Ok

#

Good plan

tough flax
#

I haven't made the PR yet (I wanted to rebase first and do a build)

idle owl
#

oh I thought it was the PR that was already in

#

hmm

tough flax
#

Perhaps I'm missing a fetch?

idle owl
#

I'm not convinced you need rebase

#

yah try git fetch upstream, git merge upstream/master, git push atmakersbill master or whatever your remotes are called.

#

That will update your fork

tough flax
#

Ugh: WslRegisterDistribution failed with error: 0x800703fa
Error: 0x800703fa Illegal operation attempted on a registry key that has been marked for deletion.

idle owl
#

but I'm not sure where you're at

#

I have no idea what that error is....

tough flax
#

WSL just failed to start

#

when I tried

#

Ok,that's solved

idle owl
#

nice!

#

I think you only need rebase if changes were made to exactly what you were working on.

#

but I've only dealt with updating a branch that got behind a few times... not enough to have that in muscle memory yet

#

but your master is behind as well. that's an easy fix. your branch might be extra steps.

manic glacierBOT
tough flax
#

Here's the previous PR which now has my new changes

manic glacierBOT
tidal kiln
#

@tough flax the PR update looks like it worked. it's the same PR, just now with some newer commits.

tough flax
#

How do I get the automated build to run again?

tidal kiln
#

it should happen automatically when you push your latest commits

tough flax
#

Ok, well, if that looks good to ya'll I guess I'd appreciate a review ๐Ÿ˜ƒ

#

Heading to dinner - ping me w/questions & I'll reply shortly

tidal kiln
#

yep. i'll leave that up to dan/scott. they were on the discussion, so will get a notice that things were updated.

tough flax
#

Cool

#

This actually really opens stuff up for USB control - I like it ๐Ÿ˜ƒ

tidal kiln
#

@idle owl i signed off on slideshow

idle owl
#

@tidal kiln Thanks! Scott's taking it on so we'll be making some changes.

idle owl
#

@slender iron The example setups didn't use the constructor because that's not what Limor asked for when she roughed out the API for me in the first place. That's why it was all setup individually. I'll look at it probably tomorrow and maybe we can discuss your changes tomorrow.

slender iron
#

sounds good. I'll be around tomorrow

tough flax
#

Will do. I need an hour to settle things diwn

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 3\.0\.3
slender iron
#

np @tough flax

manic glacierBOT
#

Current audioio.Mixer can only start one voice at a time. I'm not sure what the minimum lag is between voices. Ideally multiple voices that need to be synchronized could be started at once.

Example use cases:

  • Multi-track musical piece, where you want to play all tracks at once, or turn some tracks on an off.
  • Synthesized audio where phase differences are critical.

See https://github.com/adafruit/circuitpython/pull/1242#discussion_r223169059 for more detailed discussion.

tidal kiln
manic glacierBOT
slender iron
#

@tidal kiln I think spidevice does it for you

tidal kiln
#

this lib is wrong in other ways which i'm fixing

#

that also looks like something that could be cleaned up

#

maybe it was done before spidevice did it?

slender iron
#

ya, or a mistake

#

ยฏ_(ใƒ„)_/ยฏ

tidal kiln
#

ok. thanks. just wanted a quick sanity check.

manic glacierBOT
solar whale
manic glacierBOT
#

Building with my .travis.yml: https://travis-ci.org/jepler/circuitpython/builds/439443386
Comparable adafruit master branch build: https://travis-ci.org/adafruit/circuitpython/builds/439401711

Elapsed time Total time
master 26m55 105m14s
this PR 22m20

Potentially the tasks could be juggled a little more to lower the elapsed build time in this PR, they were not particularly even and the longest-running job was started last. (I already re...

manic glacierBOT
tulip sleet
#

@solar whale I do, but haven't looked at it much, because a lot of the early work on our port was derived from that. The I/O libraries are pretty different and there's not much to take from them.

manic glacierBOT
manic glacierBOT
plucky flint
#

@slender iron WRT hatchery... oh boy, this would be good. The obvious thing to do would be to have an EmbeddedPython track. What would it involve? Talks would be one obvious solution, but I think (given this is a relatively new area for the wider Python community to encounter) that starting with a beginners at "embedded" workshop with lots of hands-on activities / projects to get people enthused and engaged, would be a good carrot to tempt them in. I'd say "embedded" rather than "CircuitPython" since there's a lot going on in the wider MicroPython community... this may also encompass FPGA related Python hijinx too. Basically, the "broader the church" the more inclusive and appealing it'll be, the more people are likely to turn up.

#

@slender iron in any case, I'd love to help out... but we'd need to either coordinate asynchronously or work something out timing wise.... My current gig is remote work with a bunch of folks on the west coast and my morning standup is actually at 6pm my time. Most evenings are taken up with "dad taxi" stuff and family commitments, but Friday evening's (UK time) are perhaps the best time for me (although not this Friday).

#

@slender iron one thing that I've done lots when establishing these sorts of things before, is to try to wangle invites to people who'd make epic contributions -- i.e. first time you do "X" there needs to be a reason for people to turn up. If "Y" or "Z" are talking about "A" and "B" (interesting subjects which will pull in the crowds) then you're more likely to get more than the usual familiar faces of existing enthusiasts. Does this help..? In any case, please don't hesitate to give me a kick... just remember our timezones are out of sync! ๐Ÿ˜‰

lethal abyss
#

sometimes Discord does not help to follow discussions. I'm enable to find the source of @plucky flint enthusiasm ๐Ÿ˜ƒ

solar whale
#

@lethal abyss you have to scroll back to 1249PM EDT to a note from @slender iron asking if anyone thought the PYCON "hatchery" project was a good thing to participate in.]

lethal abyss
#

I won't be able to finance trip to pyconUS, but some ideas could be borrowed to start again an Education track at PyconFR

stuck elbow
#

@lethal abyss when is that?

lethal abyss
#

@stuck elbow PyconFR ? it was last week end. I had a talk about micro:bit on 2017 edition, then I organized a kid's workshop with MixTeen this year.
They've been very supportive so I guess it is possible to evaluate something in 2019
In the meantime, I'll try something with another french conference called MiXiT.
Interested?

stuck elbow
#

@lethal abyss I'm trying to limit my travelling this year, already going to PyCon.de

#

and thinking about FOSDEM

#

I could get a table there, I think, in the hardware section

lethal abyss
#

@stuck elbow MiXiT will be in may, PyconFR in october 2019. I'm sure you will hear of it, just because I'll try my best with my friends from MixTeen.

stuck elbow
#

@lethal abyss where is it?

#

Lyon again?

lethal abyss
#

yep

#

no confirmation for pyconfrf but maybe Montpellier

#

but I clearly understand when you need to limit travels. it can be exhausting

tidal kiln
#

could we remove adafruit_circuitplayground from the bundle? it's frozen for the only board that could use it. ๐Ÿค”

pastel panther
#

hey @tidal kiln I unpack-ified all the getters and they seem to work

tidal kiln
#

@pastel panther awesome!

pastel panther
#

I have to get to work but tonight I'll do some testing and look at packing the setters

tidal kiln
#

excellent. thanks for keeping at it with this one.

pastel panther
#

thanks for your help. It's been somewhat frustrating at times but I've also learned a ton in the process so theres that. I found a section in "Making Embedded Systems" by Elicia White (of the Embedded podcast) that somewhat explains the "not really a float but kinda" encoding that they're using

#

I still don't know if there is a name for it or maybe it's some basic thing I'm not privy to

tidal kiln
#

i've learned too. this motivated me to really look at struct.unpack. i'll probably start using it now.

manic glacierBOT
pastel panther
#

the max vs LIS3DH is a good example of how the LSB/MSB >/< thing is used

#

or will be ๐Ÿ˜ƒ

tidal kiln
pastel panther
#

I think I saw that or maybe it was something else but yea, there is room for refactoring in most libs, even some of the arduino ones

tulip sleet
#

@tidal kiln could you file an issue in the bundle repo with your suggestion of removing adafruit_circuitplayground from the bundle? That sounds like a good idea.

Do you think it would also make sense to remove adafruit_crickit from the bundle, since there are builds (but not the only build) with that frozen in?

tidal kiln
#

@tulip sleet will do. was wondering about crickit also. can you think of a use case for having the non-frozen firmware and using the lib version? i can't.

tulip sleet
#

only reason is to try a newer version, or if you can't update firmware. But you can always add it to lib/ or / manually.

tidal kiln
tulip sleet
#

@tidal kiln - sure, maybe just add a comment, since your idea is new

meager fog
#

@tidal kiln heya i have an lsm9ds0 if you want i can test

tidal kiln
#

@meager fog ds0? or ds1?

meager fog
#

ds0

#

ds1 is tested and done right?

tidal kiln
#

ah. you merged the ds1 fix. yep. that's done.

#

nothing's been done to the ds0 lib yet though

#

SPI is way broken there, and nothing's been done yet. i only created an issue for it.

meager fog
#

ok i think you can copy n paste the ds1 code?

#

the chips are 95% same

tidal kiln
#

gotcha - then you'll test hw?

#

k, i can pr same fix real quick

meager fog
#

yeah

tidal kiln
stuck elbow
#

@lethal abyss well, Lyon is not so bad, I can get there by train

slender iron
#

@plucky flint I wasn't thinking talks so much as an extended time for the open space, lab style thing we did last year. I'd be happy to get others involved. The fpga stuff could be a good advanced topic once people do the easy stuff.

manic glacierBOT
#

Ah right. Are you planning on advertising that it runs CircuitPython? If so, having the mass storage device is part of what makes CircuitPython CircuitPython.

I'm surprised you had reliability issues with UF2. Its been rock solid for us. We're going to be moving further away from bossa because UF2 is easier.

Are you expecting people to hack their firmware themselves?

#

I think you can achieve this by calling play with the mixer after calling play on the mixer. It would look something like:

mixer.play(sample1)
# Occurs at the same playback time as sample1 because nothing is reading the mixers output
mixer.play(sample2)
audioout.play(mixer) # Starts playing the mixers output

This trick should also apply to a Mixer being played by a second mixer that is running "live". I haven't tested this though.

#

The project README right now reads "a firmware for (usually mechanical) keyboards, written in MicroPython and CircuitPython", which was my way of subtly tipping a hat to the great work Adafruit has done to make a platform to build this project on. It was a conscious word choice to go with written in rather than, perhaps, runnable with, to make it a bit more clear that while CircuitPython is shipped with only a ~20-some line ...

manic glacierBOT
#

Ya, at this point I just want clarification. I understand the desire to have the firmware fixed but I also really like how hackable CircuitPython makes something. (I made a CircuitPython keyboard myself)

I'd also love to have the board defined in the main repo here to make it official and to keep it up to date with us. So, I want to figure out what you need in here to make that work.

A couple ideas come to mind about reliability. First, require a specific ke...

manic glacierBOT
#

If the board you're referring to by the board defined in the main repo here is the MakerDiary NRF MDK, I planned on pull requesting that once I have the port even somewhat stable - I've been busy with a lot of other aspects of this project and left the branch in a pretty ugly WIP state. So far I'm treating it as an effective clone of the feather_nrf52840_express to great success (I don't know about that Feather since it's only been alluded to in source and in Discord, but my initial impre...

slender iron
#

@tulip sleet I wonder if omiting line number info from mpy files would help our memory issue

idle owl
#

@slender iron If you have time, I'd like to discuss your changes to the slideshow code

slender iron
#

@idle owl now is good for me. just finished lunch

idle owl
#

ok keen.

slender iron
#

how do you want to chat?

idle owl
#

vid works

tidal kiln
#

@prime flower did some simple edits directly on github to get MCP3xxx repo working with travis again and passing. did a review and have some requests. check the PR when you get a chance.

prime flower
#

@tidal kiln Thanks! I will look at it in a bit, finishing up radio work for the day.

valid kernel
#

Are there any low power options for the cpx? It occurred to me that I can use the light sensor to adjust the LED output (brightness), which should provide for a small percentage of power savings. Other than that...are there other options?

prime flower
#

@tidal kiln submitted a change

#

Would the SSD1306 circuitpython library work on a raspberry Pi running Blinka.. is there a way to use framebuf on it? (for the PiOLED)

idle owl
#

It's on PyPi but hasn't been tested.

slender iron
#

lots of cheater repos

idle owl
slender iron
#

yay!

tidal kiln
#

๐Ÿ™‹ 7/5

idle owl
#

Too bad it wasn't Hackugust, I would have had like 150/5 ๐Ÿ˜†

slender iron
#

๐Ÿ˜„

#

there is plenty of october left

idle owl
#

Yeah but I don't have literally all of our libraries left to put on PyPi.

#

I got my 5, I'm happy ๐Ÿ˜ƒ

tidal kiln
#

@prime flower looks good

manic glacierBOT
idle owl
tidal kiln
#

@idle owl looks good. also - tested and works good. ๐Ÿ‘

idle owl
#

thanks!

onyx hinge
#

@slender iron thanks as always for your swift attention to my PRs. You are awesome.

slender iron
#

haha, thanks for the PRs!

manic glacierBOT
idle owl
slender iron
#

ya, I can look

idle owl
#

Thanks.

manic glacierBOT
#

I also tried I2C, and also UART, and neither caused a problem. It seems to be SPI in particular. I looked at the code and I don't see anything obvious. I changed the HardFault_Handler() to hang (as it does in atmel-samd) instead of just returning and maybe I can catch the problem. Will report back.

The SoftDevice documentation describes how reserves a few peripherals for its own use (like TIMER0) or provides only a restricted API to a shared peripheral, but I don't see any conflicts.

manic glacierBOT
#

I think we'll need to enable MICROPY_PY_NETWORK and MICROPY_PY_WIZNET5K on a board-by-board basis in mpconfigboard.mk since the express builds with lots frozen in are failing. Any idea how much extra space it takes? Maybe we can get them to fit too.

metro_m4_express build without:

276436 bytes free in flash out of 499712 bytes ( 488.0 kb ).
180088 bytes free in ram for stack out of 196608 bytes ( 192.0 kb ).

metro_m4_express build with:

265492 bytes free in flash out of 499...

#

This is cumulative with already-merged #1262. In my pre-PR testing, it reduced "run" time from the 19m57s reported in that PR to 16m29s in this travis build, and also lowered the "total time" by about 3 minutes.

It also improves the comments in .travis.yml for the motivation for the organization of different jobs, and gives advice about where to add new boards and how to do a wholesale reorganization in the future.

manic glacierBOT
haughty bobcat
#

Is there a python library for the ST7789?

tulip sleet
#

but I don't know if anyone has tried the ST7789 as an ST7735.

teal bear
haughty bobcat
#

Iโ€™m just going to stick with ssd1306 screens.

stuck elbow
#

I plan to add st7789 support to it, but recently didn't have much time

haughty bobcat
#

Ok, thatโ€™s good!

river quest
#

@teal bear thanks

#

once the video is not-live i will post about this with a time-code URL so folks can go to the cpx section

teal bear
#

@river quest give me a few hours and I'll get you a link to a better quality vid and time of cpx start

idle owl
#

apparently we never added CAP1188 to the bundle, @tidal kiln ?

tidal kiln
#

๐Ÿค”

idle owl
#

also it never actually got deployed to PyPi

tidal kiln
#

๐Ÿค” ๐Ÿค”

idle owl
#

There's a thing Scott did last time this happened that I was going to do but I usually work inside the bundle and that's how I figured out it wasn't there.

#

The encryption failed to work properly. That's why it failed to deploy.

tidal kiln
#

for bundle - there's an adabot check, right?

idle owl
#

yep. But also I updated my local bundle and checked the closed PRs.

tidal kiln
#

i just did same. so just forgot. but at least there's a check.

#

i'll pr it for bundle

idle owl
#

um

upbeat plover
#

now that audio mixer is done, your you guys working on TFT yet?

idle owl
#

We'll need to retag the release when we do the fix, but that should be fine, it'll auto update

#

@upbeat plover Still finishing up some audio stuff I believe, then it's displaytime.

upbeat plover
#

okay, cool

#

audio mixer will be nice with hallowing

idle owl
#

And nice with It's Not Out Yet, Don't Ask. ๐Ÿ˜‰

upbeat plover
#

and slideshow

idle owl
#

Yah slideshow I just finished up. It went fancy pants.

river quest
#

@teal bear thanks! you can email pt@adafruit.com if i am not around with the infoz too

tidal kiln
#

@idle owl bundle pr'd

idle owl
#

link pls

raven canopy
idle owl
#

Presumably yes it's a cookiecutter issue since that was automatic.

gusty kiln
#

heh, whoops.

idle owl
#

@tidal kiln I need some help with Slideshow again. PT found a bug and I understand what the problem is, but I don't think I know how to fix it and I'm not sure we have time for me to be using this as a learning experience.

tidal kiln
#

ok. i'll try. what's the bug?
current code is in repo?

idle owl
#

yes. I was able to replicate it on the first try

tidal kiln
#

oh - i see the issue

idle owl
#

Oh hold on, he found another thing too

tidal kiln
#

the gh issue

idle owl
#

but I am certain they're related

#

he's making another issue

#

yah the issue on github

#

it's not handling the list math right

#

presumably.

#

because with two images, it only displays one on loop apparently

#

second issue just went in i think

#

I only tested it for the new thing I added, I should have more thoroughly tested the other changes.

#

@tidal kiln Scott says it sounds like he added an off by one error.

#

I'm seeing a few places that could exist but changing them isn't fixing anything

tidal kiln
#

maybe he can find/fix faster?

#

does sound like an off by one, could be for both

raven canopy
idle owl
#

@raven canopy ok, I've been fixing this intermittently all along, not sure why it didn't occur to me to mention it.

raven canopy
#

yeah, i recognized the fix from the last one i reviewed for you. and, i think i did it too when creating the FRAM lib.

idle owl
#

@slender iron Do you have a minute to help with the slideshow issue? I've tried changing something in all the places that look like they could be related and nothing is working. Either it works the same or it fails sooner.

#

I mean there's only so many places related to this issue in the code... you'd think one of them would work ๐Ÿ˜„

tidal kiln
idle owl
#

I just did something else and it fixed the two image version of the bug...

#

I did that!

#

it worked for you?

#

what I did doesn't fix the 1 image issue

#

Removing that -1 doesn't work for me....

#

Still getting IndexError without that -1

#

wait

#

I got it to work

#

three changes

#

testing with two images

#

ok it works

#

@tidal kiln I made three changes and now it works for me

tidal kiln
#

yep. and that... >=

                elif self._current_image >= image_count:
idle owl
#

ok that's what I ended up doing.

#

and I changed current_image in init

#

but talking to Scott now.

tidal kiln
#

@idle owl those two changes to the index range checking fixed both issues for me

idle owl
#

yah trying to figure out why my third change does what it does or doesn't do anything...

tidal kiln
#

the checks on self._current_image in advance will (should) take care of things, so your setting it to 0 in init is just doing the same thing, so has no apparent effect

idle owl
#

no, it does start with the second image, but I apparently couldn't tell or something

#

needs to be -1

tidal kiln
#

right, youre basically setting the start image

slender iron
#

@upbeat plover not quite to displayio yet. a couple more audio things to do

tidal kiln
#

@idle owl seems all fixed now?

idle owl
#

yah PR incoming

tidal kiln
#

ok. back to other things....

idle owl
#

@tidal kiln Thank you so much for your help.

tidal kiln
#

np. good job finding it. i was too slow and was just confirming.

idle owl
#

thanks ๐Ÿ˜Š

tidal kiln
#

change of imagename is just cosmetic?

idle owl
#

yes

#

it was bugging me ๐Ÿ˜„

tidal kiln
#

looks good. want me to merge?

idle owl
#

Yes please

solar whale
#

@idle owl Whew! I was trying to understand the impact of that name change...

idle owl
#

Simply that imagename is not a word.... I prefer being explicit.

tidal kiln
#

@idle owl done. you wanna close the issues.

idle owl
#

Yes!

solar whale
#

np - I just thought it was somehow related to the bug report...

idle owl
#

I mean I could have done two PRs..... ๐Ÿ˜„

#

Should have really if I'm doing it right

solar whale
#

Travis needs the work....

#

Doesn't Travis get paid by the PR ๐Ÿ˜‰

manic glacierBOT
gusty kiln
#

lookin'

idle owl
#

Thanks

gusty kiln
#

merged

idle owl
#

Thank you!!

#

grumbles invalid option "--api_key="

#

Hooray!

fierce oar
idle owl
#

Nothing went wrong, I don't think there is a code.py by default.

#

It doesn't ship with CircuitPython so I don't think there is a code.py when you start. We should be linking to 4.0a though maybe in that guide..?

#

There wasn't a CP version released yet that worked on it when we wrote that page.

tidal kiln
#

@fierce oar what @idle owl said. i think it ships with an ardunio sketch

fierce oar
#

oh, it was confusing to me because the process seemed the same as when I use Gemma and Trinket M0, but when I started Mu it said there was no Circuit Python device connected

idle owl
#

Hmm. That shouldn't have anything to do with the presence of a code.py - I think Mu should see the board regardless....

fierce oar
#

oh

#

hmm

idle owl
#

Maybe I'm wrong about that.

slender iron
#

what was the hallowing doing when you opened Mu? the eyeball?

fierce oar
#

no, it stopped doing the eyeball when i installed the UF2

tulip sleet
#

I think you may need to upgrade Mu to see the hallowing

slender iron
#

ah ok, so it did have circuitpython on it

fierce oar
#

i restarted mu and now it sees it

idle owl
#

Oh good call, @tulip sleet

fierce oar
#

just now

idle owl
#

Oh good!

fierce oar
#

yay!

tulip sleet
#

ok, great, mu 1.0.1 added more Adafruit boards

fierce oar
#

As a beginner, i was definitely a bit confused when the CIRCUITPY drive did not have the files I expected to see after having used the Gemma and Trinket M0 boards, maybe some note on the Hallowing Circuit Python page would be helpful

idle owl
#

So there is only demo code on boards that ship with CircuitPython. If you move to Arduino yourself and move back, your code may be deleted in that instance as well and then you would be presented with the same situation.

fierce oar
#

right, but every time i use a new Gemma/Trinket M0 i download the updated UF2 - and i guess as a beginner i dont fully understand what that is putting on my device

idle owl
#

The UF2 is only updating CircuitPython itself, it's not changing the code on the board.

fierce oar
#

so maybe there should be some explanation of what the UF2 is doing

#

ah - that is great to know!

idle owl
#

So if there was no code to begin with, you won't end up with any.

upbeat plover
#

i believe it writes to the atmel chip

idle owl
#

It begins to get complicated beyond that explanation, and it's different for Express boards vs. non-Express like Gemma/Trinket, so.... the simplest way to explain it is how I did.

#

The thing is, though, updating can sometimes delete the code too. Basically always backup your code because, and you may have run into this already, sometimes the board can get corrupted. But in general, all the UF2 does is update CP.

tidal kiln
#

and quite often, if you go from arduino back to CP, your code will show up again, but it depends on what you were doing in arduino

idle owl
#

I think there are a couple of things available on the Gemma downloads page that do have code in them, but that's special to the way Gemma/Trinket are designed and doesn't work on any of the other boards. And those aren't the normal updated UF2s, they're special downloads.

fierce oar
#

sorry again for my noob brain about these things, thanks for your patience while i'm learning: so the blinking eye code that the board shipped with was Arduino code

idle owl
#

@fierce oar No apologies! We're all learning!

#

Correct

fierce oar
#

but the board also had circuit python installed on it, but no circuit python code

idle owl
#

No, you installed CircuitPython when you put the UF2 on it.

upbeat plover
#

i think there is an example that will work for hallowing

import digitalio
from board import *
import time

led = digitalio.DigitalInOut(D13)
led.direction = digitalio.Direction.OUTPUT
while True:
    led.value = True
    time.sleep(0.1)
    led.value = False
    time.sleep(0.1)
fierce oar
#

oh - the hallowing doesnt have circuit python on it at all when it comes?

idle owl
#

Arduino and CircuitPython itself cannot coexist on a board.

#

Correct

fierce oar
#

ok so i have another super noob question

idle owl
#

do it up!

fierce oar
#

ok that was my super noob question ๐Ÿ˜ƒ

idle owl
#

๐Ÿ˜ƒ

#

It's not a super noob question!

#

The wrench in the concept is that Arduino and your CircuitPython FILES can coexist. But not CircuitPython itself. Your code is separate from CircuitPython.

#

So if there was a code.py on there from a previous install of CircuitPython, it may still be there when you reinstall CircuitPython. But they're shipped with Arduino initially, so no CP has been done.

upbeat plover
#

unless you used Arduino to write to the storage chip....

idle owl
#

That is why I used "may".

manic glacierBOT
#

The nrfx repo is a submodule both in circuitpython/ports/nrf/nrfx and also as submodule of tinyusb, in circuitpython/lib/tinyusb/hw/mcu/nordic/nrfxand . It should probably just be a submodule in one place, since if these get out of sync (different commits) there could be problems.

I'm kind of surprised we don't already have linking problems due to duplicate symbols. But perhaps there's no overlap of .o files or gcc or ld are being clever.

@hathach What do you think is the righ...

fierce oar
#

oh! omg did it say that and i totally missed it? or did you just add it?

idle owl
#

I just added it ๐Ÿ˜„

fierce oar
#

because that's perfect, just what i needed to know

#

thank you!

idle owl
#

๐Ÿ‘

fierce oar
#

ok yay! i am going to go play with my hallowing! trying to get it into my hackapumpkin project

idle owl
#

@fierce oar Have fun!

fierce oar
#

"play"... it's work, i promise!

tidal kiln
#

@fierce oar no worries. i've seen plenty of other people have issues with the general conceptual layout of things, CP firmware vs. CP code...and the general confusion it leads to. and further confounded by how arduino plays into things. the rub is i'm not sure how we can better explain it.

idle owl
#

Or where we can explain it that it will be in the place anyone is looking at any given point in time.

#

@fierce oar The number of times I've had to repeat "Yes, I am getting paid to do this project..." ๐Ÿ˜„

fierce oar
#

@tidal kiln i know, it's hard to explain these things, and you all do such amazing work with educating and helping people like me learn how to do these things! to be honest, the puppets really help! it's way easier to understand these concepts when they are visualized

#

thanks everyone for all your help, as always, you're amazing!

umbral dagger
#

Where do I grab the latest (for CP 4.0 alpha) mpy-cross

idle owl
#

It's still the 3.x-mpy-cross. It was entirely coincidence that the mpy-cross version numbers lined up with the CP version numbers for a bit there.

#

3.x is the most recent version.

umbral dagger
#

gotcha

tulip sleet
#

@slender iron I'm doing PulseOut. In the samd port, you turn the pulse chain on and off by flipping the pin mapping between the PWM periph output and GPIO (set to 0). For nrf I'm considering changing the duty cycle to zero instead. What was your reason for doing the GPIO thing -- speed?

#

or not to mess with the PWMOut's duty cycle?

slender iron
#

ya, I think so

#

been a while since I did it

tulip sleet
#

it is faster maybe, yes, i'll see which works out better. tnx

slender iron
#

np, sorry I'm not more helpful

tulip sleet
#

๐Ÿ˜ƒ that's fine!

fierce oar
#

i'm baaaaaack adabot

#

new question:

tulip sleet
#

you can't say "c-roach" because the bad word detector is very dumb

fierce oar
#

hmm my question got scrubbed for language?

#

oh haha it's the name of the tutorial! ok i'll try again

tulip sleet
#

anyway we see the deleted message in the moderator's channel

#

you need the special 4.0 alpha version of CircuitPython that has displayio support. There's a download link in the guide, I think.

#

green box on that page

#

(for others Q was where is displayio?)

fierce oar
#

oh that is what i downloaded

#

hmm

tulip sleet
#

i'll try it

fierce oar
#

i just re-downloaded and installed again, and still getting same error

tulip sleet
#

yeah, me too, that's a 3.x version, we need the 4.0 version. let me find it

fierce oar
#

oh thank you!

tulip sleet
fierce oar
#

hey thanks so much @tulip sleet !

tulip sleet
#

i'm fixing the guide to point to the right place

fierce oar
#

that's awesome, thank you

tidal kiln
#

why not grab from repo?

manic glacierBOT
#

(Please note that there is absolutely no urgency behind this request - I happened to notice it while porting over some python code, and thought it might be helpful for others...)

When creating a new namedtuple class via the 'collections.namedtuple' factory function, CPython allows the 'field_names' argument to be a string containing whitespace and/or comma-delimited names, e.g.

from collections import namedtuple
foo = namedtuple('foo', 'a b')

However, in CircuitPython (and possi...

tulip sleet
#

@tidal kiln I'm going to change the links, not sure why the original Hallowing guide has a special download, and the TFT-using guides have another special link.

tidal kiln
#

maybe guide was before alpha releases were available?

tulip sleet
#

maybe, but I'm going to look at the commit and see whether it's before or after the latest alpha. The base hallowing guide points to a 3.x release, which should point to the regular github place

fierce oar
#

I've got a new error, "AttributeError: 'module' object has no attribute 'D4'" - is that the JST port on the Hallowing labeled NeoPix?

tulip sleet
#

checking...

fierce oar
#

into the NeoPix port

tulip sleet
#

yes, use board.NEOPIXEL for now. I think there's a newer version that might have D4 defined.

fierce oar
#

Sweet! Thanks Dan, it's totally working now!

tulip sleet
#

with the link I just gave you or with EXTERNAL NEOPIXEL?

#

if you haven't downloaded the alpha.1, could you verify it works with that? I'll change the guide link.

slender iron
#

@errant grail ping me when you are around I have a test build that preconditions the m0 dac

fierce oar
#

oops i spoke too soon - the code is working without errors, the sound, motion sensor, and tft are working, but the servo is not moving

#

oh didnt see your link,

#

let me try that

tulip sleet
#

try the alpha.1.uf2 and change it back to board.D4

fierce oar
#

ok one sec

manic glacierBOT
#

It is possible to get that by enabling the MICROPY_CPYTHON_COMPAT config option when building CircuitPython. The problem is that this costs about 750 bytes of flash memory and thus won't fit on many of the boards which have several libraries frozen into the firmware.
I have proposed to add it for the M4 boards, which have much more flash, in #1167.

fierce oar
#

yep, that did it

#

all good now! thanks so much @tulip sleet ๐Ÿ‘

tulip sleet
#

ok, great!! thanks for being the guinea pig -- I really appreciate it. I will update all the guides. They were written before we had these versions as releases.

fierce oar
#

oh thank YOU so much for your patience and help! i'm glad to be the guinea pig anytime ๐Ÿ˜ƒ I learned a ton from this process and i'm stoked to get this into my hackapumpkin

slender iron
#

will do m4 after I go get outside

raven canopy
#

@idle owl is slideshow -> bundle PR still good? making sure there isn't another release before merge...

tulip sleet
#

@raven canopy kattni is away for the evening

raven canopy
#

alrighty. merge it is. ๐Ÿ˜†

#

thanks @tulip sleet

manic glacierBOT
manic glacierBOT
#

Sure, we can literally just remove the python API parts in shared-
bindings and the shared-module part will still work as normal.
Personally I think we'd be better off having the network device classes
all neatly under module network as per MicroPython, but it's your call.
It's an area where there is no CPython API to follow so I think it makes
sense for MicroPython and CircuitPython to stay the same.

torn grail
#

Does anyone know where to get the pin mapping for boards? I'm trying to figure out the pins for the Raspberry Pi. The python script says this, but that doesn't help me since I don't know which pins D5 and D6 are on the GPIO pin. Thanks!
RESET = digitalio.DigitalInOut(board.D6)

#

This is related to getting the RFM69HCW breakout to work on a RaspberryPi running CircuitPython

errant grail
#

@slender iron I'll be back around 6:30pm PDT tonight and will set up for a test or two with the M0. Will the changes also work on I2S?

raven canopy
torn grail
#

Its hard to find a BCM-GPIO-PHYSICAL port map anywhere. Do you know where one might exist? Clearly, I never use BCM, I always use GPIO> LOL

#

And, yeah, been hiding. ๐Ÿ˜„

raven canopy
#

GPIO is usually synonymous with the BCM pinout...i think. but, this is my old reference (haven't RPi'd in some time): https://pinout.xyz/#

The comprehensive Add-on boards & GPIO Pinout guide for the Raspberry Pi

torn grail
#

Ok, let me see if BCM number appears to line up with D# in boards... Thanks!

raven canopy
#

yw!

torn grail
#

Do you think I can use CE0 and CE1?

#

I guess thats BCM8 and BCM7

raven canopy
#

looks like you could use either (per Blinka/pin.py). CE# are defined, as well as D7/8 (BCM).

torn grail
#

Yeah, I don't think that is it...

#

$ python3 ./SimpleTest.py
Traceback (most recent call last):
File "./SimpleTest.py", line 30, in <module>
rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
File "/home/pi/.local/lib/python3.5/site-packages/adafruit_rfm69.py", line 306, in init
raise RuntimeError('Failed to find RFM69 with expected version, check wiring!')
RuntimeError: Failed to find RFM69 with expected version, check wiring!

tidal kiln
#

oh wait. that was already linked.

torn grail
#

blinkatest seems to be fine with the BCM pins

tidal kiln
#

yep, use BCM

torn grail
#

There must be something "funny" with the RFM69 libraries.

raven canopy
#

@torn grail try adjusting the baudrate. iirc, it could be picky...

torn grail
#

TypeError: init() got an unexpected keyword argument 'baudrate'

solar whale
#

@torn grail you cannot use CE0 or CE1 with Blinka. Use any other GPIO pin for CS

torn grail
#

I added it to the rfm = (... baudrate=1000000)

#

no, I mean this: TypeError: init() got an unexpected keyword argument 'baudrate'

#

omg -- not the right paste buffer.

#

Initialize SPI bus.

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO, baudrate=1000000)

#

So, it appears to NOT be a baudrate issue. Its related to CE0. I swapped to D23 and now the error is gone! Thanks, Jerryn

solar whale
#

There is a note about it in the Blinka guide. CEs are used internally.

slender iron
#

@errant grail they won't work on i2s as written. I don't think I saw the issue when I was doing i2s. Have you seen it?

errant grail
#

Those are bursts of 440Hz sine waves, if I recall.

raven canopy
#

thanks @solar whale for correcting my bad advice! ๐Ÿ˜‰

slender iron
#

@errant grail what i2s dac?

errant grail
#

UDA1334

slender iron
#

kk

#

I won't do it in this PR but we can later

errant grail
#

It should respond similarly as the built-in DAC, I believe. There's something about it accepting signed values that may be a complication, but I don't recall the particulars.

slender iron
#

k

#

now I understand why signed is much nicer for audio

errant grail
#

Yes, I would really prefer the signed -1.0 to +1.0 approach for audio data values, although I understand the need to refer to DAC outputs as positive integers for other applications. It's especially confusing when you realize that the value 65535 actually produces a DAC output of only 65520 since the current DACs are 12-bit, not 16-bit.

slender iron
#

ah ya

errant grail
#

... except the i2s DAC. I believe it's 16-bit. (It's been a couple of months since I thought about this...)

#

Going AFK for a bit but will be back after dinner to test the M0 DAC. Where can I get the "ready-to-go" testable audioio library? (pardon my GitHub naivety)

slender iron
#

I can send you a build. messing with m4 now. I can't read back the current value ๐Ÿ˜ฆ

meager fog
#

@umbral dagger hey for my entertainment, can you try the waveform generator on a feather m0?

#

does it work or crash?

#

(or run out of memory)

errant grail
slender iron
#

what board?

errant grail
#

M0 Express. Using two byte arrays, 440Hz sine wave and an array with all zeros.

slender iron
#

k, I don't really handle the between samples

#

it will ramp up at the start to the default_value given in the constructor

#

and back down at the end

errant grail
#

What's the syntax?

slender iron
#

it should be drop in

#

so just try the same file

errant grail
#

sorry, I mean for the default_value setting

slender iron
#

default_value defaults to 0x8000

#

AudioOut(...... default_value=<whatever>)

errant grail
#

Don't see a difference. I'll drop the all zeros array to see if I can spot the ramp.

slender iron
#

it only happens on construction, not between samples

#

I use a second pin to trigger my capture

errant grail
#

Ah, got it. So the pop will happen on the second play?

slender iron
#

ya, as it is now between samples isn't done

errant grail
#

kk

#

I'll look at the construction portion.

slender iron
#

because sample values go through dma where I'm currently managing the ramp in the audioout contructor

errant grail
#

and there it is!

#

Nice! 50ms and a little change.

slender iron
#

ya, its actually based on start and end values

#

so shorter gaps will take less time

errant grail
#

... as it should be. I'm impressed

#

Next test is to run it past my ears...

slender iron
#

๐Ÿ˜ƒ

#

I've gotta stop for the night

#

the m4 is proving trickier

errant grail
#

OK. I'll let you know what my ears say.

slender iron
#

k thanks!

#

I can tweak the slope easily

errant grail
#

A marked difference @slender iron . Very acceptable. The ears are liking the change.

#

It's interesting that after ctrl-C to stop the code that the DAC eventually settles to a zero value over the course of about 10 sec. Didn't realize that was a feature.

errant grail
manic glacierBOT
subtle dirge
#

hey all! this is sonny from codecademy. after i do device.transferOut(2, blah)

#

(webusb api) is there a way to save that in the device

slender iron
#

@errant grail it should have done a reverse ramp down

manic glacierBOT
manic glacierBOT
#

Please add a simple method for direct memory access to circuitpython.

Micropython has the machine.mem8/16/32 object, to access the memory directly.
Example: machine.mem32[0x50000748]=0x703

There are many situation where you want to access the memory, especially the registers, directly.
May it be speed, or because you need a special feature, that the driver/hal doesn't support.

It is possible to use @micropython.viper, and use pointers to access the memory, but I don't know what the...

pastel panther
#

@tidal kiln I think I'm really done this time. I skipped packing the writes for now at least but I got everything else over to unpack, cleaned up some stuff and added another example that I used for another freezer run

#

@slender iron doing some late night hacking?

#

aaaand he's gone

manic glacierBOT
teal bear
manic glacierBOT
indigo wedge
#

this is rather strange cause like 2 months ago i ran spi and ble at the same time on nrf52840 and that worked

#

that was on SD 6.0

solar whale
#

@indigo wedge Did you actually access the SPI device while BLE was active -- Even now I can run a BLE scan with my SPI SDCard mounted but it is not actively accessing the Card wile scanning.

indigo wedge
#

hmm, it was running a screen but maybe not actively drawing on it so I guess not

solar whale
#

I just mounted the sdcard then ran a BLE scan ok but on next access to the SDCard, it reset!! even though the BLE scan was completed.

indigo wedge
#

hmm

#

but i think i did screen stuff after running ble

#

I might have a look at that too soon because in the current thing I'm working on I want to use SPI and BLE also. I know I've been saying it for a few months now, but I need to finish my BLE stuff >_<

#

Now I have a deadline on it for myself for next month so no excuses

#

I've been a bit busy recently ๐Ÿ˜„

solar whale
#

Life does happen ๐Ÿ˜‰

indigo wedge
#

^ nRF52840 running CircuitPython

solar whale
#

nice!

indigo wedge
#

it uses spi for the screen and has BLE but I haven't tested BLE yet

haughty bobcat
#

@indigo wedge That's really cool!

solar whale
#

hmmm -- I disabled SPIM3 in nrfx_config.h and I can now run BLE_ADV and mount the SPI SD Card.... still checking a few things

manic glacierBOT
tidal kiln
idle owl
#

@tidal kiln Don't know, don't think so. I'll grab that PR in a bit. Thanks for catching it.

tulip sleet
tidal kiln
#

@idle owl wasn't me. thank @raven canopy

manic glacierBOT
#

(This is a very minor quality-of-life issue...)

When calculating a result or debugging a module in the REPL, a 'small int overflow' OverflowError does not provide a traceback.

For example:
>>> 1024*1024*1024
OverflowError: small int overflow

Of course, in the example above it's obvious where the problem lies, but consider debugging a program like the following:
# ovrflw.py
CONST_1 = 5.9
# ...
# (skip several lines of constants and comments and code and...)
# ...
...

solar whale
#

@tidal kiln sorry about the barrage of comment re:lsm303 ... sort of a stream of consciousness. Let me know if it makes any sense. Bottom line is I think the mag is off factor of 16

tidal kiln
#

@solar whale no prob. i don't have one, otherwise i'd investigate. should be fairly easy to sleuth out by looking at the actual bits. i've also asked internally - someones obviously dealt with this before.

gusty kiln
#

@tidal kiln @solar whale for what it's worth, i do have an lsm303 here, but reading that PR i'm kinda over my head.

solar whale
#

can you do a magnetometer reading via CP and via arduino and compare the results? Do you get similar field magnitudes?

gusty kiln
#

yeah, lemme see what i can come up with.

solar whale
#

no rush - thanks

tidal kiln
#

keep in mind the YZ's will be swapped between the two drivers, that's the bug that's being fixed, so just look at general magnitude of values

gusty kiln
#

right, gotcha.

tidal kiln
#

if it's there, it'll be a factor of 16

slender iron
#

@pastel panther I was asleep. Maybe my laptop woke up for some reason

pastel panther
#

hmmm... robots are making their move?! ๐Ÿค–

slender iron
#

maybe ๐Ÿ˜ƒ

idle owl
#

@tidal kiln Why are there 11 other files in that PR? It's like it's trying to add all the submodule files as well, that doesn't seem right.

slender iron
#

@idle owl I agree it doesn't look right

idle owl
#

Change request added.

tidal kiln
#

not sure..looking...

gusty kiln
#

added some test values for lsm303 to that PR.

tidal kiln
#

@gusty kiln thanks

solar whale
#

@gusty kiln @tidal kiln thanks! -- looks like a factor of 16

gusty kiln
#

lemme know if you need anything else / confirmation of changes once made.