#circuitpython-dev
1 messages ยท Page 177 of 1
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_L3GD20.svg?branch=master
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_L3GD20
:alt: Build Status
should be this ^^^
Travis failed on the deployment invalid option "--api_key=".
https://travis-ci.org/adafruit/Adafruit_CircuitPython_L3GD20
Correct
the RTD part...is beyond my realm. other than it needs to be added to the circuitpython drivers list...
I will fix that, but the next thing is to get it into the Adafruit CircuitPython RTD.
needs to be added here: https://github.com/adafruit/circuitpython/blob/master/docs/drivers.rst
I think adabot handles the RTD build. that correct, @idle owl?
Not exactly...
hehe. and that is why i still don't understand it fully. ๐
We're talking about adding the lib to RTD so it has an RTD page, correct?
yes. it doesn't have one built, best i can tell.
Yes I have half a page of notes on this. It's a series of steps done on RTD.
is that something i should do (can do)?
Let's find out!
@slender iron Is adding a lib to RTD something that @fading solstice has permissions for?
I'll hold off on approve-n-merge for the badge fix. I don't think there is anything to do in the lib repo for RTD, but just in case...
Only getting the URL once it's done, but waiting is fine.
after i push the fix to my repo version, i am getting a passing from the builfd badge. but stilll unknown from the docs
I think because it's not been added to RTD.
it isn't listed in the sub projects; just need to find out if adabot will/should do it after adding to drivers.rst, or if it requires addition by hand.
Hi,
it appears to be failing here:
https://github.com/adafruit/circuitpython/blob/master/ports/esp8266/modules/inisetup.py#L43
- If I do this in the REPL I get the same error
>>> storage.VfsFat.mkfs(bdev)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert NoneType to int
not sure if this is a symptom or a cause.
anyone flashed the latest circuitpython on a nrf52? any good results?
@peak thicket yes - it works on the feather52832
just ordered an odroid-go ๐
soo many things i want to order
@slender iron I take it 3.x is the RC branch for 3.0, and that my PR should remain against master?
vagrant ssh does not belong in this window... ๐
apparently the usage storage.VfsFat is limited to the esp8266.
orts/esp8266/modules/inisetup.py: storage.VfsFat.mkfs(bdev)
ports/esp8266/modules/inisetup.py: vfs = storage.VfsFat(bdev)
ports/esp8266/modules/_boot.py: vfs = storage.VfsFat(bdev)
ports/esp8266/build/frozen_mpy/inisetup.py: storage.VfsFat.mkfs(bdev)
ports/esp8266/build/frozen_mpy/inisetup.py: vfs = storage.VfsFat(bdev)
Binary file ports/esp8266/build/frozen_mpy/_boot.mpy matches
ports/esp8266/build/...
@tulip sleet I did not realize there had been a 3.x branch -- I applied the itsybitsy m4 fix for Pins D3/D4 to master - does it also need to get applied to 3.x or will that happen at the next 3.x release.
The ESP8266 boot sequence is making my head hurt ๐จ
@solar whale I'll look at the ESP8266 problems tomorrow. Don't worry too much for now. I'll cherry-pick the D3/D4 fix over to 3.x.
@tulip sleet thanks - I mades ome progress - posted to the issue, but I'm stuck now. Glad to leave it to you.! Good luck.
i was reading what you were finding @solar whale. it seems to me that the esp was never expected to have the FS locked. otherwise, ampy wouldn't have worked anyway. right?
any esp8266 fix will go into 3.x and I'll merge it back to master
@raven canopy I think so, but I can't figure out where it gets locked.
i think it's the updated boot_out stuff. unless i misunderstand the changes you made there @tulip sleet?
but also one of the recent commits caused FS to appear corrupted.
but taht is in main.py at root/ esp8266 does not use that .
right, based on the bdev not being empty, in inisetup.py.
cherry-pick 80d16cb7df793b154a7a9a2f05850a83c3d3408c (@by jerryneedell) from master
fixes #948
oh yeah...argh! too many thoughts and material at once. ๐
but the bdev seems to be the problem - or at least it is related. I think the FS is never getting mounted since it fails in _boot.py
think we're hitting this: https://github.com/adafruit/circuitpython/blob/master/ports/esp8266/modules/flashbdev.py#L31? it would explain the NoneType error.
but why are we now hitting that is the caper...
Thats's where I have been looking -- but hard to see why it would fail
if only we had some debug tools... ๐
aha, I know the problem, I think, thanks for the pointer to that file. readblocks() and writeblocks() need to return a status. I am now looking for a return code. Formerly it didn't check for errors. We need to add return 0 to the end of each of those rooutines
there was a TODO lemme find that
extmod/vfs_fat_diskio.c diskread():
mp_call_method_n_kw(2, 0, vfs->readblocks);
// TODO handle error return
this used to be true, so I handled the error return, but it turns out a number of file system impls were not bothering to return any status. I had to fix the tests where a toy filesystem was not, for instance.
Is it easy for you to add the two return 0 lines and test? That is probably the problem.
I'll give it a try
readies Captain Planet ring
With our powers combined... ๐ ๐
this unsigned math -> MP_NEW_SMALL_INT thing is driving me batty. I don't get it... I see it used successfully elsewhere, my sign bits aren't changing (that i can tell), and the 1 deep ring buffer is functioning correctly so I shouldn't be over/underflowing.
first try did not work, but I had done some reverts -- unrevrting so only change is to flashbdev.py
nope back to corrupted FS when I put the removed commits back. ```erryneedell@Ubuntu-Macmini:~/projects/adafruit_github/circuitpython_master/ports/esp8266$ git diff
diff --git a/ports/esp8266/modules/flashbdev.py b/ports/esp8266/modules/flashbdev.py
index 40ba655..da4194b 100644
--- a/ports/esp8266/modules/flashbdev.py
+++ b/ports/esp8266/modules/flashbdev.py
@@ -13,12 +13,14 @@ class FlashBdev:
def readblocks(self, n, buf):
#print("readblocks(%s, %x(%d))" % (n, id(buf), len(buf)))
esp.flash_read((n + self.START_SEC) * self.SEC_SIZE, buf)
-
return 0def writeblocks(self, n, buf):
#print("writeblocks(%s, %x(%d))" % (n, id(buf), len(buf)))
#assert len(buf) <= self.SEC_SIZE, len(buf)
esp.flash_erase(n + self.START_SEC)
esp.flash_write((n + self.START_SEC) * self.SEC_SIZE, buf) -
return 0def ioctl(self, op, arg):
#print("ioctl(%d, %r)" % (op, arg))
it's also possible it's forbidding '/' to be mounted on '/', though it's supposed to handle that. All right, enough for tonight.
I think there may be multiple issues.
agreed -- good night -- and good luck !!
night all!
so says Edward R. Murrow...
admits: had to look him up. but i know after the catchphrase. ๐
ok. time to turn the brain off... ๐คค
For @raven canopy - 2's complement (signed ints). This is the first draft (I rarely do a second) hehe.
is there a port of https://github.com/adafruit/Adafruit_TouchScreen for CP? I know it's not much code but want to make sure someone didn't already do it before I try myself ๐
@dhalbert just to recap what we tried last night. I modified flashbdev.py to return 0 for readblocks/writeblocks. With only that change I once again was getting the "corrupted FS" on boot.
If I remove the commit https://github.com/adafruit/circuitpython/commit/f15288993875360dcc2c62b86110ea3c748ee267 thnen I can get past the previous errors in _boot.py but it is still not working correctly.
os.listdir() gives a long string of odd results:
Adafruit CircuitPython 3.0.0-rc.0-4-g5fb4cdc-...
@indigo wedge I did craate a driver for the STMPE610 touchscreen if that is of any help https://github.com/adafruit/Adafruit_CircuitPython_STMPE610
but it looks like you are going straight to the 4 wires.
Yes, I wanted a 4-wire one, oh well, no worries
@slender iron Did not mean to merge this PR without your review: something odd happened when I thought I was pushing to my local repo, and the PR got merged. But it doesn't really matter. This was just cherry-picking a fix from master that's known to work. https://github.com/adafruit/circuitpython/pull/952
@solar whale are you available to test an esp8266 fix?
does anyone have a suggested smd button with nice click (tactile or not)? the one i choose seems to be crappy. many thanks either way.
@tulip sleet not until about 4 PM
it kinda shorts out / messes with the reset and ground rail
I have a fix for the esp8266 problem. The fix allows '/' to be mounted on '/'. with the fix, ampy works fine and no errors on startup.
@marble hornet these work well https://www.mouser.com/ProductDetail/667-EVQ-Q2503W
The esp8266 startup appears to mount a '/' twice instead of just once.
thanks!
once is in code that isn't error-checked, and once is in the startup .py code, which I added a check for.
I'll submit a PR
@tulip sleet nice - I'll be happy to try it but is sounds like it is working well. Thanks!
also I reworked the error checking so the return 0s aren't necessary: a filesystem impl can return None or 0 on success. Any other return is an error. Not important to you but there might be other ports where there's no status return.
k, tnx, ttyl
Allow mounting '/' on '/'. This was done in C code in atmel-samd, but esp8266 does it in Python code, which fell afoul of #935.
Also relaxes requirement that filesystem operations readblocks() and writeblocks() return 0 on success. They can return None or 0. Any other return is considered to be an error status code.
@jerryneedell may test this afternoon after 4pm ET.
Fixes #947.
@slender iron increased GitHub branch protection for 3.x branch - made it same as 2.x.
Hey @tulip sleet could you have a look at my nRF patch when you get some time, I know it's rather large but if you go commit by commit then it's pretty clean I think ๐ Thanks!
@indigo wedge sure, one or more of us will. I have not done any nRF work yet so Scott, hathach and I will work out who reviews what.
Has anyone asked the PSF to list CircuitPython on https://www.python.org/download/alternatives/?
@wraith tiger you can submit an issue to the PSF's web team. I believe the repository is on GitHub (but I don't have it to hand). If nothing comes of it, I know one of the maintainers and can give him a kick if there needs to be movement.
@tulip sleet Thanks for the fixes. No worries on my end about the merged PR. I've been heads down on this gaming stuff though I want to get caught up today
@ruby atlas yup, you should target master
I am using several adafruit feather boards in ubuntu and all works fine when I am running as the logged in user, with the CIRCUITPY device mounted at /media/<user>/CIRCUITPY. However, I need to copy files to the device to run code from inside jenkins. So - can I modify the mount point in fstab so the device is available to eveyone, or can I modify the group permissions for the device mounted at /media/<user>/CIRCUITPY so jenkins can write the code.py file to it ?
@timber mango I imagine it would require a change to udev rules. I don't know the details though
probably the same as other USB drives
tannewt - I have the adafruit udev rules already setup - the issue is the way ubuntu now automounts all usb devices to /media/<user> and the permissions that are set by default. I am having trouble finding a decent reference online that shows how to change the permissions for the group. I 'fixed' a similar issue for the second hard drive in my linux system by having it mounted via fstab and not in the media folder. I will keep looking as it should be a straight up permissions edited (but I have not found the correct way to do that yet - the joys of open source)
could I get some pointers on a Python issue in having here?
@analog folio ask away
anyone know where the nrf52 install instructions are? https://forums.adafruit.com/viewtopic.php?f=60&t=137289
just posted it to the forum
haha, I did too
good - mine got blocked by yours -- all good
@analog folio responded in #help-with-projects
So, if I were to request that CircuitPython be listed on the PSF's "Alternative Python Implementations" page, what one sentence blurb would we want to use and what URL should it point to? I'm guessing https://learn.adafruit.com/welcome-to-circuitpython would be the right URL.
@dhalbert I downloaded and built with this PR. It boots cleanly and I can now upload files with ampy!!
One note - I had to erase the chip in order for it to work. At least, it did not work on my first try. I then erased the chip and reloaded and it was fine.
Note : I pulled the fixes into master, not 3.x
repeated with 3.x -- still works ;-)
@tulip sleet @raven canopy can you point me to some information, or give a brief explanation of waht this funtion is doing MP_OBJ_SMALL_INT_VALUE(ret) it seems to be a hot topic these days...
@jerryneedell Thanks for the testing! I don't know why you needed to erase, but I assume the original filesystem was corrupted.
it look like it just divides by 4
@solar whale it is a macro that converts from object representation to a regular integer
#define MP_OBJ_SMALL_INT_VALUE(o) (((mp_int_t)(o)) >> 1)
oh - I picekd the wrong one to look at
32-bit values can be object pointers, interned string pointers, ints, or floats. The lower 1 or 2 bits indicate the kind of value.
if the lowest bit is set, the upper 31 bits are an integer
static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
{ return ((((mp_int_t)(o)) & 1) != 0); }
#define MP_OBJ_SMALL_INT_VALUE(o) (((mp_int_t)(o)) >> 1)
OK thanks --- fog is lifting.
How do you know if it is REPR_A/B/C/D ?
If the lower two bits are such and such, it's a float, etc.
repr choice is in mpconfigport.h, probably
yes, ok, it's REPR_C, chosen in ports/atmel-samd/mpconfigport.h
ah - thanks
also in ports/esp8266/mpconfigport.h ๐
and I thought I could read C programs ....
I use ag a lot.
odd - just tried it on another esp8266 and I did not have to erase it. THis board has some files alredy installed and they are still intact
@solar whale thanks for joining me in MP_OBJ_NEW_SMALL_INT land! ๐ i'm about to try mp_obj_new_int_from_uint() to try and confirm that i am somehow sending an incompatible uint...
I'm getting a problem trying to upgrade a metro m0 express from CircuitPython 2.3.1 to 3.0. I'm using a PC with windows 10 - I switch to the boot drive mode and copy the 3.0.0-rc.0.uf2 file from github into it. As the .uf2 file is copying to the board the PC locks-up (mouse and keyboard unresponsive). The board reboots but PC remains locked. If I reset the board the PC unlocks briefly then locks-up again. When I unplug the board's USB cable the PC unlocks, when I plug the cable back in again ...
Thank you for the report! We'll look soon!
!mp_obj_is_true(ret) will make it use the standard Python truthiness. https://github.com/adafruit/circuitpython/blob/master/py/obj.h#L681
@fading solstice did you get the RTD stuff sorted?
Not necessarily. A board can choose to freeze python libs in or ship with them on the drive.
@slender iron i don't think so. we left off at "how does the RTD build get triggered/created"...
the RTD project is created manually (usually by me). the builds get triggered through a github webhook (also set up manually)
ok. so those need to happen. along with drivers.rst being updated.
yup
i'll approve and merge the Travis badge fix PR, if it doesn't affect any of that.
ohh. nevermind. you did that. 7 minutes ago... ๐
Do we really need the softdevice here? my understanding is that its fixed per board.
No problem - let me know if you need any more information.
๐
Is there a good visualization tool for git that can run on the local Linux machine I'm editing on? I want to see the diffs before I push commits to a branch.
This way I keep the edit history a bit more tidy, when other folks look at the code on github.
i'm thinking about tonym01's uf2 update lockup issue. kind of easy to blame the PC, but i'm wondering if it could be an older version of the bootloader that is giving them fits. this is an issue that is "close", but the symptoms don't exactly match: https://github.com/Microsoft/uf2-samdx1/issues/30
also, having them update would kind of erase the "evidence" they currently have. is there a way we can get a dump of the installed uf2?
The particular test I used above was already used elsewhere in this file (see line 73, for example), so let's stick with the current test. The implicit contract is that the called routines either have a plain return (so returning None, meaning everything is fine, or return an error code, with 0 meaning OK. Other Falsiness (like empty lists) is not expected.
@timber mango I use gitk. There's also git-gui.
The following NEW packages will be installed: git-gui gitk libtcl8.6 libtk8.6 tcl tcl8.6 tk tk8.6 0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Need to get 3,415 kB of archives. After this operation, 9,798 kB of additional disk space will be used.
@tulip sleet thanks! I found those while waiting for a reply here, so they're about to be installed. Good to know you like to use them!
https://git-scm.com/download/gui/linux is what put me onto them.
@raven canopy Since it locks up based on the CPy version, I'm not sure how the UF2 bootloader would be implicated. I just got my Win10 machine back after my wife borrowed it this afternoon, so I'll try this too.
@timber mango another harder q is what tool to use if there's a merge conflict (you probably won't encounter that), il.e. what git mergetool uses. I use kdiff3.
@tulip sleet fair point. the main reason i was thinking bootloader is because in boot mode it is the one setting the USB descriptors. I am tempted to help them with the microsoft USB diagnostic tool that I used with serial paste mode. but it isn't easy to read/find info...
When tonym01 says the mouse and keyboard are unresponsive, I am wondering if it's the HID descriptors that 3.0 presents, which are more complicated than the 2.3.1 descriptors.
3.0 has mouse, keyboard, gamepad, and consumer control all rolled up. Or, it could be a disk mounting issue. I've seen third-party software get confused
yeah. the "unlocks/locks on reset" would support that. the original lockup description doesn't clearly state if it locks after the copy is complete, or before.
ok, I can't duplicate. I'll have them erase the filesystem and see if it's some peculiarity there.
@tulip sleet "mouse and keyboard are unresponsive" I get that when I crash CP.
Or am running the JLink
I'm not sure if it's HID or Mass Storage causing it. Mass storage usually disconnects shortly after that
does it recover after a little while or do you have to unplug the board?
it does recover (this is a Mac), but stalls intermittently until I unplug the board.
The stalling may be that's it's upset about the mass storage being disconnected. @slender iron have you seen anything like this on your Mac?
Hi - I tried this on a Windows 10 machine also running 1803 and was unable to duplicate the problem.
A couple of ideas:
- There's a small possibility something about the filesystem is confusing Windows. Copy 2.3.1 back on the board. Then copy off any files you want to keep from CIRCUITPY. Then in the REPL, do:
import storage
storage.erase_filesystem()
That will erase CIRCUITPY. Then reload 3.0.0-rc.0 and see if you get the same hang.
- Do you have any third-party disk-i...
@tulip sleet i suppose I should probably watch my logs sometime.
When working with the JLink next, since I can simulate a hang that way.
yes, whatever the equivalent of syslog is would be interesting
Console ๐
Turns out it's still syslog: $ ps ax | grep syslog 50 ?? Ss 0:39.08 /usr/sbin/syslogd
tail -f /var/log/syslog ?
I would have expected Apple to replace that with something custom by now.
probably somewhere else
tail -f /var/log/system.log and a few others.
but Console app is better for a more overall view of all the logs, as it's likely not in the system.log
I am not a heavy Mac user - I have an old one for cross-platform testing only.
Ah.
I haven't seen the issue @tulip sleet
Let me go read the issue.
Wow that's kinda ugly, way worse than the brief USB HID issues I feel when using JLink debugging (or crash CP) - 1-2 second HID device hang before the drive is ejected.
It's a bit worse on my desktop mac than my 2016 macbook pro.
my desktop mac isn't using official apple hardware.
@tulip sleet how do you scroll the lower left window in gitk?
It's showing a DIFF.
The keyboard arrow keypresses do not scroll this window (unshifted, anyway).
Instead, they select the previous or next commit.
(The mouse scrollbar there does scroll the DIFF, but is difficult for me to operate.)
it scrolls automatically as you scroll the lower right window, or select files in there. It's not that great: it's just all the file diffs concatenated together
oh, you mean if the diff is taller than the window?
I use huge fonts so the diff is never going to fit inside the window -- I have to scroll it.
i just move my mouse into the lower left subwindow and use the scroll wheel, and it is scrolling
Okay got that. I can do an analogous thing with my trackpad. Thank you.
or drag that subwindow's scroll bar
Scroll bars require better vision to be useful. They are strongly visually-biased widgets. ;)
The Help has keybindings; This is Very Linuxy.
u is up and d is down.
The increment is 18 lines and doesn't seem to be configurable, but maybe it is.
It also binds Ctrl Minus and Ctrl Plus to font decrease/increase.
Seems to function somewhat like a $PAGER. Not too bad.
Definitely ahead of where I was, two hours ago.
I have a question about mpy-cross. Is the original micropython mpy-cross output compatible with circuitpython? Or do I have to use the circuitpython fork of it? There's a binary available for micropython, but not circuitpython from what I can find. And no instructions provided to build circuitpython on Windows 7 which would probably be a pain anyway.
@frosty bison what version of Circuitpython are you using -- there is a different version of mpy-cross for 2.x from 3.x
@solar whale adafruit-circuitpython-trinket_m0-2.3.1.uf2 is what I'm running on my Trinket M0
There's a windows .EXE there
Perfect, I think I've got it from there, thanks for the quick reply
not sure if it is windows 10 or 7 or possibly both...
@slender iron @tulip sleet I don't see a CP3.0 mpy-cross with the 3.0 releases - am I just not seeing it?
the mpy-cross at https://github.com/adafruit/circuitpython/releases/tag/2.3.1 works great so I'm good to go
@solar whale its on older ones but I'm bad at copying it over
should we be renaming mpy-cross for 3.x builds to mpy-cross-3.0 and 3.1 and so on?
I have run into a few cases where I needed more than one mpy-cross version.
@timber mango I'm using Git Cola (https://git-cola.github.io/).
so far - I have only found a windows version back with 3.0 alpha 6 -- I guess it has not been a problem - yet...
This gitk visualization of the diff gives me a chance to almost be sober (hah) in how I approach this (I have sweeping changes to make in my code base, which I inherited and disagreed with the old method of representing the code in very looong files).
(insert a few words and joining concepts there, some'eres)
@arturo182 I noticed that in the README file for the feather52832, some of the examples refer to
"make BOARD=feather52"
but now that should be "make BOARD=feather52832"
I may have missed it, but I scanned the PR and did not see updates for this. rather than generating a separate PR, do you want to fix them?
@slender iron i've meant to ask you this before, but can you explain (or point me to) why "TC4-TC7 can only have 100MHz inputs", per this note: https://github.com/adafruit/samd-peripherals/blob/master/samd/samd51/timers.c#L122
take a look in the SAMD51 datasheet under electrical characteristics
its got a list of input GCLK limits for peripherals
kk. thanks!
@ruby atlas @solar whale any 3.0 mpy-cross will work. I need to gather them together and add them to the release.
I just discovered they still make something like my childhood electronics learning toy https://www.amazon.ca/Elenco-Electronic-Playground-Learning-Center/dp/B0035XSZDI
is there a preferred way to use an equate or define for a value without comitting it to a variable?
something like #define noteD 1 in C code
you can do _variable = const(5), but it will only be available in the one file in which you put it
I think it's useful if you want to build with and without SD without having to remove the build directory, I was actually tempted to also add the SD version in there so we could build 2.0.1 and 5.0.0 without cleaning but I think there are some .mk file dependencies that make it hard.
@tannewt Oh, I was not aware there was any MP PR for nRF, I'll look into it.
@jerryneedell I missed that, I will like that and add to this PR, thanks!
Thanks - I'll try the suggested ideas. I am away at the moment, so it will be tomorrow before I get back with my findings. I'll also try a different PC and see if I get the same behaviour.
@ruby lake you need to from micropython import const first. Details here: http://docs.micropython.org/en/latest/pyboard/library/micropython.html#micropython.const and http://docs.micropython.org/en/latest/pyboard/reference/speed_python.html#the-const-declaration. The rest of the second page is also interesting.
#954 is sure a weird issue
windows ๐คท
@slender iron q re what's created on imports: I have a .py that's just a couple dozen FOO = const(123) sort of lines. The .mpy is only about 600 bytes. When imported either as import foo or from foo import *, about 3k bytes gets used up, which seems kinds of excessive to me. What's your intuition here? Is it the dict and the pointers in the dict? How sparse is the dict? Perhaps I should use your heap analysis script. I wonder if there's some way to shrink that down significantly.
hmm, if I import just a single name: from foo import FOO, it still uses up 3k bytes, so it's not just the global name dict
the variable name has to start with _ to save memory
otherwise it's added into the dict anyways
because it has to be available from the outside
thank you everyone for a great year here together! https://blog.adafruit.com/2018/06/22/celebrating-a-year-together-as-a-community-on-discord-discordapp-adafruit-adafruit/
@tannewt Just added one small change, you approved the previous commits so this shouldn't take long to approve and merge :D
@ruby atlas I had something like that, but I think mine was from Radio Shack.
@tulip sleet It could be qstr pool related. probably good to get you running the heap script. it could be a long lived leak as well causing duplicates
in your example FOO still refers to its namespace so all of the other names are still in its dictionary
@wraith tiger https://blog.adafruit.com/2018/06/22/when-ibm-hired-musicians-as-programmers-retrocomputing/
tnx to you and deshipu for that point. I am going to try one-name .py files as well, which seem to use up too much space. Will come up with an example.
Cool. Am i internet famous yet? ๐
@tulip sleet here is how dictionaries grow in size: https://github.com/adafruit/circuitpython/blob/master/py/map.c#L47
@slender iron ok perhaps not as bad as I thought. It seems like the first import of any non-builtin .mpy uses up about 3k bytes of overhead, perhaps setting up initial dicts. After that it grows more slowly and in proportion to the .mpy file size. I think I was thrown off by a 4k buffer alloc sometimes happening due to the filesystem, which made it seem like each import was at least 3k. (I had semi-duplicated the file and imported it twice under different names).
ya. I'm going to get my gaming rig setup to do more heap captures and render them
I was wondering how hard would it be for me to add to an m0 Circuit Python: 1) go to sleep. Wake up when motion detected 2) go to sleep. Wake up at 4AM. to circuit python. These are the two features stopping me from using CircuitPython for my sensor projects. Any advice?
@slender iron you got a quick plug for the Seattle 3h meetup on Amp Hour. Episode 397.2
@prime flower I'm enjoying Chris's short interview of folks. Makes me feel like I'm camping along with them.
@prime flower yay! I'm hoping I get the experience by meeting folks there
ha, absolutely agree, but replace "camping" with sailing as he's doing the latest ones on a sloop
@bronze geyser we don't support sleep yet ๐
hrm I should start a NYC one, but we already have NYCResistor
there's BarSec but that's not hardware, that's infosec
@tennewt could i figure out how to write a c module that gets into standby? Then i need to be able to attach an interrupt.?
@slender iron i was looking at the micropython "adding a module" and wondering if i could do something like this? http://micropython-dev-docs.readthedocs.io/en/latest/adding-module.html
@bronze geyser one possibility for the timed wakeup is to use one of these modules: https://www.adafruit.com/product/3435 or https://www.adafruit.com/product/3573
which could be used to completely power off and power on the board running CircuitPython
@bronze geyser yeah adding a module makes sense. I want time.sleep to be smart too but it would be time based
@tulip sleet Thank you. i will look into that.
The enable-pin one can control the EN pin on a Feather, etc., which is basically an on/off switch that disables/enables the regulator.
@slender iron so i wanna see how hard it is to write a module for circuit python. i realize i should just jump in...but in case you have any "getting started" advice?
@tulip sleet has a build tutorial and this describes some code layout: https://circuitpython.readthedocs.io/en/latest/docs/common_hal.html
@slender iron @tulip sleet Thank you.
SD is upgradable, it is useful, we will role out the bootloader with S132 v6 for feather52832, to be consistent with nrf52840
@raven canopy i still don't see a document in RTD for the l3gd20 library. Do i need to ask Scott to do somehting?
@tulip sleet thanks, I'll have a look
@tannewt et al: what do you think about adding PWMOut.duty_cycle_fraction, which will allow a simpler way of setting a fractional duty cycle. it would be mplemented as int(fraction * 65535) plus range checking. So the end user doesn't need to remember 65535.
Similar functionality proposed in #85, but that was time-based rather than fraction. So maybe this has been sort of decided already.
I would also add it to adafruit_seesaw.pwmout.PWMOut.
hey, so I just got back and soldered some headers onto the board i made. and it doesn't show at all.
i tried reflashing the uf2 bootloader but am getting a 'can't halt cpu error'
did you measure the voltages?
yes
it all checks out
i even replaced the reset resistor!
which was shorting
i am trying h, r, r0, rx etc
i have power cycled multiple times
hiya @hathach we started getting some modules so we can have some beta feather nrf52840 soon. since the pinout is different than the PCA (dev kit) please copy/duplicate the current nrf52840 board so we have both PCA10056 and also a feather_nrf52840 (you can keep same pinout for now on that and ill let you know once the pin definition is set for it!)
probably bad solder somewhere
did 3.0 get released? 3.x?
I think we are at candidate 1
i have local brach that i want to update the changes from it: git fetch https://github.com/adafruit/circuitpython.git?
@fading solstice I'll set it up now
@marble hornet the "cannot halt" happens to me occasionally. usually takes a few unplug cycles, then it starts working again. gremlins are ornery...
hey, i think there is a problem with the current master. but it might just be me: i tried:Jonahs-MacBook-Pro:atmel-samd jonahy-m$ make BOARD=feather_m4_express Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. make: *** No rule to make target `peripherals/samd/clocks.c', needed by `build-feather_m4_express/genhdr/qstr.i.last'. Stop..
probably me mis-using git
you need to do git submodule update --init --recursive after cloning or updating.
and that does?
it updates the subrepos
the samd peripherals were moved out so they can be used by makecode in the future
okay
if you look on github, you'll see that folders like peripherals and asf4 are links to separate repos, within the repo. these are known as submodules in git.
i noticed it takes longer to compile now, just size?
i haven't noticed any real increase in compile time. were you using make clean each time before? compiling on an existing build folder (without 'clean') skips the QSTR creation part of the compile.
yeah, the first build would be the same as clean. any builds after that without clean will go faster. but building fresh is highly encouraged when changing the firmware.
@slender iron @idle owl should we do another release for @fading solstice's L3GD20 library since the badge fix and RTD addition?
@raven canopy Releases really only matter with code changes, things that would affect the library usage in the bundle. We can probably wait on making another release, and then include those changes in the next release following a code change.
๐ i was thinking more along the lines of asking adabot to use the most recent tag in the bundle and trigger the RTD build. The RTD project is there, but still hasn't been built (returns "does not exist").
would updating the tag on the last release work?
That I'm unsure of.
Well, I've completed my uflash hacking (apart from any further changes ntoll might request).
I thought we already had separate pin files for the DK and the feather:
https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/pca10056/pins.csv
https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/feather52840/pins.csv
?
@idle owl @raven canopy Adabot did run last night after my changes were merged. I think we need to make a release to see the RTD generated and available
oh yeah! what i meant was to make the usbboot keep both up to date if possible. i was following the instructions and using a DK :)

