#circuitpython-dev
1 messages ยท Page 201 of 1
Does this still happen with 3.0.2? Thanks!
chan = DifferentialAnalogIn(mcp, MCP3008.pin_0, MCP3008.pin_1)
vs.
chan = adc[(0, 1)]
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
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
ya, sorry about that. its my failure having them different
no worries. important thing is to get them consistent.
totally, thanks!
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
kk, I'll dismiss my review
cool. i've added myself for a review.
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
hmm. how's that work...any way to take over a PR?
you can probably edit directly or create your own branch and pr
is following this
so it would end up as another PR, from my own branch
@notro I'm skeptical the pull up will actually work. Feel free to try it though.
@jerryneedell Is this done?
@prime flower is that an option for you?
@ubiquitousthey Does the 4.0.0 alpha work for you? Its been updated from MicroPython.
The network module maintains a registry of nics, and when you configure a nic (eg: construct it with wiznet.WIZNET5K()) it calls network_module_register_nic to add that nic to the list. When you call socket.socket() it calls network_module_find_nic to find an appropriate nic for this socket.
This functionality could be merged into the socket module I suppose.
@PTS93 What specifically did you want added? Are you still interested in working on it?
Looks like it can be handled upstream.
pretty sure this will help with the depth, although it seems like it's likely time consuming due to the number of submodules. You could potentially clone them in parallel, or perhaps utilize travis's caching features.
Yeah, they're all set together. It'd make sense for these to be kwargs I agree, it does make the code more readable.
I tried this but ran into an issue where it also implies the master branch. When I tried it we were using a non-master branch of tinyusb and it failed. Lets let travis run and see now. :-)
@caternuson are they the same now?
@tidal kiln I'll be around to help finish it and review if that works for you?
@dhalbert Do you still want this or can we close?
Sounds good.
@slender iron did you have to re-export cp to add the device name changing feature?
@marble hornet what do you mean re-export?
compile** sorry
nope, it should be in there. I did run into a bug with it though
its in the issue
np
I have 4 alpha
4 a 1 ? or 4 a?
Made this long term since its a new API.
1 ish
oh it is working now! but on 3 !!!
but i flashed 4a1 then 302
๐คท why
thanks!
Frankly, I would like it, to match seesaw's PWMOut. I see it more like different units, like fahrenheit and Celsius, or miles and kilometers, not as two different ways to do the same thing.
now has back catalog
Don't think so. But am I looking in the right place?
write:
https://github.com/adafruit/circuitpython/blob/master/shared-bindings/bitbangio/SPI.c#L198
readinto:
https://github.com/adafruit/circuitpython/blob/master/shared-bindings/bitbangio/SPI.c#L223
no entry for frequency:
https://github.com/adafruit/circuitpython/blob/master/shared-bindings/bitbangio/SPI.c#L313
why did travis stop running for this?
https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx/pull/4
what's the travis url?
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.
where's that message at?
in the build log, line 567
also, the .travis.yml install: action is weird. It should have pip install -r requirements.txt instead of that long list. See https://github.com/adafruit/Adafruit_CircuitPython_MPRLS/blob/master/.travis.yml#L24 as an example
the linting also didn't pass
yeah, it's not installing the right version of pylint either. The .travis.yml doesn't appear to be current practice in several ways.
the PR version seems better maybe?
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
but it's not even showing a failed indication, at least not that i can see
i know, that's confusing, where's the travis integration line in the PR conversation?
i don't see it
but if you look at the commits, it was running (and failing), and then passed, and then stopped running
that build is from a month ago??
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
maybe this library has the wrong travis owner??
i can't remember where that's set (or if i'm confused)
yah, i'm not sure what/where to check either
@tidal kiln it's not hooked up to rtd, but the travis hookup looks ok.
yep. nothings jumping out at me either.
it's really weird, the other PR has a failed travis check, but this one doesn't
on travis page, go to the "More options" drop down on right and select "Requests"
Could not parse .travis.yml
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?
yes. awesome. thanks.
In the next 2-3 months I probably wont find the time. I still have to get into upy development which will probably be a hurdle for a quick weekend patching.
I wanted to expose all the functions that the class exposes. Though the features I wanted most were oversampling and setting the resistance.
Hi,
This is work in progress and before continuing i would like to get your opinion @carlosperate, about the translation of some words.
Translated it as:
a la funciรณn le hacen falta %d argumentos posicionales requeridos
Translated as:
la fu...
hmm, this issue has diverged a bit. i was referring to supporting the low cost nrf24 modules that are so popular with makers, not native nrf24l01 support in nrf52 - that seems like it would be a different project altogether :)
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? ๐
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 ...
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...
Well, my suggestion would be to write a driver for nrf24l01, that uses external modules by default, but switches to the internal rf on microcontrollers that support it.
Other drivers also use hardwired functions when available, but switch to bitbanging when not.
Fixed missing newlines and ready to merge.
Maybe the diff could improve by improving the regex, but I think that the check-translate script should me more informative because it's easy to miss one line in 500+ msgids
... in MicroPython, the network module also collects all the network device classes in one place (they're not all compiled in, you can control that with various MICROPY_PY_WHATEVER flags)
I've split WIZNET5K out into its own 'wiznet' module, but I'm not sure that once we have a few of these we wouldn't be better collecting them into 'network' after all ...
(note that while the docs build, they're not actually filled in yet. Also, we need to exclude the smallest M0 boards from using this option ... not sure how you want to handle that.
@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.
no worries. i should've checked sooner also. sorry this is dragging out.
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
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
aaaah yes, of course
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
right
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
right, I mentioned above that the register fn might want to change
oh. yep. that would be the other approach.
return the byte buffer, instead of shifting / or'ing it into a value
ya
the LIS3DH does that
that was my model for the 345
ok. sounds like you're on it.
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
that could be another approach
i haven't used that module myself yet
there was some talk about it in the meeting
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
yep
<@&356864093652516868> I wonder if we should think about something for this at circuitpython: https://us.pycon.org/2019/hatchery/
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...
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.
@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.
@tough flax can't answer those questions. sry. but wondering if you saw my PR to airtalker?
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.
ยฏ_(ใ)_/ยฏ
can be done various ways. i'm not sure i've seen what scott's changes are. anyway to share current state of code?
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.
So I noticed CircuitPython 4.0 has more display features. How long until we can control an OLED display? Or is this already possible?
Scott's original: https://gist.github.com/tannewt/2c898283d8566bb8fe2f264fc9c3ef47
Current lib: https://gist.github.com/kattni/15490595362978e039f335ebcf5834f8
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()
@haughty bobcat it depends on when I get back to it. I've got some audio work to do first
@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
ah
we have image display working for the hallowing but nowhere else
@idle owl is the idea to change the target max brightness with the touches? so that it will fade in to that new setting?
because the hallowing inits the display at boot instead of from python
@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
https://learn.adafruit.com/micropython-hardware-ssd1306-oled-display/tdicola-hardware
I did find this guide, I was unaware of this.
@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.
@tough flax the runtime object is for the single vm rum while the module level stuff has a longer impact
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
@slender iron any idea on where Mu pulls its autocomplete from?
nope
@tidal kiln I appreciate the work on the config stuff... but... ๐
That's not how I want it to work ๐
@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
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
is there a reason why continuing to use the existing config files is needed?
If you'd like to take a stab at that, I'd LOVE the help ๐ I just added a sample config file
could we do a one time translation to get that info into a new format, and then use the new format going forward?
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
I've pushed to not have different units for the same reason. I'd rather write use-case specific wrappers that expose it as a value 0-1.0 similar to Servo and ContinuousServo.
I put the 8 dicts in a config file just to see if we can get the timing we need (we can)
string parsing is easy with python too
at config-time it is - at runtime, it'll kill our performance
sure, just load it at the start and store it in memory
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
I missed all Tony DiCola's amazing circuitpython hardware guides...
I like his stuff. Very well documented.
beware they may be out of date
Yeah I see some micropython here and there
@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
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
So when my Circuitypthon board is printing to serial how do I use REPL in mu?
(@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
@haughty bobcat not sure what you mean
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 ok. later then.
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.
@haughty bobcat I don't think there is a way to print stuff and listen for inputs at the same time
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
@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
the way I deal with it right now is adding a rogue space so my code doesn't run
you can use input in your code to read from the serial
@tidal kiln I think I did it....
you can also ctrl-c to stop your code
But it doesn't update until you change the image
Also I am pretty sure the way I did it is bad.
using that code from above?
No let me update what I did.
ok. cause i don't see how that does anything to the class variable.
I don't entirely know what you mean but I moved stuff around and added things to make it work
I'm going to close this issue for now because the outcome isn't super clear. I think its very driven by what you need @PTS93 so you should make a PR when you get to it. Thanks!
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.
yep. that won't update until you change the image.
What are you doing that needs to control exactly what runs each time? Are you using the mass storage device for anything then?
scott's was effectively the same. pressing forward/backward was equivalent to calling update
except it changed brightness on the current photo
so I need to figure out where to put things to make that happen
ok. i see that now...hmm...ok. slowly getting to what you're trying to do....
maybe. still have the thought turkey in the oven....
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
internally you are representing brightness as a duty cycle value
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
This is the protocol the micro:bit uses according to @uhrheber. It'd be awesome to be able to talk with them.
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
I'm confused
if I did what you're suggesting, it's not working. So I did it wrong presumably.
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
Nordic's legacy protocol support that is commonly used with the inexpensive modules of the same name. The nRF52840 can also speak the same protocol.
Ok, this issue will be for a driver of external nRF24 devices.
For the internal ones we have separate issues:
- OpenThread #1162
- Gazelle #1257
- nRF24l01 #1258
I guess? I feel like I do but that doesn't mean I do
that's the general approach for how it works. not new. it's always been doing this.
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...
ok
right
so it needs to not be _MAX_BRIGHTNESS anymore is what you're saying because it's changing
correct
ok updated that
but the important bit that was missing before was an update to the PWM output while the image was being shown
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)
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
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
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)
ok then what needs to happen to make it work...
Oh....
Because the _current_state is _WAIT because it's not in autoadvance.
in your gist you have self.current_brightness = self._MAX_BRIGHTNESS
above you have self._current_backlight_level
yah I changed what things were called, it didn't make sense how I had it.
what handles _WAIT?
oh. that gets called from the code. ok.
I printed current_state in code.py and realised it was in _WAIT, not _SHOW_IMG because it's not in autoadvance mode.
which sets state to _FADE_OUT
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
ah. fading is turn off-able now.
Yes.
this thing is getting fancy pantsy
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.
cool. i guess the other thing to consider it if you want to @property the brightness control.
sounds like a simple syntax issue
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.
Found this (and fixed the name in the issue name/subject):
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v9.0.0%2Fgzll_02_user_guide.html
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()
um hmm.
it's happy at the moment....
with them being properties. and not under __init__ anymore.
did you @property the two funcs backlight_level_up and backlight_level_down?
yes
it's functional, but not really how it was intended
hmm.
I thought it would make the code easier to deal with if all the math was handled in the lib.
good point. there may be a way to do both.
why do both?
options?
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.
if you want to leave it as those two funcs, go back to having them as funcs
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.
mainly just provides a different syntax to the user
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.
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()
ok
could make it a little fancier by having an optional step argument:
def backlight_level_up(self, step=16):
but, also not absolutely necessary. wasn't done in original code.
https://gist.github.com/tannewt/2c898283d8566bb8fe2f264fc9c3ef47#file-code-py-L49
Ah interesting! I'd happily merge PRs that align our behavior with C python. Its not on the top of my list of work to do though.
I think network is the way to go. I don't want extra stuff in socket.
Is it useful from Python though? Maybe it should be an internal only concept for now.
@tidal kiln Na I like it. I'll add it.
kind of combined the options you were looking for.
cool. yep. with the default being that magic 16 everyone seems to like.
struggling to describe the parameter for the docstring though.
Here's the same description for the 15.2 SDK (seems to be more detailed):
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgzll_02_user_guide.html&cp=4_0_0_5_2
amount by which current brightness will be increased/decreased, in units of..??PWM things
๐ Obviously the design guide should be updated with that unit. PWM things
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.
doesn't really have units:
https://circuitpython.readthedocs.io/en/3.x/shared-bindings/pulseio/PWMOut.html#pulseio.PWMOut.duty_cycle
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...
that's fine.
ok good
I agree it will be a bit smaller than configured but that should be ok. No data is actively loaded with that length. It should all be based on self->len.
The voices aren't meant to be in sync, just overlap. When do you think that would be useful?
I renamed stop to stop_voice so we can add stop later if we want to stop everything at once.
Example: I record an instrumental and a voice part as separate tracks. Sometimes I want to play them together, in sync, to hear both parts. Sometimes I want to play just the instrumental or the voice, so I can practice the missing part.
Do you mean it's just a working buffer?
If I have several synth voices that I've generated, I want to make sure they play in phase.
@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
@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.
Ok great!
I'll try to play with it more -- will have more time tomorrow.
Ok, if you find anything, make an issue on the repo since I think we'll have it merged today for the initial release.
Great! Congratulations -- It'll be great to have.
@tidal kiln Can you review it again for me if you have a moment?
looks like you're green on travis. review now?
yes please ๐
Would you mind filing an issue for this? I don't think it needs to be done now. Let's just make sure we can expand these APIs to do it.
@idle owl done
oi! Good catches!
Yeah, len is the length of the buffers we output and we don't assume our source buffers are the same. Its an argument so one can tune how much memory the mixer takes.
@slender iron Do you want to review it as well?
the slideshow stuff?
yeah
sure
np!
@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
i'll let @slender iron answer that. sounds like you're wanting to PR to the main CP repo.
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?
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?
@tough flax That's not a stupid question. rebase is crazy magic. Your upstream should be adafruit/circuitpython I believe.
I will as soon as Iโm not driving
I haven't made the PR yet (I wanted to rebase first and do a build)
Perhaps I'm missing a fetch?
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
Ugh: WslRegisterDistribution failed with error: 0x800703fa
Error: 0x800703fa Illegal operation attempted on a registry key that has been marked for deletion.
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.
Per request moved this to supervisor.runtime...
Implemented on atsamd and nrf ports (only tested on atsamd).
This is just a simple attribute that can be tested before calling input()
if(supervisor.runtime.serial_bytes_available):
value = input()
Here's the previous PR which now has my new changes
@tough flax the PR update looks like it worked. it's the same PR, just now with some newer commits.
How do I get the automated build to run again?
it should happen automatically when you push your latest commits
you can see the little green check marks
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
yep. i'll leave that up to dan/scott. they were on the discussion, so will get a notice that things were updated.
@idle owl i signed off on slideshow
@tidal kiln Thanks! Scott's taking it on so we'll be making some changes.
@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.
sounds good. I'll be around tomorrow
Please add a comment like the one above to document this new attribute. It starts with //| .. attribute:: runtime.serial_connected
Will do. I need an hour to settle things diwn
np @tough flax
Rework of PWMOut:
- handle variable frequency
- piggyback on existing PWM if same frequency
Tested on PCA10056 with a Saleae.
Also fix an SPI bug that manifests only when compiled with DEBUG.
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.
Will this cause an output blip? Can we disable based on PSEL instead?
@tannewt sorry it took you closing that old issue #637 before I looked at this. How's this text look?
@slender iron question if you've got time to look...
any reason to have these spi configs done each time in the read/writes, ex:
https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1/blob/master/adafruit_lsm9ds1.py#L419
vs. just doing it once when creating the SPIDevice in __init__?
Good point. The datasheet recommends disabling, but I tried it without the disable, and it works fine.
@tidal kiln I think spidevice does it for you
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?
ok. thanks. just wanted a quick sanity check.
I spent some time on this, but didn't discover the root cause. I tried other pins, including ones that are definitely marked as safe for high-speed I/O. It seems like there's reset when the SPI write is attempted. Nothing appears on the SPI pions.
Since it does not occur on the nrf52832, It could be related to the s140 SD or something in the nrf52840 code. Both are differences.
@tulip sleet fyi- did you know about micropython support for nrf? https://github.com/micropython/micropython/tree/master/ports/nrf
I have added the documentation as requested and pushed it to my fork - hopefully that's all that's needed (still figuring out this process)
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...
If there's anything else you need from me let me know asap - I'm headed to NYC for my 20th anniversary :-)
@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.
I made one tweak to the location and will merge after travis gives the ok.
b61214d added timeout to input() - ATMakersBill
bc0a135 replacing change to input() with separate metho... - ATMakersBill
9f94712 replacing change to input() with separate metho... - ATMakersBill
05d4b8c Added Documentation for the serial_bytes_availa... - ATMakersBill
0688709 Move the docs next to the implementation - tannewt
@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! ๐
sometimes Discord does not help to follow discussions. I'm enable to find the source of @plucky flint enthusiasm ๐
@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.]
I won't be able to finance trip to pyconUS, but some ideas could be borrowed to start again an Education track at PyconFR
@lethal abyss when is that?
@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?
@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
@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.
yep
no confirmation for pyconfrf but maybe Montpellier
but I clearly understand when you need to limit travels. it can be exhausting
could we remove adafruit_circuitplayground from the bundle? it's frozen for the only board that could use it. ๐ค
hey @tidal kiln I unpack-ified all the getters and they seem to work
@pastel panther awesome!
I have to get to work but tonight I'll do some testing and look at packing the setters
excellent. thanks for keeping at it with this one.
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
i've learned too. this motivated me to really look at struct.unpack. i'll probably start using it now.
the max vs LIS3DH is a good example of how the LSB/MSB >/< thing is used
or will be ๐
i came across this yesterday while updating this lib:
https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1/blob/master/adafruit_lsm9ds1.py#L140
so, hey, other people have rolled their own with << also
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
@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?
@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.
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.
@tulip sleet on second thought, may not be worth a new issue. it's related enough to this one:
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/93
and resolving that would address it as well.
@tidal kiln - sure, maybe just add a comment, since your idea is new
@tidal kiln heya i have an lsm9ds0 if you want i can test
@meager fog ds0? or ds1?
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.
yeah
@meager fog there yah go:
https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS0/pull/11
@lethal abyss well, Lyon is not so bad, I can get there by train
@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.
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 ...
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...
Woohoo! This is exactly what I was thinking. Next we can focus on speeding up the build times.
Rosie should work if its alive but I don't think it is at the moment.
Perhaps testing that the build breaks would be good? Just break it in a commit on another branch and make sure Travis fails.
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...
@tulip sleet I wonder if omiting line number info from mpy files would help our memory issue
@slender iron If you have time, I'd like to discuss your changes to the slideshow code
@idle owl now is good for me. just finished lunch
ok keen.
how do you want to chat?
vid works
@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.
@tidal kiln Thanks! I will look at it in a bit, finishing up radio work for the day.
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?
@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)
It's on PyPi but hasn't been tested.
lots of cheater repos
yay!
๐ 7/5
Too bad it wasn't Hackugust, I would have had like 150/5 ๐
Yeah but I don't have literally all of our libraries left to put on PyPi.
I got my 5, I'm happy ๐
@prime flower looks good
Don't merge this pull request! It exists just to check that the changes for #1262 will correctly show up as an error in travis and in a PR.
https://travis-ci.org/jepler/circuitpython/builds/439882440 shows a failing build. The failures took 4m4s with a total time of 11m37s. I don't have a comparison for failed builds before this change, but it likely took longer.
@raven canopy if you want to finish up your review, a lot has changed. @tidal kiln if you want to give it a look over to make sure Scott and I didn't miss anything. https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/pull/1
@idle owl looks good. also - tested and works good. ๐
thanks!
@slender iron thanks as always for your swift attention to my PRs. You are awesome.
haha, thanks for the PRs!
just for fun - I tried accessing an I2C device while BLE was active on a PCA10059 Dongle and it eorked fine.
@slender iron Do you want give the PR another look and merge it if you're happy with it? Enough has changed I don't think @raven canopy's review really applies anymore and he's not around to deal with it anyway (which is totally fine!). https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/pull/1
ya, I can look
Thanks.
Yeah, in MicroPython it exposes the nic classes. In CircuitPython all it has left is 'network.route' which lets you enumerate all the configured nics, eg:
>>> network.route()[0].ifconfig()
('10.107.1.123', '255.255.255.0', '10.107.1.1', '0.0.0.0')
not necessarily very useful
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.
I think we'll need to enable MICROPY_PY_NETWORK and MICROPY_PY_WIZNET5K on a board-by-board basis in
mpconfigboard.mksince 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.
Q: CPX has an ACCELEROMETER_INTERRUPT pin defined too. Is that connected on this board?
nope just a secondary I2C port - since its an M4, its fast enough to query the chip for anything it needs
Is there a python library for the ST7789?
@Zentih The ST7789 is very similar to the ST7735, which has support in this library: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display. The Hallowing has an ST7735, which is also supported by the displayio module, which is in alpha in CircuitPython.
but I don't know if anyone has tried the ST7789 as an ST7735.
showing of the cpx live at pyzonZA https://youtu.be/x4l6gt-Wz5k
Live stream from PyConZA 2018 Schedule: https://za.pycon.org/schedule/ Times in SAST (UTC+2)
Iโm just going to stick with ssd1306 screens.
I plan to add st7789 support to it, but recently didn't have much time
Ok, thatโs good!
@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
@river quest give me a few hours and I'll get you a link to a better quality vid and time of cpx start
If anyone's around who can, I'd appreciate a review on this. It's a super basic fix but I prefer to follow our usual workflow: https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/pull/2
apparently we never added CAP1188 to the bundle, @tidal kiln ?
๐ค
also it never actually got deployed to PyPi
๐ค ๐ค
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.
for bundle - there's an adabot check, right?
yep. But also I updated my local bundle and checked the closed PRs.
um
now that audio mixer is done, your you guys working on TFT yet?
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.
And nice with It's Not Out Yet, Don't Ask. ๐
and slideshow
Yah slideshow I just finished up. It went fancy pants.
@teal bear thanks! you can email pt@adafruit.com if i am not around with the infoz too
@idle owl bundle pr'd
link pls
๐คฃ
Presumably yes it's a cookiecutter issue since that was automatic.
heh, whoops.
@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.
ok. i'll try. what's the bug?
current code is in repo?
yes. I was able to replicate it on the first try
oh - i see the issue
Oh hold on, he found another thing too
the gh issue
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
@idle owl re cookiecutter: should be an easy fix. just need to verify where the command should go... http://jinja.pocoo.org/docs/2.10/templates/#capitalize
@raven canopy ok, I've been fixing this intermittently all along, not sure why it didn't occur to me to mention it.
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.
@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 ๐
@idle owl remove -1 from here:
https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/blob/master/adafruit_slideshow.py#L286
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
yep. and that... >=
elif self._current_image >= image_count:
ok that's what I ended up doing.
and I changed current_image in init
but talking to Scott now.
@idle owl those two changes to the index range checking fixed both issues for me
yah trying to figure out why my third change does what it does or doesn't do anything...
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
no, it does start with the second image, but I apparently couldn't tell or something
needs to be -1
right, youre basically setting the start image
@upbeat plover not quite to displayio yet. a couple more audio things to do
@idle owl seems all fixed now?
yah PR incoming
ok. back to other things....
@tidal kiln Thank you so much for your help.
np. good job finding it. i was too slow and was just confirming.
thanks ๐
@tidal kiln https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/pull/5 if you have a moment. If not I can ping Scott
change of imagename is just cosmetic?
looks good. want me to merge?
Yes please
@idle owl Whew! I was trying to understand the impact of that name change...
Simply that imagename is not a word.... I prefer being explicit.
@idle owl done. you wanna close the issues.
Yes!
np - I just thought it was somehow related to the bug report...
@gusty kiln https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/pull/6 when you have a minute
lookin'
Thanks
merged
hey y'all! i'm tinkering with my Adabox Hallowing, and I just installed the UF2 file from this page https://learn.adafruit.com/adafruit-hallowing/circuitpython on my Hallowing, but wondering if something went wrong, because when i open CIRCUITPY it only contains a boot_out.txt file, no code.py or main.py file
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.
@fierce oar what @idle owl said. i think it ships with an ardunio sketch
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
Hmm. That shouldn't have anything to do with the presence of a code.py - I think Mu should see the board regardless....
Maybe I'm wrong about that.
what was the hallowing doing when you opened Mu? the eyeball?
no, it stopped doing the eyeball when i installed the UF2
I think you may need to upgrade Mu to see the hallowing
ah ok, so it did have circuitpython on it
i restarted mu and now it sees it
Oh good call, @tulip sleet
just now
Oh good!
yay!
ok, great, mu 1.0.1 added more Adafruit boards
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
or maybe just a screenshot of this saying this is correct
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.
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
The UF2 is only updating CircuitPython itself, it's not changing the code on the board.
so maybe there should be some explanation of what the UF2 is doing
ah - that is great to know!
So if there was no code to begin with, you won't end up with any.
i believe it writes to the atmel chip
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.
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
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.
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
but the board also had circuit python installed on it, but no circuit python code
No, you installed CircuitPython when you put the UF2 on it.
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)
oh - the hallowing doesnt have circuit python on it at all when it comes?
ok so i have another super noob question
do it up!
ok that was my super noob question ๐
๐
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.
unless you used Arduino to write to the storage chip....
That is why I used "may".
@fierce oar See the bottom. https://learn.adafruit.com/adafruit-hallowing/circuitpython
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...
oh! omg did it say that and i totally missed it? or did you just add it?
I just added it ๐
๐
ok yay! i am going to go play with my hallowing! trying to get it into my hackapumpkin project
@fierce oar Have fun!
"play"... it's work, i promise!
@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.
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..." ๐
@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!
Where do I grab the latest (for CP 4.0 alpha) mpy-cross
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.
gotcha
@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?
it is faster maybe, yes, i'll see which works out better. tnx
np, sorry I'm not more helpful
๐ that's fine!
you can't say "c-roach" because the bad word detector is very dumb
hmm my question got scrubbed for language?
oh haha it's the name of the tutorial! ok i'll try again
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?)
i'll try it
i just re-downloaded and installed again, and still getting same error
yeah, me too, that's a 3.x version, we need the 4.0 version. let me find it
oh thank you!
hey thanks so much @tulip sleet !
i'm fixing the guide to point to the right place
that's awesome, thank you
why not grab from repo?
(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...
@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.
maybe guide was before alpha releases were available?
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
I've got a new error, "AttributeError: 'module' object has no attribute 'D4'" - is that the JST port on the Hallowing labeled NeoPix?
checking...
into the NeoPix port
yes, use board.NEOPIXEL for now. I think there's a newer version that might have D4 defined.
no, actually, use board.EXTERNAL_NEOPIXEL. But forget that, try this version of CircuitPython instead: https://github.com/adafruit/circuitpython/releases/download/4.0.0-alpha.1/adafruit-circuitpython-hallowing_m0_express-en_US-4.0.0-alpha.1.uf2
Sweet! Thanks Dan, it's totally working now!
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.
@errant grail ping me when you are around I have a test build that preconditions the m0 dac
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
try the alpha.1.uf2 and change it back to board.D4
ok one sec
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.
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.
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
@errant grail changes are here: https://github.com/adafruit/circuitpython/compare/master...tannewt:precondition_dac
will do m4 after I go get outside
@idle owl is slideshow -> bundle PR still good? making sure there isn't another release before merge...
@raven canopy kattni is away for the evening
Thanks for the input - clearly I'm not at all well versed in the ins-and-outs of the distribution (or the build process). (I'm currently using a 'stock' build on a Gemma M0 board for evaluation purposes.)
I'll certainly look into enabling MICROPY_CPYTHON_COMPAT!
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.
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
@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?
๐ @torn grail. you've been hiding! looking at Blinka, seems that the D# are aligned with the BCM pinout. https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/raspi_23/pin.py#L2
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. ๐
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
Ok, let me see if BCM number appears to line up with D# in boards... Thanks!
yw!
looks like you could use either (per Blinka/pin.py). CE# are defined, as well as D7/8 (BCM).
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!
blinkatest seems to be fine with the BCM pins
yep, use BCM
There must be something "funny" with the RFM69 libraries.
TypeError: init() got an unexpected keyword argument 'baudrate'
@torn grail you cannot use CE0 or CE1 with Blinka. Use any other GPIO pin for CS
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
There is a note about it in the Blinka guide. CEs are used internally.
@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?
Yes. Here's a 'scope screen image of one of the I2S tests using Kattni's example code::
Those are bursts of 440Hz sine waves, if I recall.
thanks @solar whale for correcting my bad advice! ๐
@errant grail what i2s dac?
UDA1334
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.
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.
ah ya
... 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)
I can send you a build. messing with m4 now. I can't read back the current value ๐ฆ
@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)
This BLE + SPIM crash sounds quite similar to this issue: https://devzone.nordicsemi.com/f/nordic-q-a/33982/sdk-15-software-crash-during-spi-session/130572. I'm inquiring.
@slender iron Ready to test the M0. Here's the baseline:
what board?
M0 Express. Using two byte arrays, 440Hz sine wave and an array with all zeros.
k, I don't really handle the between samples
feather m0 audioout ramp values
it will ramp up at the start to the default_value given in the constructor
and back down at the end
What's the syntax?
sorry, I mean for the default_value setting
Don't see a difference. I'll drop the all zeros array to see if I can spot the ramp.
it only happens on construction, not between samples
I use a second pin to trigger my capture
Ah, got it. So the pop will happen on the second play?
ya, as it is now between samples isn't done
because sample values go through dma where I'm currently managing the ramp in the audioout contructor
OK. I'll let you know what my ears say.
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.
En lo personal se me hacen bien las traducciones
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
@errant grail it should have done a reverse ramp down
@dhalbert I am making more improvement while porting this for Arduino, I will clean up and update the flash code then resolve the conflict for this a bit later.
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...
@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
Gracias @sabas1080, cualquier otra sugerencia es bienvenida.
@tannewt i will continue with the translation of this strings after translating the strings on MixerIO module and updating the strings on another modules, is that ok?
https://youtu.be/VeBZUbMVt9A?t=1246 CPX plug final copy
David Campey https://za.pycon.org/talks/78-teach-kids-7-17-to-code-with-python-coderdojo/ For the last 6 years (since pycon 2012) David's had a weekly class ...
Not the most encouraging response to your inquiry :-(
Have you tried building a DEBUG build, it has asserts enabled, maybe that helps.
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
@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.
hmm, it was running a screen but maybe not actively drawing on it so I guess not
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.
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 ๐
Life does happen ๐
I spent quite a few hours optimizing draw speed and it can probably be optimized even more but I think this is good enough for basic development. #badgelife #35c3 @NordicTweets @CircuitPython https://t.co/ufmIhWaf0I
112
^ nRF52840 running CircuitPython
nice!
it uses spi for the screen and has BLE but I haven't tested BLE yet
@indigo wedge That's really cool!
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
I disabled SPIM3 in nrfx_config.h and the problem seems to have been resolved. I can now run a blue advertise and then mount my SPI SD Card
@idle owl i messed up adding cap1188 to the bundle. sry. here's a PR to fix.
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/98
it's just a move and an edit of .gitmodules - is there anything anywhere else that needs updating also?
@tidal kiln Don't know, don't think so. I'll grab that PR in a bit. Thanks for catching it.
@solar whale that's very helpful! The original problem in https://devzone.nordicsemi.com/f/nordic-q-a/33982/sdk-15-software-crash-during-spi-session/130572 already had SPIM3 disabled. But they were also using the PDK.
There are many errata for SPIM3 ๐ฆ
@idle owl wasn't me. thank @raven canopy
(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...)
# ...
...
@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
@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.
@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.
can you do a magnetometer reading via CP and via arduino and compare the results? Do you get similar field magnitudes?
yeah, lemme see what i can come up with.
no rush - thanks
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
right, gotcha.
if it's there, it'll be a factor of 16
@pastel panther I was asleep. Maybe my laptop woke up for some reason
hmmm... robots are making their move?! ๐ค
maybe ๐
@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.
@idle owl I agree it doesn't look right
Change request added.
not sure..looking...
added some test values for lsm303 to that PR.
@gusty kiln thanks
@gusty kiln @tidal kiln thanks! -- looks like a factor of 16
lemme know if you need anything else / confirmation of changes once made.