I did some poking around with dotstars last night. it shouldn't be too hard to add dotstar features to pixelbuf without significant changes.
#leeks https://youtu.be/sZo-xscmeOA
@slender iron nice! is the artifacting code or recording related?
this is a no-judgement zone. the code will get there... ๐
Yup! It wasn't even playable until last night
turns out the game is much easier slowed down ๐
like the slo-mo bomb on smash bros! ๐
@slender iron That's great!
i found a mistake in the amg88xx code and have cloned and corrected the issue, but i cant google well enough to figure out how to set up my local as a sperate branch and use the branch to pull. could someone give me some help please
did you fork the repo?
start by doing that, then clone that repo locally.
Step 1: In the adafruit clone, type git remote add tg_techie https://github.com/tg-techie/Adafruit_CircuitPython_AMG88XX.git (replace tg-techie references as necessary/desired).
remote add?
yep. it will make sense in a few. did you commit your changes yet?
yes
ok
done
Step 2: in the adafruit clone, type git push <tg_techie> <branch_name>. that will push your local changes to your fork
so i also need to clone the adafruit one?
i thought you did?
i cloned mine
"i found a mistake in the amg88xx code and have cloned and corrected the issue"
where are the changes you made?
in a local copy of adafruit_circuitpython_amg88xx (git clone http://github.com/adafruit/), or in a local copy of your fork (git clone http://github.com/tg-techie)?
i corrected line 45:
in my own fork
ok. so you already had forked it.
ah, so now i have a fork it pull requests it automatically! thanks
๐
git/github exist in a magical, mysterious land. at least, it usually seems like it. ๐
Not for long! keeps working furiously on the guide
yah its like what chips and electronics were to me two years ago! ** preemptive hug report **
Like 3d design & printing were to me 6 months ago.
closer to 9 months ago for the 3d printing for me ๐
git is something I migrated to like ... uh... (checks resume) 11-12 years ago
oh wow, so before github
dotstar support not quite right yet
neopixels still happy ๐
@slender iron wow... that's wonderful to see... am I right in assuming there's something akin to the PyGameZero API going to be available..? #leekandpotatosoup ๐
hey, my m4 based board stopped working . it can boot into metrom4boot but circuitpy doesn't show up
so i am using a different storage chip but it was already supported by circuit python. and it just stopped after being unplugged.
are there any cases or known things like this?
all the voltages check out
tried with an earlier version?
@ruby atlas I'm not sure when I started using git. Probably in the early days of rSpec, since we started by using Mercurial for it before switching to git. That would have been ~13 years ago I guess. My github user id is 2020. I think that's from before they opened to the public.
.oO(The doctor tells me I have been using git every day, often for hours at a time, but I have no memory of it.)
tgtech try out gitk
how can you clone a previous commit or branch
each commit has an sha256sum (or similar checksum).
They can be identified by citing enough of it to make it a unique citation.
what is this magic?
they are also tagged
what operating system are you using?
so you can clone an older release tag
just type git checkout and press tab to see what you have there...
@timber mango isn't that a personal question? ;-)
haha @stuck elbow indeed.
worse, it's a profiling question, as asked.
Still,it is a mistake not to tell the blind barber how tall you are.
๐
No offence meant to the blind, the tall, the barber, and users of the words 'still' 'mistake' and especially, 'the'.
or the word offense ๐
(it's an Irish fence)
gitk is nice -- a bit overwhelming
The keybindings are (ah..) key .. to its enjoyment. It's very linuxy.
vi keybindings j and k are useful. u and d are as well.
What I like about github is that it does syntax coloring inside the context of a diff, whereas that's beyond the scope of what gitk can render (it has to work with the tcl/tk libraries).
okay so i have an old version download locally but am getting an error! ahh. let me do some googling.
$ head -4 /usr/bin/gitk
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@"
$ wc -l /usr/bin/gitk
12385 /usr/bin/gitk
@marble hornet depending on how far back you went, you may have to restore the submodules - git submodule update --init --recursive I do this as a matter of habit every time I clone.
$ cat -n /usr/bin/gitk |egrep 18|egrep bind|sed 3q|egrep -v ous
2560 bindkey d "$ctext yview scroll 18 units"
2561 bindkey u "$ctext yview scroll -18 units"
Shouldn't be difficult to customize gitk quite a bit.
or break it ๐
Hehe. It doesn't have write privileges, afaik. I hope not
This is pretty amazing that someone wrote an app of this size in tcl.
it takes me minutes to compile, hbu?
about 138 seconds for circuit python
depends on the BOARD
Fri 15 Jun 22:29:10 UTC 2018 Fri 15 Jun 22:26:52 UTC 2018
end and begin timestamps during a compile.
but I just built Metro M4 express -- took about 138 sec ๐
i'm like 4+ minutes into a pocket now video and it still isn't done (i started video after starting compile)
it didn't work
so the compile succeeded - can you get to REPL
well - I hate to suggest it, but sometimes USB gets confused on my host system after failed connections - Have you tried rebooting host?
dmesg is available on Mac, yes? since i don't use it, i always forget the *nix commands that are still around...
yes -- you need to do sudo dmesg
but it give a lot of info! hard to find what you want
can't you filter it? or is that a grep practice? (i rarely used grep when i spent more time in linux)
in practice you only look at the last few messages anyways
I bet in the end it turns out to be something like a broken cable ;-)
it just taht macOS seems to write a lot more to it that linux
i though linux wasn't unix based
it is
Minix, IIRC.
no, minix is what you have in the intel management module on your cpu ;-)
oh yeah. so many "based on" lore, these days. ๐
what we usually call linux is the linux kernel plus gnu tools, and "gnu" stands for "gnu is not unix"
for the record, I run an AMD...
but the whole thing is very much based on the unix philosophy
at least it was, until systemd came
systemd ?
the service that runs all other services on linux
it was not a well received addition, from what i've read.
it's an ugly monolithic blob
very much against the unix philosophy of doing one thing and doing it well
definitely more akin to windows (service host)...
and ios
now you are just being mean ๐
lol. it wasn't meant that way. i don't partake in the L vs W vs M game. I can respect each for what they do and achieve.
I just added a chromebook to my collection -- so many ways to get confused ....
@marble hornet did dmesg give you any hints as to why it won't mount?
i thought about a Chromebook, but couldn't justify any use case.
that price point is nice though.
@solar whale An upcoming (no word on when) update to Chrome OS will add Wayland and a virtual machine running Debian Stretch so that linux apps will run on a Chromebook. It may not be compatible with all Chromebooks, though.
@wraith tiger nice! I am having fun exploring what is /is not supported -- too many apps - so little time ๐
Linux is a Unix "work-alike" based on the concepts of Unix, but not the code.
I've been playing a bit with an HP chromebook. It's nice that android apps are now supported, but it will beceom much more usefull when there is linux app support.
if the error happened after i unplugged it could the bootloader have been corrupted in the section that executes the uf2 but not the one that updates the firmware?
It is possible to run linux natively on a chromebook, either by replacing Chrome OS or by adding dual boot.
Some chromebooks have upgradable storage, but they seem somewhat rare and are pricier.
Linus Torvalds was a Minix hacker before he started Linux, so that's where the Minix connection comes in.
it magically started working!!!!!!!!!!!!!!! WHAT!
ruh- roh
ha-ha
all i did was plug in the jlink
What trickery is this? bit and byte peek-a-bOO?
have you burned the bootloader onto it? (can't remember if we covered that)
we did, with the help of @solar whale
k. so much for "easy answers". ๐
๐คฆ
So I made a python sprite class for animating neopixel strips from BMP files, someone told me Roy might be interested. https://forums.adafruit.com/viewtopic.php?f=60&t=137332&p=679948#p679948
If it's useful I can share to GitHub, but alas... as this is my first python code and haven't done anything with adafruit contrib I would need help on the devops part. Ping me if interested
"Sounds like a cool idea! I'd suggest hopping into the Discord and the #circuitpython-dev channel. (https://adafru.it/discord) Roy there is doing NeoPixel optimizations and would likely want to collaborate on animation libraries."
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
do j-links do some kinda SUPER hard reset?
@sharp rain Roy is working on the C side with NeoPixels/DotStars. For the Python side, it would be more analogous to a library. And I imagine the community would be quite interested. You can check out this learn guide for how to share a library to the community bundle: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview
@marble hornet that I'm not sure of. there may be some sort of SWD command it is sending that gets it across some hurdle... ๐คท
so i think i figured out why the M4 is "less" accurate than the M0 for TC frequency capture. The EIC latency. For the M0, it is 3 clock periods (no filter, async). For the M4, it is 5 clock periods. Now...to figure out the math for correction (approxmation).
in my early math, i lose resolution in the upper ranges. ๐ฆ
#stayinschoolkids
Hi! I am working on an embedded project that would greatly benefit from using python for embedded sensors instead of C++ or Arduino. I have used the Micropython firmware on the ESP8266 platform and would love to use it on the SAMD21/Feather M0. My question is how one might build a port of circuitpython that removes all the extras such as filesystem mounting, REPL etc to create a minimal firmware image much better suited for devices in the field.
The goal would be to provide pre-compiled by...
i'm looking at the m4 metro schematic and do any of you know what the tcc and other text next to the headers are?
tcc is the timer controller
it's a bit specific to the samd architecture, it lets you assign timers to pins
the datasheet says that pcc is the parallel capture controller, so logically, it must be a peripheral that captures signals on a whole range of pins in parallel
it says it can do up to 14 bits at once, which would match the D0-D13 range
thanks!
I just did a brief M0 timer with interrupts project today.
https://github.com/wa1tnr/m0_timer_standalone
That'll demo on any SAMD21 target Adafruit stocks, most likely.
(including crickit, haha)
/* ideas sourced from MartinL on forum.arduino.cc */
/* [ http://forum.arduino.cc/index.php?topic=332275.17 ] */
You are probably going to run out of RAM before flash becomes an issue. The best way to save RAM for program space is to use frozen modules. See https://learn.adafruit.com/building-circuitpython?view=all#adding-frozen-modules for how to freeze modules into the CircuitPython firmware.
In addition, consider using our M4 boards, including the Metro M4 Express, the Itsy Bitsy M4 Express, and arriving very soon, the Feather M4 Express. All have 256kB RAM (instead of 32kB on the M0), and 512kB f...
Sorry for the delay in responding - please see my findings below;
I tried suggestion 1. erasing circuitpy, but got the same behavior when copying the 3.0.0-rc.0.uf2.
I then tried this again with a windows 7 laptop and a freshly downloaded 3.0.0-rc.0.uf2 file:
The windows 7 PC did not freeze, but after copying the file to METROBOOT the CIRCUITPY drive would not appear (tried re-setting the board etc.), so there is still a problem. I doubt its related to drivers as this was a differ...
After you try on the Macbook, assuming it still has a problem, let's try updating the bootloader: you have a fairly old version. Drag this uf2 to METROBOOT, and wait for the flashing to finish and the red LED to start pulsing agin
https://github.com/adafruit/uf2-samdx1/releases/download/v2.0.0-adafruit.5/update-bootloader-metro_m0-v2.0.0-adafruit.5.uf2
Then you'll have to reload CircuitPython.
Is this the only CircuitPython-capable board you have, or do you have any others that seems to ...
what would be the best way to create enums in CP?
if I do
class MyEnum:
Val1 = const(1)
x = MyEnum.Val1
x is just equal 1 where I would like it to equal/print MyEnum.Val1
Hmm, sounds icky ๐
why
Dunno, just using strings for constants where a int would suffice
it's converted to an int internally
hmm, maybe I'm misunderstanding then, could you give me a pseudocode example?
hmm, then no protection for misspelling when i try to compare?
protection?
>>> x == 1
True
>>> x == MyEnum.Val1
True
>>> x == MyEnum.Vat1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'MyEnum' has no attribute 'Vat1'
Python is dynamically typed, you get no compile-time type checking
how is that "protection"?
your program still crashes
yeah, if i used strings then x == "MyEnum.Vat1" would just return false causing a silent bug
write tests then
or switch to a statically typed language
I've heard Rust is getting SAMD21 support
heh, that's not that welcoming "oh, you don't quite like one feature, just switch languages" ๐
it's not like it's just one feature, it's the whole philosophy of dynamic languages
Never used Rust, heard it's nice though
it is
I guess I was just a bit confused cause it seems doable from native code, for example:
>>> y = digitalio.Direction.OUTPUT
>>> y
digitalio.Direction.OUTPUT
So I was wondering if there was a way to do the same from pure python, but maybe not
sure, you can define a five zillion classes
and define __repr__ for them
but it's wasteful, unnecessary and unpythonic
there was a PEP in recent versions of Python 3 that introduced an enum type
Hmm, I guess you're right, implementing __str__ would allow me to achieve the print effect that I want but there's little gain from that
I guess what you want is the ide autocomplete?
Nah, I get that already with just a class with a const, this was more just to have nice prints while developing and debugging
i am trying to make a pogo based swd programmer and want to make the pads / holes as small as possible. the adafruit website says the the shaft of the pogo pin is 1mm in diameter. is there a rule of thumb on what diameter the drill size should be to insert the pogo pin?
https://www.adafruit.com/product/2429
???
for bolts I usually leave 0.1mm on each side
you can also do pads and solder the pogo pins horizontally to them
helps to have some sort of rig to hold them straight while soldering then
thanks!
if i was selling a board w/ the uf2 bootloader would i be allowed to use the term "express"? has adafruit copyrighted it?
as long as you don't use the name "adafruit", you can do anything, afair
I have a problem in my circuit python code, I think a second set of eyes could spot the problem without much trouble. Should I post here of go to the Adafruit forum? I have a series of nested if statements that I believe are causing the issue.
@rigid path itโs fine to post it here. I wonโt be able to look at it for an hour or so. Others may be available. Sundayโs can be quiet.
The code is, I think fairly well commented... In a nutshell, I have an M0 Express Feather, with an OLED and Ultimate GPS Feather Wings all loaded on a Feather Tripler. I use the OLED as a status indicator for the GPS unit, and as individual parts, everything works fine. My final goal in to have the OLED flash a couple of different messages as the GPS is getting a fix. Once a signal is acquired, change the display to a Connected message. Now if the user presses one of the 3 buttons on the OLED, they get a different set of GPS data. Maybe Lat/Long on button A, altitude/speed on button B and other misc data on button c.
My problem is I have several nested if statements and I think everything is going pear shaped around line 84, where I change the flashing message to let the user know a signal has been acquired. Though the GPS pickups a connection, the display stays with one of the connecting messages, and the buttons are not changing anything.
I know the GPS is connected as the LED on the unit slows from 1 flash per second to 1 every 15 seconds, or so.
first of all - get rid of the "continue" statement in Lin 81 -- -I htink it causes the code to skip the rest of the code.
unless that is what you want it to do. I may have misread it.
@rigid path gps.has.fix it true, then you want it to do the stuff bleow line 81, correct. I think you wan to use "else:" instead of "continue" and indent! I waiting for my GPS to get a fix to test it.
Yes, when it gets a fix, I want to do the rest of the code.
@rigid path ok -- simple change -- her is a new version -- note yo have ot hold the button for a second in order for it to be detedcd.
change continue to else
@rigid path seems to work -- I'm sure you will have a few changes to make but it is working
You mean the A, B and C buttons?
yes - it only checks them once per second.
use the gamepad module
Got it. Wow, simple fix. Thanks.
You're welcome - looks good --- I have to run!
@rigid path as @stuck elbow pointed out, there are many ways to handle buttons, If you need very quick response, there is a "gamepad" module the may help. They may not be necessary for your application. you just may want to think more about how you are testing for the buttons. You could test the buttons more quickly than you check for the gps.update. use 2 different counters.... experiment.
it allows you to read the buttons less often, beacuse it buffers them
looks great - I have not tried using it yet, but will now!
will it fit in memory on an M0 with OLED and GPS ?
it's built-in
so no extra memory
(not sure if it's enabled in non-express boards, though)
He is using an M0 express - should be fine.
@stuck elbow Wow - it is very nice - and easy to use. I guess I was not paying attention when it got added. I was thinking it was just for complex gaming stuff. I'll never read a button again!
thanks :)
is there a way to 100% force halt a atsamd51j cpu?
Hmm, so when using SPI.configure the speed is called baudrate but to get the speed of the bus one has to use SPI.frequency, seems like an inconsistency in the API, was this done on purpose?
b/c mine keeps on failing to burn the bootloader b/c the cpu can't be halted
I've not got my hands on a macbook yet, but I did update the bootloader as per your instructions. Unfortunately I'm still experiencing the same behavior.
I've got a GEMMA M0, so tried the 3.0.0-rc.0.uf2 for that board and got the same problem with the keyboard and mouse freezing on the windows 10 PC. On the GEMMA I noticed the buit-in dotstar LED flashing blue about 8 or 9 times in succession - does this help?
In your first post, you had a main.py that blinked the red LED. I assume you don't have that running in most of these tests, but when you did, did the main.py run and blink the LED even when the host was frozen?
If you can watch the dotstar on the Gemma and record the pattern, that would be interesting. blue means that the initial boot sequence is running, but it shouldn't blink. You might see blue for about 2 seconds, and then you should see a pulsing green. This is the key for interpreti...
The sequence of the flashing dotstar LEDs on the GEMMA M0 is GREEN(x1), CYAN(x1), BLUE(x9).
main.py has the following code;
`# Gemma IO demo
Welcome to CircuitPython 2.0.0 :)
import board
import time
from digitalio import DigitalInOut, Direction, Pull
from analogio import AnalogIn, AnalogOut
from touchio import TouchIn
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import adafruit_dotstar as dotstar
One pixel connected internally!
do...
sorry that didn't paste in very well - its the standard demo code that came pre-installed.
If I want to run 4 led strips with the possibility of adding servos down the line is a Gemma the way to go? Or should I use 2 boards one for led strips and 1 for servos.
@indigo wedge it is kind of inconsistent, but not sure we can change that now. Note that the input baudrate may not match the actual frequency because of clock division granularity. The input parameter should probably be called frequency too.
Woohoo, 144 element dotstar strip aceleration ~4x with the test dotstar pixelbuf code.
@proven laurel Gemma only has three data pins, and they are limited in what they can do. You could use a Feather or an Itsy Bitsy and have a lot more pins.
@ruby atlas did you see @sharp rain 's earlier post? I recommended you two connect
@plucky flint I'm in the research phase in terms of API. if you could recommend games to port I could start there. From the first few glances I've had at pygamezero it feels too magical to me (WIDTH and HEIGHT specifically.) I've focusing on fantasy consoles atm. May port Celeste to Gameboy too and see what API comes out.
I don't really like having more than one way of doing something in the C api. Can you subclass it in Python and add an additional property instead? My goal is to use Python for the friendly API layer.
We haven't really targeted a production environment with CircuitPython. However, we'd be happy to accept and pull requests for improvements you need.
If you are doing battery power then you'll likely need to improve the power usage as well. We haven't looked at it at all. Thanks!
b47a67d nrf: Remove machine, pyb and utime modules - arturo182
97f1024 nrf: Fix default board after feather52 rename - arturo182
7cd34f2 nrf: Cleanup Makefile after nrf51 removal - arturo182
5509f39 nrf: Add a nrfx submodule and prepare for using... - arturo182
ff91855 nrf: Simplify the board makefiles - arturo182
@stuck elbow rust stuff is here: https://github.com/wez/atsamd21-rs
Woo, thanks Scott ๐
I have more changes already brewing ๐ Yesterday I worked on getting SPIM3 working with nrfx on the nRF52840 because that one is the only one that can clock 32MHz, until I realized that I'm using engineering samples that don't have SPIM3 working, need to wait for new chips ๐
I was actually thinking about this the other day, since polling and not interrupts are the CP way of working, it might be hard going to deep sleep, usually it's a external interrupt that wakes up the device, but in CP it looks like the device has to periodically wake up to see if anything happened and then decide if it should go back to sleep or act on the events.
To prevent confusion, maybe we should adding a macro inside the feather52840/mpconfigboard.h to switch the pin map, the board name is still feather52840. Once we got the production board, we will remove the pin map of pca10056 (inside feather52840/mpconfigboard.h)
Sounds like the least invasive way to do it, I like it :)
I'm not that far behind you, Adafruit ๐ https://twitter.com/arturo182/status/1011225347566784512
I did add it to adafruit_seesaw.pwmout.PWMOut, as .fraction (less verbose). It's convenient for the crickit library. That's enough for now. I'll close.
@sharp rain Sounds very interesting!
I would say make it two boards so that we can compile for either even when the feather shows up, just by doing BOARD=. We did something similar when we had two revs of the Metro M4 for a while with different pin mappings.
@sharp rain is your stuff in C (to extend CircuitPython), or a Python module?
yah - i think we will have people using both the pca DK and the feather52840 so having two board definitions is good.
for example, i plan on putting together the feather PCB this week but will still be using the DK for testing shields since it is arduino-shape and has JLink built in.
so having both is good :)
here's the rev B Feather52840 pinout:

so we will have feather52840 and feather10056 !!! Please pick an name for feather code on dk. I am really bad at naming ;(
80d16cb add pins D3/D4 to pins.c - jerryneedell
5fb4cdc Merge pull request #949 from adafruit/jerryneed... - dhalbert
b47a67d nrf: Remove machine, pyb and utime modules - arturo182
97f1024 nrf: Fix default board after feather52 rename - arturo182
7cd34f2 nrf: Cleanup Makefile after nrf51 removal - arturo182
you can call it pca10056: that's the Nordic Semiconductor name for this board
@dhalbert ah thanks, I was thinking to leave the current pca10056 board as it is since I am not sure if it is used by others.
haha - i think the only people using it are here in this thread so it is no problem :)
how about we keep the names but just make sure that the pinout for pca10056 board is only for pca10056 and then feather52 will match the schematic above? sorry it is so confusing but now is a good time to fix it! :)
Ah yeah, that is much clearer. Will do it asap.
<@&356864093652516868> meeting in a few minutes!
๐
indeed lol
More accurately, I forgot what Monday meant
full inbox and nothing works
Hug report: Everyone, as always. Now that things are moved around, I should be able to peek at actual specifics more often
@indigo wedge hey those modules look familiar!
@ruby lake m4 feaths being made this week
I'm running an Astatic 1104C desk mic today.
hug report: pt @river quest for weighing in on my comments about content discovery on Sunday.
@meager fog wheeee
Group hug plus everyone who wrote the documentation, forum answers, etc that I consulted while working on uflash.
@jerryn, @Andon, @deshipu for the support they've engaged in on Discord and GitHub. I may have missed mentions for others; I blame "Monday brain". @arturo182 for the nRF cleanup; excited to see that port getting attention. Group hug beyond that!
offhand q, is there a roadmap for getting ฮผpython's hardware timer stuff into cp?
@ruby lake timers are so different form chip to chip, we sorta punted. do you need like precision timer access?
@meager fog I want one timer I can set to say 1ms ticks and call a function from it. time division mulitplex of voltages is 10000% easier with that ๐
polling the timer is also acceptable
Status Update: Things moved. Many things, including my PC. Plus side, I have a setup I can use for Show and Tell. I also have some EL Wire in the mail I will be doing fun projects. Pic is new computer desk setup.
IS that the bridge of the Enterprise?
you forgot your head
Featuring Creepy Mannequin Head
Er, bridge, rather
@cunning crypt how many pixels?
1920x1080x6 = 12,441,600
@ruby lake oh we dont have any callback support at this time to start with :/
Currently, the top/right monitor isn't connected, but the part to fix that should be delivered... soon.
@meager fog I have other ways to get it to work, will just an eight-channel SPI dac
~just use
@cunning crypt very cool. i have about 15MP on 3 displays - and still run out.
An easy to build spider robot kit.
@stuck elbow looks awesome, nice work!
@idle owl You needed a screen-ing process
If you change the screen resolution to 1024x768 or smaller fonts get automatically bigger (at least in Linux)
320x200 ftw
I'd bet you could script screen grab post processing with GIMP.
status report:
Did a lot of experimenting with git and github this week, and found a means to synchronize the branch to master (in terms of number of commits ahead or behind) on stackexchange.
https://stackoverflow.com/questions/34118404/what-i-can-do-to-resolve-1-commit-behind-master
Being able to sync allows me to experiment more freely without worrying so much about consequences.
@tulip sleet 's suggestion to try gitk was apropos.
gitk allows me to gain good visualization of the state of my local git repository, prior to any commit.
Looked at diode clamping protection of port pins (again) this week.
I'm in the process of distinguishing placebo from useful protection.
@timber mango Can definitely understand you clearly. It does make you sound like you're on a HAM radio, but there's no issues in understanding.
Gui tools are helpfull, too.
โCPX touchtone synth with MakeCode project video + learn guide
โNew CPX CAD model update on github https://github.com/adafruit/Adafruit_CAD_Parts
โReleased SVGs on GitHub for iron-on vinyl apparel https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/Circuit_Playground_Papercrafts/Vinyls
http://adafru.it/1824 for touch-tone pad. ;)
Dotstar too
@twin mica maybe model rocket engine ignitors? (to make fireworks go)
Can the function of the reset button on an Ultimate GPS Feather Wing (or any wing) be reassigned? Instead of resetting, I want to have the setup write data off to an SD card when pressed. Playing with an M0 Express Feather and an Ultimate GPS and an Adalogger Feather Wings on a tripler.
@ruby atlas Super exciting!
@rigid path Typically, reset buttons are tied into hardware resets
Looks fancy!
@tidal kiln huh good idea, i think i saw some at hobby lobby
@rigid path it is hardwired to the reset pin: see https://learn.adafruit.com/adafruit-ultimate-gps-featherwing#downloads
๐
@rigid path If you want to do some hardware hacking, you could make sure the reset pin is physically non-present, and then run a wire to an unused GPIO pin. Not sure which ones that is on the UGPS Wing, though.
glossary: GUI graphical user interface 'gooey'
FrequencyIn Module: I abandoned using COUNT for the time being; MP_OBJ_NEW_SMALL_INT was giving me too much grief, post math. Working on accuracy, as I believe it is largely tied to the EIC latency. Currently catching up on all the math I never did/paid attention to. Hug report to Kahn Academy? ๐
Debating on picking up a nRF52840 Dev board. Who am I kidding; it's not a debate....
Little Leslie amp: Spent some time on this over the weekend. Salvaged a surround satellite speaker, which include a 1" tweeter, 3" mid-driver, and crossover. The Crickit's amp drove them very well. Started a SketchUp for the cabinet, and brainstorming on the rotating bits. Fighting feature creep is tough...
roy: excellent audio
@timber mango $10 usb audio adapter with a $200 gaming headset.
That mic is excellent!
@cunning crypt @tulip sleet @cunning crypt - Thank you for the info. I was just being curious, I think I will just wire in a button.
That's honestly probably the easiest way
If you stack the GPS feather on the MCU (to expose the antenna to the sky) that reset button can save your bacon when you need to flash the target board when it gets into a state where only the RESET button will wake it up.
NPX:TNG
<@&356864093652516868> I'll be finishing the Code of Conduct this week. Please feel free to add any further feedback in the next couple of days. Thank you! https://github.com/adafruit/Adafruit_CircuitPython_Code_of_Conduct/pull/3
I definitely like the idea of a single RGBLED library.
And "Soon" has arrived. Parts have been delivered, I'm dropping out of voice chat. Enjoy, everyone!
Have fun @cunning crypt!
@ruby atlas https://github.com/dastels/circuitPython_dotstar_featherwing/tree/master/dotstar_featherwing
@tulip sleet @slender iron did the ESP8266 fix also get merged into master - or just 3.x?
branch!
@idle owl oh cool, that uses adafruit_dotstar directly so it would benefit from pixelbuf automatically.
later folks, nice chattin'
@solar whale 3.x only but I will merge over to master
Is this meeting listed for showtimes? ;)
@tulip sleet thanks!
Thanks everyone!! Finish Monday strong! Naptime must be earned.
๐
Back to works for me. Later folks.
Had to miss the meeting today. That load of decorative rocks just isn't moving itself out of the driveway fast enough.
@errant grail You were busy with a rock concert?
Hugs to the entire CPy team. Working on a CPy Circuit Playground Express learning guide but found that my verbose code couldn't move to 3.0.0 rc without a complete rewrite.
3.0.0rc took away about 4k of program space compared to 2.3.1
back to part 2 of my midi article
My guess is that the CircuitPlayground library for 3.0.0 is somewhat bigger. I do like the sound file playback in 3.0.0 better!
Rocking out the driveway?
Hi, sorry I'm late, I'm working on porting the nRF to nrfx drivers and continuing to bring up my project. Also I just got 32MHz SPI working on nRF so that's nice ๐
The rocks just don't roll themselves into the beds.
@indigo wedge awesome! I'm excited for the nrf stuff
Giving a talk this Thursday at our Makerspace. They want to see CircuitPython in action.
BTW, the documentation link on https://github.com/adafruit/Adafruit_Seesaw points to a nonexistant page (https://adafruit.github.io/Adafruit_Seesaw/classAdafruit__seesaw.html) it should point to https://adafruit.github.io/Adafruit_Seesaw/html/class_adafruit__seesaw.html.
@errant grail I just gave a talk at the Boston Python goup. By far the best part was displaying REPL or editor side-by-side with an overhead camera showing the board(s).
@wraith tiger thanks I will fix that. I saw that but could not find the right link
You're welome.
@tulip sleet Yup. That's the plan. I have a variety of M0, M0 Express, and Metro M4 Express boards to demonstrate along with a wad of neopixels.
btw can someone add a BT reaction icon? ๐ https://commons.wikimedia.org/wiki/File:Bluetooth.svg
@indigo wedge do you have any toughts on https://github.com/adafruit/Adafruit_nRF52840_Bootloader/issues/4#issuecomment-400063538
Dying for a m4 feather here
I need a couple ๐
@ruby lake Are you making a pillow?
crow feathers ๐
....Now we need some sort of device that lets several feathers talk to each other. And it needs to be called a pillow.
module playground v2, more analog I/Os, need the memory space of an m4
my key assigner code successfully ported to cp
usual method of setting keyed outputs is to have a timer event pull outputs from result list and stuff them into hardware (DAC, gate) slots. I will have to use direct outputs for now.
<@&356864093652516868> Here is the recording from today's meeting: https://youtu.be/a1TgF5gysXc
Notes with time codes are available here: https://gist.github.com/tannewt/4ab866875b07cfaf78039bc1d8edeed7 Join here for the chat all week: http://adafru.it/...
Doing just fullscreen fills, i get 22 FPS on the nRF52840 with 32MHz SPI ๐
@indigo wedge with ili9341?
yep, 320x240
I modified the WIP C driver to use a 256 byte buffer cause sending one pixel at a time was way slow
that's decent, though at 32MHz you should have ~200 FPS
no, wait, divide that by 8
25
so close
does it have DMA on the SPI?
it does but i'm not using it for now
you would need two buffers for that, probably, to fill one while the other is being sent
though for just filling the screen with a single color, one pre-filled one would be enough
IIRC nRF DMA has a way to specify linked buffers for SPI, so can have more than two being juggled
if you could link it to itself, it could be super-fast :P
With a larger buffer I get 24FPS
that's probably as fast as it can go
yeah, there will always be some overhead
I've spent 2h yesterday fighting with SPI to get 32MHz working until I realized I was using the ancient engineering samples where 32MHz mode was broken ๐
Hi, on the GEMMA M0 I renamed the main.py file. The PC still locks up after the 3.0.0-rc.0.uf2 file is copied to the GEMMABOOT drive, but now I get a green heartbeat on the dotstar LED, instead of blue blinking.
I also tried switching off kaspersky, but that did not make a difference.
Still waiting to try this on a Macbook.
Yay! Raspberry Pi and Feather M0 Express are talking via Lora !! ๐ป
Nice!!
I've checked this on a Macbook now, and can report that the 3.0.0-rc.0.uf2 file works: the CIRCUITPY drive appears and the Macbook operates normally. So it seems that this is a problem affecting windows, but not Macbooks.
@tidal kiln (& @idle owl) HT16K33 PR review incoming. I've got a couple "nit picky" things. Nothing serious; documentation.
Ooh almost missed a sneaky upstream!
@timber mango btw just getting back to your comment about audio quality: https://www.massdrop.com/buy/massdrop-x-sennheiser-pc37x-gaming-headset and a Syba SM-CM-UAUD (Cmedia chipset).
The mic is at just the perfect distance, and it has a handy dandy volume knob on the headset.
gaming...
Makes it easier to keep track of what's left to rewrite.
I got it because it's basically a sennheiser 59x series with a mic on it.
@hotcarrier Which clock board are you using? Can you show a failing code example?
I'm guessing that it may very well be something you have installed on both your Windows machines that's getting confused. Perhaps go through everything that's installed and see what's third-party and common to both machines.
Another user had some monitoring software called "AIDA64" that caused trouble: https://forums.adafruit.com/viewtopic.php?f=60&t=135400
Also, as I mentioned, 3.0.0 newly supplies a gamepad HID device and a "consumer control" (media keys) device. It's possible you ha...
@indigo wedge are you doing nrf dev on Mac or Linux (or Windows?) hathach and I both are having trouble using the CDC device presented on the PCA10056 port on Linux and I wonder if you're seeing the same thing (if you're using Linux). See https://github.com/adafruit/Adafruit_nRF52840_Bootloader/issues/7#issuecomment-400126713 and above
@idle owl @raven canopy thanks for review. made some updates. back to you.
I rebased my fork to the latest uflash version and made a new release: https://github.com/ScottDWebster/uflash/releases/tag/1.1.3sdw0
@tidal kiln @idle owl is there more stuff coming for the HT16K33 library? didn't want to push a release if there is...
@raven canopy yep. i'm trying to chip away at the other issues as well. not sure what's best for when to draw the line on pushing a release though. probably best just to ask @slender iron
Superb, I think we should re-implement all the driver with nrfx. So that we don't need to maintain it ourself. I will help later on after the usb boot things. Their prph code isn't opensource friendly at the start and too tightly couple with sdk until recently.
@tulip sleet do you mean the cdc from jlink or the bootloader?
I'm using Linux Mint and have no problems with the jlink one but have not tested the bootloader for the nrf port yet.
@ladyada I making bootloader hex for feather52840 (accoding to your schematic). Could you tell me which pin to force DFU and which pin for FactoryReset
@solar whale I was listening to the weekly meet...i thought i heard you mention challenges getting SPI on Rasp Pi to work? (I apologize if I misheard). I've been happily using my Rasp pi port of Tony's RFM69 python library using SPI...wrote stuff up in this wiki in case it is of any use...https://github.com/BitKnitting/should_I_water/wiki/RFM69-on-a-Raspberry-Pi
I'm getting this.... issue(?) when checking for errors in Mu - is there a limit to the number of characters i can have in a line??
ah, ok ๐
another question then; is... this right?
if cond = false is what im doing, why is it telling me i should be doing what im doing?
am i wrong, or is the warning?
Toggles[] is an array, if im understanding this right...
"==" and "is"
"is" is an operator
but it's best to write if not Toggles[keyindex]: in this case
the == False is spurious
it's like writing if (((x == True) == True) == True) == True:
instead of just if x:
ah, fair ๐ thanks
@indigo wedge I mean the jjlink CDC: connect to the USB port on the short side of the board after CircuitPython is loaded. With screen, picocom, or minicom, I type and get no input echo: nothing happens. If I press reset I see part but not all of the startup prompts. See https://github.com/adafruit/Adafruit_nRF52840_Bootloader/issues/7#issuecomment-400048531. Not sure if this is fixed by newer SDK or it is a jlink software problem. I see this on Ubuntu 16.04 or 18.04 (Mint should be similar). As hathach mentions at the end, this will become a moot point.
Hmm, that's odd, I connect to the jlink usb connector and use minicom without any problems.
But as mentioned, I don't use the adafruit bootloader just yet so unsure if that changes things
Good day, I am new here. Just ordered some devices from Adafruit on last thursday and got it yesterday here in the Netherlands. So today I started a test with cirquitpython, and I think it is great. I made a test with a Metro Express M0, a si7021 sensor and a oled 128x64 display. In my program I first write a header and a footer to the display and then in a while true I refresh the data. So I must clean the area for the data, and did that with some for loops. Is that a good way? or is er a better way to controll the oled display: https://github.com/WimAlsemgeest/cirquitpython_M0_temp_hum_oled
@indigo wedge that may indeed be the problem, but I don't know enough about what the bootloader is doing to understand why that would matter.
@latent nimbus There's an oled.fill() method. old.fill(1) will turn all the pixels on; old.fill(0) will turn all off.
hrm...might need some help and very new to programming....I just got a adafruit feather M0 express with the DC Motor + Stepper FeatherWing to control a nema 17 motor for a filament rewinder project. Thinking of using some switches for power, forward and reverse and potentiometer for speed.....how would I do this in circuitpython or would arduino be better?
or should i ask this under a different topic sub channel?
@tulip sleet Yes I saw that, but I just wanted to clear a part of the display.
@scarlet fjord [we're moving over here from #help-with-projects].
yep thanks ๐
ive just been working on it while you caught up with everyone else ๐
@latent nimbus ah i see, sorry. We are going to improve the library, which is fairly weak now: we need to do some work on the underlying framebuf library. But your way is fine for now. Or you could draw the outlines once, and then write the proper number of text spaces inside your headers to clear the text and leave the lines alone
idk what i did differently, but when i went and changed all my variables to lower-case, it started working ๐
so im plugging in some more buttons to test it properly
what editor did you say you're using?
im working in Notepad++, but im copy-pasting it all to Mu and saving it to the main.py file there because im difficult ๐
ah, ok, I was going to mention it's important to use an editor that writes completely each time, but mu does: https://learn.adafruit.com/welcome-to-circuitpython?view=all#1-use-an-editor-that-writes-out-the-file-completely-when-you-save-it
oh cool, yeah the tutorial said to use Mu so i am, but im not 'working' in it ๐
also follow up on what you mentioned in #help-with-projects - how do i see results from print("")?
like, where does it print to
Mu has a Repl thing, but it doesnt show anything and idk what it is ๐
@scarlet fjord what version of mu is it?
1.0.0.beta.15-adafruit_b142c3, according to the header bar in windows
there is a newer version (now available at https://codewith.mu), but I believe that one should show the repl. It is the "Read Eval Print Loop", where you can type Python and see the results, and where print statements go.
if you click the REPL button, a smaller subwindow should open at the bottom. Leave it open and that's where the print statements will show stuff
oh ok, maybe i just havent seen any of the prints, but ive had that open this whole time ๐คท
oh my god is that why its been not working?
ive been copy-pasting
so ive ctrl-c'd a lot
i see the '>>>'
how do i start main.py up again
ctrl+d
that seems to duplicate the current line...
Add latest 3.x fixes to master:
- ItsyBitsy D3/D4 pins
- ESP8266 filesystem fix
@jerryneedell - test if you'd like
eyyyy ok no i did not
i just downloaded the newest version and when i opened the 'serial' window (which replaced the 'REPL' button in the version i was using before) it prompted me to do ctrl-d and then i saw the error i wasnt seeing before!
there was this thing where, on one if the files somewhere, it showed a 'D13' being imported but not used
it didnt throw an error when checking in Mu, but the REPL showed an error for it about an array out of bounds and now it works ๐
ok, great!
still havent truly tested it with more buttons, i only just now managed to pry some key caps off my old keyboard so im plugging them in now ๐
woohoo! it works ๐
four buttons, four keys registered on the PC!
thanks a bunch for your help ๐
nice switches, are those gaterons?
nah, Cherry MX Red RGB ๐
ah, so Cherry now also makes transparent switches, nice
id like to get like... 1 or 2 of each different kind of switch... Cherry, Gateron, Kailh... and see what ones i like before i finish this, but at the moment i just have these ๐
yeah, that keyboard in the background of that shot is all Cherry MX Red RGB
linear + RGB = ๐
though afaik Corsair owns the rights to all cherry rgb keys, which.... sucks, tbh, but it means were getting a lot more competition from other companies, so maybe cherry will up their game haha
I absolutely love my Kailh PG1350
obligatory code screenshot ๐
one hint, it's traditional in Python to name variables with lowercase, "like_this", class name with camel case, "LikeThis", and constants with all caps, "LIKE_THIS"
it doesn't matter for your own code, but it does make it easier to read for others
noted ๐
i dont come from a programming background so this is all very new to me ๐
that's basically just nit-picking, so don't worry
haha ๐
so variables = snake_case
classes = CamelCase
idk what a class is, but im learning ๐
variableNamesAsLongAsYourForearm
question:
on this tutorial - https://learn.adafruit.com/arcade-button-control-box/software
is pin D13 used anywhere? i think thats where i was getting thrown off and i cant tell if it was because i messed with it too much or what ๐
Mu complains that 'pin D13 is imported but unused', so I, being me, added pin D13 to the buttonpins array, which of course would break it
doesn't look like it is, I guess they just imported all the pins
personally I prefer to do import board and then do board.D13 instead of D13 and so on
i suppose thats a bit like the argument import time then time.sleep() vs. from time import sleep then sleep()? ๐
i can see that.
me though, i like the idea of only importing what I'll use; so im not importing the entire time library just to do sleep, which seems wasteful. unless Python is smart enough to not import things its not going to use, which... wouldnt seem to be the case, if Mu complains about pin D13 ๐
aw, dynobot doesnt like self-deprecation ๐ข
how am i going to do my classic NZ humor ๐ฎ
what i was trying to say is it would be nice if someone edited that tutorial to not import pin D13, cause that confused me when i did 'check' in Mu and saw an error about it and i fixed it the wrong way
@ruby atlas It's a python library that uses the neopixel_write. I'm seeing 1800 pixel / second draw rate on my feather express M0 and memory use is fairly minimal, basically the bytes for the BMP palette and pixels, so for my purposes no need to implement in C
@ruby atlas here's the source code. https://github.com/aaronaverill/CircuitPython_NeoSprite
@ruby atlas it's pretty much done except for more robust examples and documentation. I've used it both with 32 pixel featherwing neopixel matrix for doing simple animations, and on a 150 pixel 5m strip to do animation and chase sequences.
@ruby atlas with feather express and circuit python it detects any changes on the flash drive and auto-reloads so it's wonderful for prototyping - edit the BMP file to change the animation, save, and it instantly reloads and starts playing. Cool stuff.
That should automatically benefit from the acceleration of pixelbuf. awesome. I'll give it a try tonight when I get home. Thanks so much for sharing that.
At least I believe so.
Oh, I missed that you use neopixel_write directly. Hmm. That means it doesn't do dotstars yet.
I definitely want to look closer ๐
@ruby atlas it's a bit of a lie... I use the NeoPixel python library, but I bypass all the methods and blast the pixels into the internal buffer, then call the show() method that writes it out
@ruby atlas but basically, it's implemented by a method "fill bytes" that will fill any python bytearray with the RGB data in the format of the four channel options, so it's easily adaptable
@scarlet fjord you are importing the entire library either way
OK please use P0.15 for DFU (connected to user switch)
i dont have factory reset connected yet so please use P0.19 for now
@sharp rain That makes sense. I'm eager to look at your code later today to see how we could make it compatible with pixelbuf (or extend pixelbuf) so it's portable across device types. Dotstar requires the start/brightness byte before every pixel (plus start 0x0s and end padding 0xFFs).
@ruby atlas fairly trivial to add - there's already support for a channel parameter which specifies the number of bytes to write for each RGB tuple, and how to map the bitmap RGB to which bytes, as well as detection for a W channel if all colors are the same.
@ruby atlas the code should be straightforward. there isn't really any magic. the animation speed comes from:
a. avoiding all the method calls to set the pixel RGB one by one and setting the buffer bytes directly inside the loop
b. avoiding the brightness adjustment calculation inside the loop by tweaking the bitmap brightness once at the start
@ruby atlas I was doing both of these in my first iteration to get it working. When I added these optimizations I saw a 10x factor speedup.
@ruby atlas Moreover, since it's a static array of RGB pixels, you can do things like compute an estimate of the total current required for an animation by adding up all the pixel values once, which it turns out is quite useful.
@ruby atlas And you can create animations in a graphic program rather than in code, which is great when partnering with creatives who aren't techie ๐
@ruby atlas the downside is you can't easily do fully algorithmic animations, but... you've got access to both the pixel buffer and palette as bytearrays, and you can manipulate those. so for example, load an animation file, then tweak the palette to move thru a color wheel. lots of options
Circuitpython on non-Express M0 Feathers... with the reduced storage on the non-Express M0 feathers is there a way to tell which library files I need to load? example: I am running a pair of M0 RFM69HCW Radio Feathers. In the sample code I am playing with, I have imports of board, busio, digitalio and adafruitrfm69 in my code. Is there a way I can determine which libraries I need to load to the Feather? Also is there a way to determine which files in the library folder I need to load?
the documentation for those libraries should mention what the dependencies are
you can also look at their code and see what they import
@stuck elbow - Thank you. Are these on read the docs?
should be in the readme in the library's repo
๐
@rigid path look at the list of modules in sys.modules after all imports are done. I think that works/exists in cp
Its the internal RTC. This came up on the forum: https://forums.adafruit.com/viewtopic.php?f=60&t=137350
The pin changes are actually on master already. No worries though.
de4cd1e add pins D3/D4 to pins.c - jerryneedell
dbf1a2f allow '/' to be mounted on '/' from Python code - dhalbert
5ae8094 Merge pull request #953 from dhalbert/allow-mou... - tannewt
a7d3053 Update master with latest 3.x changes. - dhalbert
dc9e931 Merge pull request #962 from dhalbert/3.x_to_ma... - tannewt
@indigo wedge did you find the nrf micropython PR?
@onyx hinge - TY
@slender iron i didn't check but they don't have the common-hal modules so unsure if it will help much.
yeah true
Also don't want to get too influenced, then I won't know which ideas are mine and which are copied ;)
its all MIT licensed ๐
Thanks for the merges, I have more on the way.
I'm on the phone now so can't read the pr properly
But will check it
@scarlet fjord I am changing the example for the Arcade button box so it just does import board. D13 warning will go away and people will be free to change the example without having to change the import list.
thanks for pointing out this annoyance
@slender iron Would you take out the _read on this? Or is read not quite like get/set: python def _read_temp(self, register): temp = self._read_16(register) temp *= 0.02 temp -= 273.15 return temp
Ok here's the file (still has linting issues):
no pr or anything?
Not yet, the repo doesn't exist yet
@idle owl it's an internal routine, not a property in an official API. I think it's fine. It does an action of reading (like, it calls _read_16()
That's what we're working on right now
Ok that's what we thought but wanted to make sure
I'd suggest making a repo and having a pr for it
I thought temp meant temporary, not temperature
why not do it publicly?
No reason other than it fell into place this way
can you make repos?
Yep doing it now
k cool
It should be called Adafruit_CircuitPython_MLX90614 right? Formatting-wise I mean
yup
@slender iron @idle owl adding a new library, should I use a webhook for RTD instead of a service? GitHub says services are deprecated. And for travis?
but a lot of libraries still use services
yeah, webhook
Yes to webhook.
travis has some newer stuff (App I think) that we haven't switched to yet
so keep using service for travis for now?
what's a good example library with the perfect preferred setup?
I don't know what you mean by service
usually its just enabling on the travis side I think
it might do that automatically from travis
ah, ok, so it showed up when enabled on travis, ok, will check that
on the RTD side, it will give me a webhook to paste?
should we go back and replaces the RTD services with webhooks, or just wait until they say it's going away, fix it?
like in the library above?
I would just wait
or if it ain't broke, don't fix ti
right
np, glad to get it setup
np
Indeed it's broken:
Adafruit CircuitPython 3.0.0-rc.0-25-gd7d132d5a on 2018-06-26; Adafruit Metro M4 Express with samd51j19
>>> import rtc, time
>>> clock=rtc.RTC()
>>> clock.datetime = time.struct_time((2018, 6, 25, 19, 59, 55, 0, 0, 0))
>>> print(clock.datetime)
struct_time(tm_year=2018, tm_mon=6, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=176, tm_isdst=-1)
>>>
The problem is in asf4, replicating samd21 fixes it:
diff --git a/samd51/hpl/rtc/h...
@idle owl https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/232 now suceeded.
Merged.
Tnx. I actually made the fix through the github web editor, since it was so tiny. Rarely do that.
Same, but I've also done it for tiny things. It then messes up my local branch though so if it's anything I have locally, I'll usually still go through the process.
@idle owl so how do I add the library as an RTD subproject? The only project I have in RTD is CircuitPython. I went to Admin->Subprojects, but there's just an empty dropdown for "Child", no place to add a URL.
should I import it as a regular project first?
You import it first. On its own. It'll seem like you're importing it into your stuff but you're not
yeah
ok, got it, I will proceed and whine if it doesn't work.
๐ ok
@idle owl, ok, now it's a subproject, but it's still listed as a top-level project too. ?
Yeah it won't show up anywhere but there as a top level. It shows up correctly as a subproject under CP
I think anyway. Because that's what I've been doing.
so you have a bunch of random library projects and also the CircuitPython project?
Yes.
Excellent
Thanks you adafruit
oops. i broke : display support for the 7 segment. this was previously done with some logic. but thinking of fixing it by now making it a property:
display.colon = True
thoughts?
for ref, it was previously done like this:
display.put(":")
and the only way to turn it off was to fill(0), which cleared the whole thing
Build and tested esp8266 from master - no problems.
hmmm. lemme check. the one i have here only has one. but there may be variation in shop...
looks like only one. and the alphanumeric ones don't have any.
I just built the feather nrf52832 board from master and tried to mount my SDCard as I have routinely on this board, but it failed with:
Adafruit CircuitPython 3.0.0-rc.0-27-g91427b0 on 2018-06-26; Bluefruit nRF52 Feather with NRF52832
>>>
>>>
>>> import sdmount_lib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sdmount_lib.py", line 12, in <module>
OSError: [Errno 19] ENODEV
>>>
Did something change? Or did something break?
Here is sdmount_lib.py
jerryneedell@Ubuntu-Macmini:~/projects/feather52$ cat sdmount_lib.py
import adafruit_sdcard
import busio
import digitalio
import board
import storage
import sys
# Connect to the card and mount the filesystem.
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D27)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
sys.path.append("/sd")
sys.path.append("/sd/lib")
well, the 1.2" versions have 2 colons. and only one decimal point.
and it's not really a decimal. more like an AM/PM indicator.
I restarted the windows 10 laptop in safe mode, and then plugged in the GEMMA M0 with circuitpy 3.0.0-rc.0 installed. The CIRCUITPY drive appeared and the laptop did not lock up, so it must be a driver-related issue. I'll see if I can isolate what is causing the conflict.
Great, thanks! Another person is having similar issues here: https://forums.adafruit.com/viewtopic.php?f=63&t=134698&p=680535#p680503. They also have Kaspersky installed.
@slender iron @idle owl the code formatting in RTD varies from library to library. In the CircuitPython project and in the Crickit subproject, it looks like this
@slender iron thanks. will check into that...
I think we updated the theme on some of them and not others. I noticed that too.
thanks!
My guess was theming. But is the second example from a docstring or is that a .md or .rst or whatnot file?
The difference is that the first is using just theme.css, and the other is using sphinx_rtd_theme.css. It's different defns for <pre>. The first one is actually problematic: the lines are squashed together.
Ok so it is theming.
i looked at the conf.py's but they are virtually identical. one has napoleon, but I removed that and it didn't make a difference. I will force a rebuild on the second one and see if it changes appearance.
Ok