#circuitpython-dev
1 messages Β· Page 208 of 1
@tulip sleet if you get a minute: https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4/pull/7
@slender iron continuity seems fine (cut open a cable, measured to the pins on the ic). No shorts as far as I can tell. sense pin isn't connected to anything.
Can this chunk of code be accurately described as "iterating over the NeoPIxel grid using the width and height values"? python for x in range(trellis.pixels.width): for y in range(trellis.pixels.height): pixel_index = (((y * 8) + x) * 256 // 32) trellis.pixels[x, y] = wheel(pixel_index & 255)
Context: https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4/blob/master/examples/neopixel_trellism4.simpletest.py
how would the clocks be messed up?
@idle owl who's the audience? might be ok to just say "looping"
@tidal kiln People using the TrellisM4 library. It's going into the board guide. A page on using the lib.
use either one
ok. I wanted to make sure I was correct in my understanding of what iterating is. I looked it up, and it seemed like I was, but I wanted to verify with the example I would be using.
for this, same thing, and i'm not even really sure when the difference in semantic minutiae matters
Ok
I think you're right, but iterating doesn't necessarily have to be in a loop
like a generator is kind of iterating too
I think
@idle owl that PR looks boiler plate, did a quick copy-pasta scan, travis is happy, want me to merge?
Yes please
@slender iron I have to admit defeat, have a little breakdown and then go to work π
thanks for your help. at least I know it's running code
ya, I'm with you. I have a similarly frustrating issue
@idle owl done
Thank you!
good luck with yours, ttyl
thanks! you'll figure your issue out with fresh eyes
@tidal kiln @exotic pumice thanks for the input. I used iterate in a general explanation of what to use width and height for, and then simpler wording in the specific explanation of the example.
@tidal kiln - yup, I saw that
I'm running into an issue with circuit python, the gemma v2, and capacitive touch. When I set up my gemma for cap touch it works fine when I touch the pad directly or when I alligator clip into something like fruit, but when I try to attach to some conductive fabric I can't get the touch to respond
@tough flax have you experienced similar issues with i2c pull ups?
and I've seen some tutorials that say to use a resistor to control the sensitivity of the touch, but I thought the circuit python cap touch was self regulating
Not with that sensor
(though now I'm wondering if that self regulation was on the playground express specifically ...)
I've had other issues with them on the relay board
@tidal kiln did adding a 10K pullup solve it?
@uneven yarrow When you first create a TouchIn object, the "calibration" is done by reading the current .raw_value, which assumes it's not being touched. The threshold for touch is then that value + 100
@tough flax unknown. still working that specific forum issue.
You could take some data on this by connecting the fabric, creating a TouchIn, and then looking at the .raw_value with and without being touched, and see what the difference is. You can set .threshold yourself if you want to tune it. But it might just not work very well with a piece of conductive fabric, or a long wire (like more than 2-3 feet, I've seen).
π fantastic! awesome yeah I will give that a try. Thanks @tulip sleet !
ah ok, this is what you're talking about: https://circuitpython.readthedocs.io/en/2.x/shared-bindings/touchio/TouchIn.html#touchio.TouchIn.threshold
ty. I remember reading it when I was building a cap touch jack-o-lantern last month, but I completely forgot about it since then π
@uneven yarrow Make sure you're always viewing the latest documentation: https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/TouchIn.html
APIs change π
(working on my second cap touch related project now)
oh! didn't realize I was looking at old docs, ty @idle owl
bookmarked!
Always check to see that latest is in the URL, that's how you know. And it'll say "latest" down towards the bottom left in green.
I have a lot of 2.x in my history and sometimes forget and wonder why things are weird π
def. I'll make sure to keep an eye out for the version. thanks π
Does anyone know why the M4 products (e.g., ItsyBitsy M4 Express, Feather M4 Express) don't have capacitive touch (or do they)? Is it a library issue or a hardware issue? Microchip site seems to indicate that the SAM D5X line has plenty of it, but I find no mention on Adafruit product or CircuitPython pages, and import touchio fails on M4 feather.
@crimson ferry The way that it works was significantly different than on the M0 and so it didn't port at all. We haven't gotten to sorting it for the M4s as a result.
Thank you. Sounds like it could be a possibility in the future for these boards.
a quick one for review: https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/pull/26
Wasn't installing correctly. We got a bug report on this one in the forums:
https://forums.adafruit.com/viewtopic.php?f=60&t=143138&p=707561
Looks like I let this slip through on PyPI ...
(re: that forum thread @slender iron posted earlier.)
@gusty kiln Merged. Are you good to do the release?
@idle owl procedure is just tag version with commit message as release notes at this point? haven't done one in a while.
@gusty kiln Yeah, minor bump or whatever, and include the "to use this install the bundle, to install use pip, here are the docs" part too. Should be able to edit/copy/paste from a previous release for that if it was done before
cool, on it.
cool -- hooked up a Bluefruit SPI breakout to an ItsyBitsyM0 -- the "simpletest" works -- woohoo!
Bundle add fail. bleh.
ooo...i'm good at that...did i do it again?
No, that's on me.
Tried to add to the bundle before releasing and then didn't bother to read what the error said thoroughly enough to realise that was the issue. Fixing it now.
Just finished listening to the CPY Weekly, +1 on the live review session idea
I guess I should have checked the fancy new Adabot output that would have told me that literally every lib I tried to add did not have a release instead of failing my way through Travis checks to figure out which needed it... π€¦
FINALLY
@crimson ferry correct, its a software issue
I was able to borrow from seesaw to get a single NeoPixel in the array on Trellis M4 operational .. in AtmelStart. ;)
https://github.com/wa1tnr/ainsu-CamelForth-d51-usb/tree/master/boards/trellis_m4_usb/src/cf/bsp
@tulip sleet itsy eraser worked. thanks!
https://forums.adafruit.com/viewtopic.php?f=62&t=143286&p=707580#p707576
@idle owl was the need-release list accurate?
@raven canopy yeah
as far as I can tell anyway, heh. I didn't check all the empty repos. But now the non-empty ones all have initial releases.
So... just thought I'd share. I've spent the week very frustrated. I put a reverse proxy ("edge server") in place in front of my day job's primary servers. I've done this many times to speed things up in my former clients, but this was on a service (and company) that I own, so it was "all me".
And it _just_didn't_work. I mean, everything got slower! It was insane! Server was sitting at 0.1 load, no IO, no network traffic, and yet when we went through the proxy, it crawled. Every 100th request or so would totally time out.
I finally pulled the plug and tried other approaches to fix our growing pains.
Today, I tried to reuse the edge server for a temporary project and downloaded a file from github... it ran at 120K/sec! After a call to the colo, it turns out that the port I had plugged the new server into had throttling set to 1MBit/sec. That was it!
We're back on track and I'm so happy I had to share π
Sorry to be off-topic, but I've really appreciated having someplace with competent people who helped me this week π
do any circuitpython boards have wifi?
@cedar beacon The only wifi support in CircuitPython a t this time is for the ESP8266.
π
hey, i'm working on a project and want to revert my aster to a previous commit, i tried googling but the git bash is giving me this error ```jonah@DESKTOP-39O84BI MINGW64 /d/system (master)
$ git push origin master
To https://github.com/TG-Techie/TG-US.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/TG-Techie/TG-US.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
jonah@DESKTOP-39O84BI MINGW64 /d/system (master)``` after i ran:
git reset --hard
git pull
**i edited a file and added a comment**
git add --all
git commit -m 'who would cross the bridge of death etc'
git push origin master```
You can push -f, or you can use git revert, adding an explicit rollback commit
Push -f probably makes sense in this car. Donβt do it if anyone else might have pulled from the github repo.
βforceβ. Usually implies itβs dangerous
π you can mess up the history so other people's repos are out of sync
this: schedule_secondary_terminal_read just popped us while using mu and a cp device. can i ask what is it?
@umbral dagger hey dave. just checkin' my guidezchedule today - are you planning to submit one? totally no pressure!
I have a few in the works. One on extending CP is nearing "ready to submit".
@umbral dagger just so mike and i know our day - is it likely to be submitted in the next 3 hours? (again totally ok if not!)
ok, finally solved that mux address issue
@tulip sleet Thanks for your help yesterday. I got my MVP working this morning π https://vimeo.com/299450215
@uneven yarrow Watched the video: very nice project! You might want to try the conductive fabric in some jacket or sweater of your own. The fabric will be close to body capacitance when it's worn, so you might need adjust the sensitivity in some way
@slender iron I think I am going to accept arturo's PR as is and then modify it from there ("we guarantee the API will change").
ah cool. Yeah I'll give it a try. Based on the testing I did this morning I figured I'd need to adjust the threshold as I add it to the hoodie, but good to know that it's likely going to change
@tulip sleet sounds good to me
kk, I'll get it up to date and submit a PR
I'm using a DS3231 and compiling the latest version from git- I get RuntimeError: SDA or SCL needs a pull up when I try to initialise the I2C object with i2c = io.I2C(board.SCL, board.SDA)
is the DS3231 actually attached ?
π€¦
@coarse topaz i can see how that message isn't really helpful if you don't understand the inner workings of I2C
@tulip sleet @slender iron should that message be appended with something like "check wiring" or "is device connected"?
@tidal kiln sure! feel free to refine it
d'oh. that's what i get for asking. π
@coarse topaz what do you think? what would be more helpful? keep in mind it needs to be as terse as possible.
@slender iron I don't suppose you have any thoughts on what hardware wise could mess up the usb clock?
@pastel panther does your board have a crystal? this is m4, right? Which board of ours does it most closely resemble. I'd say this is more likely software setup
( on a samd51 board)
it does have a crystal, probably closest the the feather m4 express
@tidal kiln would "no pullup found" be clearer than "needs a pullup"?
but we are running xtal-less because the DFLL is messed up, so any setup code should resemble the metro m4
or feather m4
I don't know if you caught the earlier discussion, but uf2-samd also can't get usb to work
51G
strange thing is it's the same basic uf2 and CP config that I've used successfully with other boards.
@tulip sleet maybe. but also, some text that doesn't require knowing what "SDA", "SCL" or "pullups" are.
maybe "no I2C devices detected (no pullups found)"?
@pastel panther so it's like an itsy (51g)
That's much clearer
but crystal stuff is broken due to DFLL errata; we never tried a 51g with a crystal, I think. is your uf2 board copied from itsy?'
@pastel panther I usually check the clocks by outputting a PWM signal with a known frequency
@tulip sleet I don't recall at this point
@slender iron ok, I guess I can try that
there is some commented-out code that outputs clocks on pins in supervisor/port.c
@tidal kiln Note about initial PRs to empty repos: when you fork it, you need to delete the filler README.md otherwise it defaults to using that one and not the fancy one you added.
@idle owl did i not linux correctly again? i thought i had done that π¦
It doesn't get replaced when you copy because it's a different filename. So it's not a linuxing fail, it's an extra step I think. It was on BMP3XX. No worries. Simply wanted to make sure you knew.
oh...hmmm. i thought there was a README.md in the cookiecutter stuff - so it would replace.
sweet. spa treatment bonus!
π yes
"repos leave clean and refreshed!"
@idle owl @tidal kiln would you like to switch to README.md's in the cookie-cutter in the long run?
i'm fine with whatever. defer to @idle owl
Really the only thing that would do is eliminate the step of deleting the readme.md in the initial PR.
Which I guess might be worth it.
i just mean do you prefer RST or markdown when writing a README?
me too
I don't know what the badges would look like in markdown
(looking at a readme.rst right now)
@pastel panther where is your code?
Welp, figured out how to do the badges in Markdown.
I think it's worth looking into.
@raven canopy When you're around, I want to discuss changing the README in cookiecutter to markdown instead of RST.
@timber mango sitting right here
taps laptop
Haven't checked it in yet but the CP32-M4 board files are pretty much what I used for the new board, but with different pins
$ ag PINMUX_P.*GCLK_IO0
samd51g19a.h
128:#define PINMUX_PA30M_GCLK_IO0 ((PIN_PA30M_GCLK_IO0 << 16) | MUX_PA30M_GCLK_IO0)
132:#define PINMUX_PA14M_GCLK_IO0 ((PIN_PA14M_GCLK_IO0 << 16) | MUX_PA14M_GCLK_IO0)
136:#define PINMUX_PB22M_GCLK_IO0 ((PIN_PB22M_GCLK_IO0 << 16) | MUX_PB22M_GCLK_IO0)
samd51j19a.h
160:#define PINMUX_PA30M_GCLK_IO0 ((PIN_PA30M_GCLK_IO0 << 16) | MUX_PA30M_GCLK_IO0)
164:#define PINMUX_PB14M_GCLK_IO0 ((PIN_PB14M_GCLK_IO0 << 16) | MUX_PB14M_GCLK_IO0)
168:#define PINMUX_PA14M_GCLK_IO0 ((PIN_PA14M_GCLK_IO0 << 16) | MUX_PA14M_GCLK_IO0)
172:#define PINMUX_PB22M_GCLK_IO0 ((PIN_PB22M_GCLK_IO0 << 16) | MUX_PB22M_GCLK_IO0)
Those are the pins that can output clocks.
G19A: PA30, PA14, PB22
J19A: PA30, PB14, PA14, PB22
This include file decides if the clock output is enabled on one of those pins:
// <q> Output Enable
// <i> Indicates whether Output Enable is enabled or not
// <id> gclk_arch_gen_0_oe
#ifndef CONF_GCLK_GEN_0_OE
#define CONF_GCLK_GEN_0_OE 0
#endif
```from `config/hpl_gclk_config.h`
That's Atmel Start based. Dunno what other programming systems use.
@idle owl iirc, rST is used over Markdown so that Sphinx renders correctly.
@raven canopy ah ok. nm on that one then.
@raven canopy not sure I'm prepared to fight Sphinx to get it play nice with markdown.
I guess on the plus side I now know two ways to use Markdown to make an image with alt text and a target link.
[!alt text] right?
oh. hmm.
note: would require change to docs/index.rst and docs/conf.py as well for every repo. might be able to adabot patch it though
Yeah I figured it would require a massive redo of Things β’
All the Things! π
Though it wouldn't matter in existing repos if we didn't change the existing READMEs right?
Or is that something Adabot could do
No, wouldn't affect existing. Would create a rift in the standard. Haha
Also, can I say, Adabot is pretty much amazing.
She is. And getting amazinger. I hope.
Could Adabot update the readmes to .mds? Or is that way ridiculous.
@pastel panther this should run on your board and demo USB CDC ACM adequately:
https://github.com/wa1tnr/CamelForth-SAMD51-SAMD21/tree/master/boards/trellis_m4_usb
@timber mango thanks for that; I'll give it a try when I get back to the bench
that was my big achievement over the summer: USB CDC ACM in Atmel Start, for both M0 and M4 targets. ;) /a_whole_summer
clock foo is here:
Hello everyone, my name is Ayan, I used to be active here few months back but was travelling for a while now not being updated with the progress on circuit python, but now I am back and ready to catch up and hopefully contribute here π
Hi Ayan!
Hi @timber mango
@idle owl we can test it. I imagine that a patch would work; just depends on how git would gen/handle the diff.
Fair enough.
The new trellis really caught my eyes in newsletter this week ..
Seems out of stock already
wanted to order one.
those things often appear out of stock, as they are announced while they are being produced (I think)
Ah! I see
so you can subscribe and get a notification when they appear
This is pr #1289, merged with the latest other changes. Please see that PR for discussion.
This brings in the WIP bleio code. There will definitely be API changes, but let's bring this in to get started.
@stuck elbow received 2 Pew Pew 10.2 yesterday -- both up and running -- well done!
@solar whale awesome!
now I just need to find time to play with them!
haha, I have the same exact problem
f4940c9 nrf: Move the UUID class from ubluepy to the sh... - arturo182
20b8d51 nrf: Move the Descriptor class from ubluepy to ... - arturo182
d5f942a bleio: Add a AddressType enum-like class - arturo182
345334a bleio: Add a new Address class - arturo182
7390dc7 bleio: Move ScanEntry to shared module and add ... - arturo182
with the ble WIP PR merged, I get ```jerryneedell@Ubuntu-Macmini:~/circuitpython_master$ git submodule update --init --recursive
error: Server does not allow request for unadvertised object b96950abf27229c2a3b1719d60691321246bfc94
Fetched in submodule path 'ports/nrf/nrfx', but it did not contain b96950abf27229c2a3b1719d60691321246bfc94. Direct fetching of that commit failed.
someone forgot to push?
@solar whale I think you may need to sync your submodules
we changed to our own nrfx repo
travis passed so the checked in state is ok
how do I sync submodules?
(.env) /V/E/c/l/tinyusb (tinyusb_samd|β) $ git submodule sync
Synchronizing submodule url for 'hw/mcu/nordic/nrfx'
then git submodule update --init --recursive
thanks -- happier now
π
so far so good ```Adafruit CircuitPython 4.0.0-alpha.2-135-gd08747d37-dirty on 2018-11-07; PCA10059 nRF52840 Dongle with nRF52840
help('modules')
main busio microcontroller supervisor
analogio collections micropython sys
array digitalio neopixel_write test
binascii framebuf os time
bitbangio gamepad pulseio uio
bleio gc random usb_hid
board hashlib storage
builtins math struct
Plus any modules on the filesystem
import bleio
dir(bleio)
['name', 'Address', 'AddressType', 'AdvertisementData', 'Characteristic', 'Descriptor', 'Device', 'ScanEntry', 'Scanner', 'Service', 'UUID', 'UUIDType', 'adapter']
@arturo182 Thanks for doing all that work!
Wow, merging #1319 merged #1289 automatically, because #1319 included the commits.
@tulip sleet still issues using USB to copt fiels to nrf52840 after ble active
not surprised - I have not tested this, just reviewed the API. a lot of this code is from ubluepy. Did it have the same issue?
but a simple scan works ```from bleio import Scanner
def display_scan_results(scan_entries):
for e in scan_entries:
print("ADDR: ", e.address)
print("NAME: ", e.name)
print("RSSI: ", e.rssi)
# Line break between record sets
print("")
Scan 1s for advertising devices in range
s = Scanner()
scan_res = s.scan(1000)
Display the scan results
display_scan_results(scan_res)
main things that will change coming up is that Device will probably be split back to Peripheral and Central again.
ADDR: Address('b8:78:2e:19:70:42')
NAME: None
RSSI: -86
ADDR: Address('1c:e7:69:c0:22:d5')
NAME: None
RSSI: -86
ADDR: Address('45:4d:2c:4f:63:e2')
NAME: None
RSSI: -52
ADDR: Address('c8:69:cd:1c:5d:f8')
NAME: None
RSSI: -86
ADDR: Address('1c:e7:69:c0:22:d5')
NAME: None
RSSI: -82
what BLE devices are you scanning? I don't have many to test for.
I have a bunch of Pcs and phones nearby
so a lot of centrals, but not peripherals (or not peripherals only)
@tulip sleet also trying on feather_nrf52832 -- so far - ok -- Control-C still does not work π¦
same as before? not sure about that - I haven't tried it in a while
yes -- has not been working for a long time -- works at REPL prompt, but wont interrupt a runnig script
ble_scan works same as on 52840 -- no hangup issues with USB -- yet
my other programs --not BLE related seem to be working as before -- SPI - SDCard stuff
@tulip sleet All of a sudden BLE is everywhere -- been having lots of fun with the new BluefrutiSPI library for the NRF51 devices. Works great!
glad to hear! Lots of BLE is certainly a goal!
I have to test the SPIM3 bug again with the new code
I'll be tied up tomorrow, but hope to have lots of time to poke/prod things this weekend. - My weekends now start on Friday π
@solar whale congrats! π
Thanks !!
@solar whale Heh.. My weekend starts on days that end in Y.
I'm getting there!
The flip side is that everyday becoms a work day
work is in the eye of the beholder
and then where is the burnout?
That's why I keep several projects on the go at all times.
Plus video games.
A small, fuzzy kitten also helps.
It's a delicate balance -- kittens or puppies do help
sorry, that was against the coc
π Still trying to get my dog to understand the return to "Standard time"
DST is undefensible
agreed - even my dog knows that
good thing we are getting rid of it in EU, finally
nice!
this will be the best thing right after the metric system :)
the dog is demanding dinner -- back later
β bed
is the pyboard supported? it looks like the stm branch is mostly left alone
@marble hornet not in CircuitPython. MicroPython yes.
thanks @raven canopy
to anyone:
could someone help me learn how to sceen share during show and tell?
pinged
@tannewt - per our convo in meeting:
Following the neotrellis learn guide, after saving example code as code.py, neotrellis reloads and both code.py & lib folder are missing.
macOS High Sierra 10.13.6
tried w multiple cables, hubs, editors
when I drag code.py directly to TRELM4BOOT in Finder, the board does not reload, so I hit the reset button and al...
@CollinCunningham The *BOOT drive isn't CircuitPython, it's the bootloader. You'll want to install CircuitPython with a .uf2 dragged to *BOOT and then you should get a CIRCUITPY drive that should save everything.
question: anyone ever had file writes truncated inside
try:
gen_list()
finally:
f.write("\n".join(list))
i'm losing like the last 6 lines...
EDIT: nevermind. text editor on ubuntu just refused to show the last few lines with the window maximized. weird...
Ah, I was just dropping in the CURRENT.uf2 limor modded for iOS power and CIRCUITPY wasn't mounting. Apologies - somehow I completely overlooked that. Thanks all!
heya @slender iron I'm going to spend some time tonight trying to dig a bit deeper into this usb issue but honestly I'm struggling to motivate myself to debug the clocks because I don't understand what I could have done hardware wise to mess them up
because you don't know what I've done or because hardware making clocks broke doesn't make sense to you either?
I mean it doesn't not make sense, but I don't understand it (beyond an external crystal being messed up)
@pastel panther are your changes up on github? i am far-from-expertly, but have studied the clock code and may be able to see something...
unless, you haven't messed with clock code...
nope
I haven't, just added a set of board files
I have the same problem with the bootloader as well
so it's not CP thats the problem
ahhh...well, i am of even less help then. π
I appreciate the offer regardless
π
debugging hardware is hard
that's very true
are you getting any USB messages? or just crickets?
nada, as far as I can tell
dmesg doesn't show anything, nothing in system info, no mass storage
I might poke the data lines with my scope later just for kicks, but I don't think I'll be able to make any sense of it
Wow. Just realizing how tight memory is going to be on this Trinket M0 KeySwitch... probably should have spent the extra $5 each on an Itsy M4
I might have to take Dan's fall-back approach & free adafruit_hid modules into a custom build & get rid of Math and stuff like the PIRkey
freeze (not free)
So I just realized something about Python. I imported KeyCodes in main.py... and then I imported it in a module file... it actually used twice the space!
Is there a way to share that import between the files memory-wise?
Anyone know if there is a way to solder an off switch onto a crickit?
import gc # needed to keep memory nice
def write(f, what_to_write):
with open(f, "a") as fp: # open to add line to file
fp.write(what_to_write) # write
fp.flush() # what does this do, hope it helps????
def read_in_chunks(f, size=64):
while True:
chunk = f.read(size)
if not chunk:
break
print(chunk)
yield chunk
def copy(file_from, file_to, size=64):
with open(file_from) as f:
for chunk in read_in_chunks(f, size):
write(file_to, chunk)
gc.collect() # this is very importaint without it the memory fills
# larger size will use more memory per chunk but increases speed greatly
read_in_chunks("test.txt", size=64)
copy("test.txt", "test2.txt", size=64)
gc.collect()
print(gc.mem_free())
print(gc.mem_alloc())
read and copy large files, with a set amout of RAM size
@velvet badger Doesn't it already have a switch?
A very tiny switch. I need one that's external.
@velvet badger If you're using the Crikit Feather, you can wire between GND and EN - that will disable the Feather's 3.3v regulator which will stop your code. I will not stop powering motors, etc.
Has anyone written a guide on how to freeze in a module in a custom build? I basically can make my code work if I don't import adafruit_dotstar, but I'd really like to be able to give visual feedback
One option would be to freeze dotstar & hid into the build
The alternative I've come up with is to export the configuration in a JSON-ish (is there a python serialize in CP?) and only parse the file when it changes
@tough flax it shouldn't use twice the memory. How are you importing it?
Perhaps not twice, an extra 1K each time
?
from adafruit_hid.keycode import Keycode
HEY! π mpy-cross got me just under the limit!
@slender iron - ignore me
I was importing the KeyboardLayoutUS as well when I ran that test
hrm
The only difference in size is the code for the import line (50bytes)
My bad
I also wasn't running gc.collect() before mem_free()
I'm just finding it very tight in the M0 Trinket
But mpy-cross will probably get me just where I need to be
with about 500bytes left π
You can't mpy compile main.py can you?
Just to catch you up on what I'm trying to do (@tulip sleet is doing something similar & we're collaborating)
I have a config file like this:
debounce=yes
bouncetime=.1
repeat=yes
repeattime=1.0
color=#555555
[common]
color=#FF0000
1 SPACE
2 ENTER
3 LEFT_CLICK
4 RIGHT_CLICK
5 LEFT_CLICK LEFT_CLICK
[mouse]
color=#00FF00
1 MOUSE_LEFT
2 MOUSE_UP
3 MOUSE_RIGHT
4 MOUSE_DOWN
5 LEFT_CLICK
[browser]
color=#0000FF
1 SPACE
2 TAB
3 SHIFT+TAB
4 PAGE_DOWN
5 PAGE_UP
I want to have "modes" for what the KeySwitches do (those three modes are pretty common) & some settings global and at each mode
The lines can have 'chords' too (like
1,5 CHANGE_MODE
The file would be on the Trinket and be editable by end users
Code to parse it now works (yay) and I am activating when the switches are pressed
when I tried to light the dotstar it barfed on memory
Not sending HID yet (but that should work)
After mpy-cross I have 1552 bytes left
So, my only remaining question before I crash is ...
Is there anything like pickle or some other serialize in CP? @slender iron
can i override the permission denied in the write function without unmounting the cp drive ?
@tough flax I made you a trinket build with hid frozen in. See your dmβs. Didnβt read here first.
@marble hornet only if you use remount in boot.py. See a data logging learn guide for details.
@marble hornet e.g. https://learn.adafruit.com/cpu-temperature-logging-with-circuit-python
@CollinCunningham ya thats arduino code
@tidal kiln hey0
@meager fog hey
@tidal kiln basecamp's down - if ya have a todo list of sorts i can paste it here
only todo currently on there was for the few wrap up things - cp libs, feedback servo guide update
are you looking for new todo?
@idle owl ran into a blinka issue - do you take those also?
@slender iron trying to figure out how to stop using a servo after it's been created. looks like continuous has a deinit:
https://circuitpython.readthedocs.io/projects/motor/en/latest/api.html#adafruit_motor.servo.ContinuousServo.deinit
but the regular servo doesn't?
ok. so i was looking for the right thing?
just to make sure i was reading how it's suppose to be done correctly
@tidal kiln the deinit() doesn't really deinit, it just sets the .fraction to 0. The object to deinit would be the PWMOut that you passed in when you created the Servo or ContinuousServoc
I'm not sure why there's a deinit() in Continusous Servo
thanks. was wondering about that approach. thought maybe the servo one did that plus other stuff.
maybe you or I should file an issue
there's with support in ContinuousServo.
DCMotor also has a deinit() that just stops the motor without actually deinit-ing the PWMOut.
here's more context...
trying to make a CP version of this:
https://learn.adafruit.com/analog-feedback-servos/servos-as-input-devices
so was looking for CP equivalents for attach and detach
those are needed for the record part, so user can move servo without it fighting back
I think if you just set .throttle to zero, that would do it. The API is reallly pretty different.
that's only on continuous
hmm, yes, it looks like there shold be a turn_off() or release() or something that sets duty_cycle to 0
right now there is no straightforward way to do that
ok, so i wasn't overlooking something.
like you said - for now, could just cheat and directly use the PWM object
yes, though that's kinda messy ("leaky abstraction")
@tidal kiln Depends on the issue, but either way you should file it on the Blinka repo probably.
@idle owl it was for this:
https://learn.adafruit.com/neopixels-on-raspberry-pi/python-usage
i was messing with that this morning. i had to pip install rpi_ws281x also to get neopixel to work
hmm. Ok, file an issue on the NeoPixel repo for that one. I'll talk to Brennen about it.
is it an issue for that repo because one of the requirements files should've taken care of that?
vs. a blinka repo issue?
@tidal kiln if you install it in a fresh venv, does it still not pull in the rpi_ws281x dependency?
unfortunately, haven't done much with the venv yet. but one thing i did do different from guide page - i didn't run with sudo
for the initial neopixel lib install
i'll poke at it.
@tulip sleet can you please file the issue for the servo stuff? i think you're more dialed in on it than i am.
sure
thanks!
@gusty kiln it's quite possibly me. i wasn't following the guide directly. let me know if you need any more deets on what i did. thanks for looking into it.
@tidal kiln Something seems odd on @gusty kiln's end as well.
@idle owl @gusty kiln FWIW, it was from working this forum post, which may be Yet-Another-Issueβ’
https://forums.adafruit.com/viewtopic.php?f=60&t=143322#p707991
@tidal kiln what pi do you have?
zero w
i bet this is the issue: rpi_ws281x>=4.0.0; platform_machine=='armv7l'
ahhhhh
and now that you ask, rings a bell, isn't blinka advertised for pi 3 (and maybe 2)? goes to look.....
oh. no. it's ok with zero. it's just the much older pi 1's.
@tidal kiln filed two issues on Motor
@tulip sleet awesome. thanks!
@meager fog yep. appears so. over to basecamp then?
ill add it, no rush
@tidal kiln Can I get your opinion on something? Does any part of this seem like something that should get added to the CircuitPython Troubleshooting page? https://forums.adafruit.com/viewtopic.php?f=48&t=143343 I feel like not really except maybe something about "Errors in the Serial Console: Make sure the serial console window is tall enough to show the errors or it may appear that no error has been shown" or something worded better than that. And even that I'm not sure is worth adding. But you see support stuff way more than I do so I'm asking for your opinion.
@idle owl i'd say add it. with a screen cap and some arrows pointing at the scroll bar in the serial window. and big text that says "SCROLL BACK AND LOOK UP THERE ^^"
its not the first time people have been tripped up by that UI quirk. esp. since the default height seems to be pretty slim.
hah. Ok fair enough.
@tidal kiln so i think the zero is a bcm2835, right? i.e., same or close to same ARM chip as a pi 1. testing on a pi 1, at any rate:
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'armv6l'```
so i guess if the neopixel code will work on those older systems, we probably want to change that restriction.
pi@raspberrypi:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 9000c1
Serial : 000000009ead533c
@tidal kiln And it did work once you installed the dependency?
as in there's not some hardware restriction that we were working around
no. ran into permission issue trying to access mem.
that's the sudo thing I think. It's required to access the peripherals needed for NeoPixel.
Did you try it with sudo later?
yep. but since i hadn't installed with sudo (my bad, guide has you do that), the module wasn't available then
looks like we don't support neopixels on other than 2 & 3, so i guess this is a non-issue but we should make the docs clearer about that.
2, 3 and Zero
maybe Pi 1 isnt' supported
but...i think if Zero is, Pi 1 is - same chip
if board_id == "raspi_2" or board_id == "raspi_3":
from adafruit_blinka.microcontroller.raspi_23 import neopixel as _neopixel
elif "sphinx" in sys.modules:
pass
else:
raise NotImplementedError("Board not supported")```
i dunno if that means it wouldn't work, but it's written to blow up if you try anyhow...
@tidal kiln Eh?
oh we just haven't written in blinka support yeah
@gusty kiln we should do that
do you have a pi zero to check the board_id
@idle owl yep looks good
yeah, can do
@idle owl in text that goes along with this, could also mention re-sizing window as an option
good call, thank you
@tidal kiln https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#serial-console-in-mu-not-displaying-anything-18-13 Look good?
@idle owl yah. even more info than i was expecting. awesome.
Excellent thank you
Python on hardware! 03 https://youtu.be/h4QbMHmnsDc
The wonderful world of Python on hardware! This is our video-newsletter-podcast of all things Python and electronics! The news comes from the Python communit...
@idle owl Did you write a SPI scanner at some point?
For which pins are HW SPI? It's on the SPI Essentials page.
@ladyada yes - it's all making sense now :)
@slender iron Can you take a look at this to make sure there's not some more in depth stuff that should be changed? If you think it's good to go, I'll merge it. https://github.com/adafruit/adabot/pull/27
Thanks Kattni, found it
@idle owl Thanks again for the debugging help. The web page looks great.
@dapper falcon You're entirely welcome!
@dapper falcon We have an educator's role on our Discord server, if you'd like to be added. The purpose is to make you more identifiable to other educators in the event that you'd like to discuss methods or curricula or that sort of thing. There's no obligation associated with it, nor is there any obligation to be added. I wanted to let you know so you are aware and if you'd like to be added, we can absolutely do that!
@idle owl Sure. Sounds good.
Thank you! You'll show up to the right under the Educator list when you're online. π
@tulip sleet I'm about to land from this giant leap and I'm hoping I won't squish you. (Getting close to a PR)
anyone know where ble.h comes from in the new nrf build?
i can't even find it... π€·
got it, had to run bluetooth/download_ble_stack.sh
ahh...dependency.
time to do one more cleanup pass
@slender iron I think we don't overlap very much if at all
its just a huge PR
@slender iron bleio allows keyword args for non-optional args, e.g. UUID(uuid=777) is OK. The arg must be present, the keyword is optional. In a lot of our existing builtin modules, we don't allow that (e.g. TouchIn(pin=board.A0) is NOT allowed), even though the arg is named pin in the documentation. Do you have an opinion? This is kinda typical for MicroPython: it saves code and flash space not to match regular args against keyword names. In CPython, it always allows keyword names even for non-optional args.
i started taking out the keyword checking, but then thought I would ask you
I like allowing kwargs because it makes calls more readable
I bias towards always using them
so in the long run, we might add them to all the places where we don't allow them right now
ok, I'll just put the code back that came from arturo and glennrub, not a big deal
tnx
np, thanks!
@slender iron approved descriptor PR
yay!
π
thanks for the quick turn @tulip sleet. now I may be able to get the other PR passing on Travis
This started while adding USB MIDI support (and descriptor support is
in this change.) When seeing that I'd have to implement the MIDI class
logic twice, once for atmel-samd and once for nrf, I decided to refactor
the USB stack so its shared across ports. This has led to a number of
changes that remove items from the ports folder and move them into
supervisor.
Furthermore, we had external SPI flash support for nrf pending so I
factored out the connection between the usb stack and the...
At least its net negative: +2,223 β3,487
yay!
negative is good! well done, @slender iron.
quick question π i'm able to compile my own CP port based off the feather M0.
where do I set pin states at startup?
so chip selects and such aren't floating
@lime trellis i think you could do it on the CircuitPython side by using a boot.py, which would get run before code.py/main.py.
anyone know the difference between interrupts SERCOM0_0 SERCOM0_1, etc.
samd21 just has SERCOM0, but samd51 has more options
the docstrings are no help
i dont think i'd be good for code reviewing this opus, but i could do hardware testing for sure :) just let me know!
These are commented out on M0, but not here. Why the difference?
You took out PA24 and PA25, and PA31 and PA31 on other boards, but not this one. Just an oversight?
I guess some of these are the display? Could you document why they're listed?
@lime trellis hmm. it may be due to the calls to reset_port() and/or reset_board() after boot.py is run. so...maybe put the initial pin settings in reset_board(). Feather M0 express example here: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/feather_m0_express/board.c#L37
also, what's the equivalent of SERCOM0_CORE in samd51?
@exotic pumice the 0_0, 0_1, etc are "pads" for the I/O routing. from the datasheet:
33.5.1
I/O Lines
Using the SERCOM I/O lines requires the I/O pins to be configured using port configuration (PORT).
The SERCOM has four internal pads, PAD[3:0], and the signals from I 2 C, SPI and USART are routed
through these SERCOM pads through a multiplexer. The configuration of the multiplexer is available from
the different SERCOM modes. Refer to the mode specific chapters for additional information.
note: i'm pretty sure there are typos in that text. there are only two pads per sercom
so what if I just want an interrupt handler for the whole sercom?
like in samd21, it's just this https://github.com/adafruit/asf4/blob/d270f79aa16dd8fd4ae3b6c14544283dcb992e9c/samd21/include/samd21g18a.h#L109
do I do nvic enable on each pad?
yeah, for each pad. i don't think 21 had multiple pads per SERCOM (don't have the sheet on this PC)
ok thanks
do you know what I mean by SERCOM0_CORE?
it's the IDR value of SERCOM0, but samd51 has no IDR
so instead of gclk.genctrl.write(id, blah, blah, blah) it's something like gclk.genctrl[id].write(blah, blah blah) I think, but I'm not sure where to get the id from
I guess I just have to figure out the array positions and define it myself
great, they're just called 0-11
π¦
I think table 14-9 might be what I'm looking for
@raven canopy definitely four pads per SERCOM
https://github.com/wa1tnr/ainsu-CamelForth-d51-usb/blob/master/boards/metro_m4_usb/include/pio/samd51j19a.h#L486
<< unmodified upstream file from Atmel Start
I think for example you can have DTR or DSR pins for the UART with the two 'extra' SERCOM pads.
(all four SERCOM pads could be routed to physical, external pins)
it's actually 3
at least according to my svd-generated crate
it can't find SERCOM0_3
$ pwd | cut -b26-99
circuitpython/ports/atmel-samd/asf4/samd51/include/pio
$ ag SERCOM0_PAD? samd51j19a.h | egrep PORT
489:#define PORT_PA04D_SERCOM0_PAD0 (_UL_(1) << 4)
493:#define PORT_PA08C_SERCOM0_PAD0 (_UL_(1) << 8)
497:#define PORT_PA05D_SERCOM0_PAD1 (_UL_(1) << 5)
501:#define PORT_PA09C_SERCOM0_PAD1 (_UL_(1) << 9)
505:#define PORT_PA06D_SERCOM0_PAD2 (_UL_(1) << 6)
509:#define PORT_PA10C_SERCOM0_PAD2 (_UL_(1) << 10)
513:#define PORT_PA07D_SERCOM0_PAD3 (_UL_(1) << 7)
517:#define PORT_PA11C_SERCOM0_PAD3 (_UL_(1) << 11)
Looks like (in general) that one of two pins (PA04, PA08 for example) can be routed to each SERCOM pad.
I could be way off base, here. ;)
Not just two pins; for example, SERCOM5:
$ ag SERCOM5_PAD? samd51j19a.h | egrep PORT
1266:#define PORT_PA23D_SERCOM5_PAD0 (_UL_(1) << 23)
1270:#define PORT_PB02D_SERCOM5_PAD0 (_UL_(1) << 2)
1274:#define PORT_PB31D_SERCOM5_PAD0 (_UL_(1) << 31)
1278:#define PORT_PB16C_SERCOM5_PAD0 (_UL_(1) << 16)
shruggo
yep...correction accepted. IO table (6.1) does have 0->3 references for each SERCOM. was thinking i only ever saw 0 & 1.
same here. laptop thinks so too... π
I can't think of an application besides DSR and DTR for the USART - but somewhere I'd already encountered this. Very confusing to me. ;)
(BTW only SERCOM5 seems to support all four pads)
oh, that could be why they weren't showing up in my pac
(skuze me -- this is hard -- only SERCOM5 supports four different pins per PAD). haha
$ ag SERCOM5_PAD0 samd51j19a.h | egrep PINMUX
that'll return four lines. Anything but SERCOM5 there will return fewer than four lines.
fades
Hi folks, just pushed a new version of the KeySwitch code: https://github.com/ATMakersOrg/KeySwitch Many thanks to @tulip sleet and others for their help in getting this to fit on the Trinket M0!
I'd love some feedback on this - the docs are not done and it's not structured right (should be in src, etc.) but if you look at settings.ini I think you'll get the way it's supposed to work. Right now, individual switches as well as multi-switch "chords" work sending either keystrokes or mouse movements (no mixing right now ala "shift-click")
The code should run on M4s with plenty of room, etc. but with the parsing code, getting it on a M0 is tight. The FrozenHID.UF2 is a custom build freezing HID and removing Math and other stuff like the PIRKey does to make everything fit. KEYSWITCH.UF2 has that build Plus the actual CIRCYUITPY filesystem with the config files etc.
Undocumented, you switch modes by holding switches 1+2 for > 1sec (configurable later)
@lime trellis the board.c file can do any init you want and then in the mpconfigboard you'll want to add the pins to the mask so they aren't reset
@exotic pumice I'm not sure what you mean by IDR. where is it mentioned in the datasheet?
Ya, I don't care about the order.
Not sure. I inherited this from the old code. Sorry its not a move. I'm not sure how git knows them.
Thanks for the quick review! I'll get back to you tomorrow. Trying to run down the last few things to get the build green now.
What simple, low energy display would people recommend for the metro m0? Got 3 sensor readings to display
one of the oled displays, probably
or you could use a 7-seg display and display the readings in order
Hi, how do I request a new Circuitpython library? There is library for MCP23008/17, the I2C GPIO expander. But I need a library for MCP23S08, the SPI expander. Is it possible?
@cedar beacon on the product pages for the .96 inch oled and the super tiny st7735r display they both have around a 20mA current draw (5mA diff) https://www.adafruit.com/product/931
https://www.adafruit.com/product/3533
These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x32 individual white OLED pixels, each one is ...
Thanks @marble hornet
are you using python ?
@hoary hill you can file an issue on the CircuitPython GitHub repo requesting the library. https://github.com/adafruit/circuitpython/issues
Thanks @raven canopy , I just filed the issue #110.
Ahh. You put it on the bundle. The "#110" threw me off; core repo is in the 1300s. π That should be fine.
i'm having an issue with exec
im running:
print(fmoop)```
and getting
and eval is saying i have a syntax error but the exec('from '+path+' import ' + name + ' as fmoop') is just 'from system.programs import sys_bar as fmoop'
one possible - i think this has to do with USB activity that occurs while audio plays. if i have alot of print()s it causes a staticky effect
@marble hornet maybe there's an error in the code you're importing? (as opposed to in those two lines)
i've ran the string as regular code and it works
@marble hornet you need double ' for the inner quotes xec('from ''+path+'' import '' + name + '' as fmoop') not a double quote " -- two single quotes '
@solar whale what does two quotes do vs "
not sure but - you need two f the same to tell it that it is not the terminator of the first '
it thinks 'from ' isa string ' from ' ' then it the second single quote is an inner string
exec('from ''adafruit_rgb_display'' import ''rgb'' as ''bgr'' ') works for me
those are all single quotes
exec("from ""adafruit_rgb_display"" import ""rgb"" as ""bgr2"" ") alos works -- all double quotes
ugh, use %
what is the syntax for %
Thanks!
BTW -- I was not advocating the method or style -- just trying to explain the "syntax error"
the explanation is simple: eval only can run expressions, and import is a statement
the quotes have nothing to do with it
Following-up with https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/110, please help to modify the MCP23008/17 Circuitpython library to use SPI for the MCP23S08/17 chip.
hello everyone
I just installed Mu to work with my Gemma M0 but I can'T launch it?
I click on it and simply nothing happens
No loading, no nothing
Already restarted my PC twice and still nothing
Anyone got an idea?
@umbral dagger I just read over your extending guide. I think you'll want to use shared-modules instead of common-hal because your libraries are not mcu specific
the structure is described here: https://circuitpython.readthedocs.io/en/latest/docs/common_hal.html
Cool. I'll pull it back and make that change.
thanks for writing it up!
Ya, oversight because I tested primarily on this board and changed the flash stuff on the later pass of everything else.
I think its a mistake. I do it to make sure SWD works on PA31. Re-enabled.
I don't know. I didn't touch it because the haxpress is someone else's board.
I think its a copy and paste error.
Ya, I removed it. I don't want to mess with the SWD lines if I can help it.
Changed. Sometimes I miss them and then git thinks its a move from elsewhere.
The write from the computer could have been a single sector and we should wait to flush until a write is outside the erase block. Thach added this in his implementation but I don't think its needed.
I removed the comment but don't think we need a comment in each. Boards shouldn't need to worry about USB or SWD. I want to move away from this mask approach to using never reset anyway. Just didn't do everything because this PR has a lot already.
Removed. I decided to do it after changing this board.
TinyUSB didn't match the interface to its driver but I'll update it to be less strict.
@tidal kiln You around? I'm setting up the MPL3115A2 to test it. Do SDWN or RST need to be wired to anything? Also do you happen to have a .mpy I could use?
let me remember/check....
There's no assignment for either pin in the simpletest.py so I'm guessing no. But there's no guide for it so I'm assuming.
This fixes commit a99f9427420d("'/' and '' are also acceptable ends of the path now") which broke mkdir.
The problem is where the directory name is a single letter like this:
>>> os.mkdir('a')
>>> os.mkdir('a/b')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 17] File exists
>>> os.mkdir('a/bb')
>>>
I wasn't smart enough to fix this in the oofatfs library, so I did it in the os shared module by
creating a path lookup function fo...
yah, they don't need to be hooked up.
ok right on. Do you have an .mpy?
looks like i was just testing with the .py
ok.
hm, the Metro M0 Express pages need to explain that IORef is tied to 3.3v
pretty easy to mpy-cross it if you want though
I can do it, I figured if you had it, I would use yours
i typically just try the .py to see if i can get away with it, then mpy-cross if not
cause my dev setup isn't much more than cp and sync
@ruby lake m0 or m4?
@slender iron m0, https://learn.adafruit.com/adafruit-metro-m0-express-designed-for-circuitpython/pinouts
I would add a line in the power connections section saying IORef is tied to 3.3v on the board, or something like that.
Why would it be something else?
@slender iron What about where I use atmel_start_pins.h ?
why do you need it @umbral dagger ?
@ruby lake added it under other
ah, @umbral dagger use digitalinout internally like you do in the python
@slender iron Are you ok with us setting up Sphinx to render Markdown and moving README.rst to README.md if we can sort doing it reasonably? Getting Sphinx to render .md is easy. It's the rest of it that involves "figuring out."
I'd rather not because we can't use markdown inline last time I checked
I don't know what you mean by "use markdown inline"
i'll note that pypi markdown support also seems... kind of weak.
in function docs and in the rst in the shared-bindings c
ok.
I initially said nevermind on it but the Sphinx part was easy, so I reconsidered. But if it's going to complicate everything, no.
I'd love to use markdown everywhere but we can't. so I'd rather use rst everywhere even though its not as friendly
@tidal kiln I know you did everything with MPL before we talked about BMP, but one more reminder that when you fork the repo, delete README.md or it supersedes README.rst.
@slender iron Fair enough.
I have a repo where the docs are passing according to RTD (as in the Builds tab on the dashboard), but if you click "view docs" you get the not found page. And it says "docs failing" according to the badge on the GitHub repo.
And the docs badge also goes to a not found page.
I doublechecked that I added it with the right alias, and I did.
@idle owl sry. yah. good chance i'll remember for like the next few then forget again. so many details. very glad you're on the job to catch these things.
In July 2016 the Linux kernel project decided to transition from DocBook based documentation to reStructuredText and the Sphinx toolchain.[8]
cite
https://en.wikipedia.org/wiki/ReStructuredText
@tidal kiln No worries. I forgot about it until I'd already merged and released, so I deleted it separately. I missed it too initially.
Also, nm, stable passed, latest did not, that's why it's showing failed because all the links are to latest. Oi.
Does anyone have any good examples of synth programs for the neotrellis m5? I am just getting started in circuitpython, and so I would like to study the code as well as learn how to upload it to my board. Thanks sorry for a stupid question
sorry I meant a MIDI synth
@winged grail That's not a stupid question! We're working on MIDI for CircuitPython right now, but it's not ready yet. As for getting started with CircuitPython, you'll want to start here: https://learn.adafruit.com/welcome-to-circuitpython
awesome thank you so much!
@winged grail do you want to generate midi or read midi?
Generate, but I will take whatever anyone has, for learning purposes
I'm hoping to add midi over usb soon. I think it works over uart now
@slender iron You might or might not want to comment further here: https://forums.adafruit.com/viewtopic.php?f=60&t=143455
will keep an eye on it and see what they want to do
@dhalbert This is ready for another look. Thanks!
@slender iron, on samd21, the genctrl of each gclk has an ID register, but samd51 doesn't
my samd21 code is
fn set_gclk_divider_and_source(
&mut self,
gclk: ClockGenId,
divider: u16,
src: ClockSource,
improve_duty_cycle: bool,
) {
self.gclk.gendiv.write(|w| unsafe {
w.id().bits(gclk.bits());
w.div().bits(divider)
});
I think what it's doing is "write divider to the gclk which was passed in"
the equivalent samd51
self.gclk.genctrl.write(|w| unsafe {
w.div().bits(divider)
});
self.gclk.genctrl is an array of 12 and I don't know which one to write to
because there's no id on the gclk passed in
@solar whale thanks for testing my code!
@idle owl no problem - thanks for providing it! 
Thanks for this fix. I think it's OK not to revert allowing \ in paths right now; there are too many places it might be used as a path separator.
@tannewt any comments?
@idle owl i'm doing a major overhaul on a lib, it doesn't look like it has an example that complies with the naming boiler plate - is that critical to anything? worth making one?
@tidal kiln there should be a sensor_simpletest.py example, so if there isn't one, you should create one.
went with that. there's nothing in the automated stuff that expects sensor_simpletest.py?
cookiecutter creates it by default and expects you to populate it, I thought. But maybe that was before we added that.
Not sure if Adabot checks.
Maybe Adabot checks to see if /examples is empty, but that's it.
@exotic pumice thats a common difference between the 21 and 51. the 21 will make you write the id of the instance you want to change while the 51 just has you offset to the right one
so is the offset still gonna be gclk.bits() ?
I know i've seen a write-up for building custom c-modules for CP. But for the life of me I can't find it.
Anyone know what I'm talking about?
@exotic pumice I'm not sure what bits is. I don't know rust
let me look it up
@lime trellis there is this: https://circuitpython.readthedocs.io/en/latest/docs/common_hal.html
hmm -- just pulled master and built for metro M4 -- boots ok -- installed modulel list seems a bit short ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.2-141-g97bc95183 on 2018-11-09; Adafruit Metro M4 Express with samd51j19
help('modules')
main busio micropython storage
_os collections neopixel_write struct
_time digitalio network supervisor
analogio errno os sys
array >>>
and @umbral dagger is working on a guide
@solar whale I'll try it here. totally could be a bug
@slender iron no way π
yeah it looks like this is the equivalent https://atsamd-rs.github.io/atsamd/atsamd51j19a/atsamd51j19a/gclk/pchctrl/enum.GENR.html
API documentation for the Rust GENR enum in crate atsamd51j19a.
haha, there are always bugs
pchctrl connects the clock to things
I just thought I'd run the new USB stuff on as many boards as I could.
I figured you would π
ideally they'll all have the same bugs π
@exotic pumice I'm having trouble helping you because I don't know the rust side. I could help better if you reference the datasheet instead
ran some neopixels and I2C sensors on the M4 -- no issues.
I think I got it figured out
thanks @slender iron ! I found what I was searching for: https://github.com/BitKnitting/wakey_circuitpython/wiki/Adding-Waking-from-Deep-Sleep-to-Circuit-Python and https://github.com/BitKnitting/wakey_circuitpython/wiki/Wake-Up-SamD21-Through-an-External-Interrupt
but if you're curious look at gen in 14.7, under pchctrl
glad you did @lime trellis
bits is just the raw value of that field
@solar whale I was considering redoing the output buffer for cdc already π
did the new code go into esp8266 as well or just atmel and nrf?
no esp because it doesn't have usb
oh yeah -- small detail...
@idle owl @tidal kiln adabot doesn't currently check for simpletest. only that there is at least one file in the examples/ folder.
and cookiecutter does have examples/name_simpletest.py.
@solar whale did you ever try help("modules") on nrf before? I bet it has the same problem
@slender iron well -- pca10059 won't boot after loading new image π¦
thats the dongle?
yes
I tried the 56 only
@raven canopy thanks for info. yep. this was a retro update, so just wanted to make sure something like adabot wouldn't get unhappy.
this afternoon is debugging time π
I'll try the pca10056 and feather_nrf52832
@tidal kiln all good. i noticed a lot of example filenames don't "conform" to the new standard when adding them to the bundle. which can be confusing on some of them, just looking at the bundle. π
I bet the 832 will fail for the same reason
my guess is that its internal flash related
@idle owl are we all done with MPL?
reverted dongle to 20181105 build -- no harm - no foul π
BTW module list on 20181105 was - ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.2-135-gd08747d37-dirty on 2018-11-07; PCA10059 nRF52840 Dong$
help('modules')
main busio microcontroller supervisor
analogio collections micropython sys
array digitalio neopixel_write test
binascii framebuf os time
bitbangio gamepad pulseio uio
bleio gc random usb_hid
board hashlib storage
builtins math struct
Plus any modules on the filesystem
@tidal kiln it's not on PyPI yet.
hrm
but it's all set to go, right?
Oh. Yeah. I forgot to add it to the bundle though.
I wasn't sure what you meant by "set to go" I guess
so_many_steps.gif
@slender iron on the PCA10056 -- it boots and the module list looks complete ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.2-141-g97bc95183 on 2018-11-09; PCA10056 nRF52840-DK with nRF52840
help('modules')
main busio microcontroller supervisor
analogio collections micropython sys
array digitalio neopixel_write test
binascii framebuf os time
bitbangio gamepad pulseio uio
bleio gc random usb_hid
board hashlib storage
builtins math struct
Plus any modules on the filesystem
Monday is my library day, is what's essentially going to happen.
ah, so its an m4 thing
thats good to know
I found an optimization while digging π
@idle owl sounds like you'll take care of it? i'm gonna check it off
If you want to add it to the bundle, go for it, but I'll deal with it on Monday otherwise.
but yes in terms of checking it off, go for it.
meh. i'll pr a bundle add. i need to get back on that horse anyway.
ok, right on π
cool -- I can still mount an SDCard on the pca10056 ...
@slender iron yup feather_nrf52832 does not boot
kk, will look at that next
I must be blind, I just didn't see that the commit also stripped off backslashes.
The PR #1066 doesn't say why, it just says that it fixes #1033. Maybe there was some discussion on Discord?
Do we allow backslashes in paths? I though we used posix style here?
@slender iron do you want me to post issues or are these comments enough for now?
for modules don't bother but the nrf with flash would be good
I may not get to it until monday
OK - so for the pca10059 and feather_nrf52832 -- one issue or 2?
Can i partition the flash ? and then mount the second partition to just the atsamd?
built and loaded adafruit-circuitpython-pca10059-en_US-20181109-97bc95183.uf2 for the PCA10059 but it does not boot after flashing. Reverted to 20181105 build and it boots OK.
same for feather nrf52832 -- new build does not boot.
PSA: QuickLink to Particle Mesh DFU Instructions - https://docs.particle.io/tutorials/device-os/led/photon/#dfu-mode-device-firmware-upgrade-
haven't read it through yet...but i'm off for 3 days so.
β¨
i'm reading from this page:https://circuitpython.readthedocs.io/en/3.x/shared-bindings/storage/__init__.html?highlight=storage
@raven canopy thanks - still waiting for mine -- HAve good time away!!
it looks so close
we'll see how borked i can get it. π
@solar whale I think the modules thing is because I have a smaller buffer on the samds
OK - so were things like pulseio removed?
oh no, its just outputting info too fast and overwriting
ah -- that's better -- I'll check in a minut -- restoring 52832
OK -- import pulseio works
goes to find his 832
Hi everyone
I was telling to @slender iron earlier today trying to get a device up and running with CP
Figured out I had a bad board on the first one, that was a relief
Now I think I'm at the point of uploading the compiled UF2 bootloader code via a JLink and I'm doubting how far I am
I am able to connect to the device via JLink, stops at "Waiting for GDB connection..." , ostensibly because there is no program file?
I got my hal compiling π
I think my next step is flashing the uf2 firmware, but was hoping for a sanity check
hi
Hi Saj
you don't upload uf2 with jlink, you drag and drop onto the usb mass storage device
@digital slate you'll need to run gdb to connect the jlink software
oh nvm I misunderstood
Ah, so second window and then load up with the program
@digital slate You can also use JLinkExe's loadbin bootloader.bin, 0
maybe the offset and filename is reversed, I can never remember
@slender iron What is this? https://github.com/adafruit/Adafruit_CircuitPython_CPython
It's good to know how to use the jlink gdb server and gdb but for just loading .bins, I find it easier to just use JLinkExe (I think it's called JLink commander?)
@digital slate right, I use a second tab
@digital slate Hey! π
@idle owl its for libraries that match cpython
@slender iron Hmm. Ok. Thanks.
Hi @kattni!
I guess a dumb quesiton, but I'm just loading to address zero since it's a bootloader, right?
yup
can you get your blablaBOOT?
yea
yep, didn't change anything so mine says feather
hey, it's Friday, why not a little celebratory dancing??
I was thinking more cabbage patch than can-can but I'll take what I can get
@slender iron @tulip sleet The 20181109 release of the TrellisM4 build appears to have issues. I'm running the NeoPixel toggle demo, which runs fine on 20181105 (and I just got back to that build and it still works). When you put the newest version on the Trellis M4, all the LEDs turn white, and the status DotStar turns purple, and then you can't even reset the board to get back into the bootloader. The only way to get out of this state is to unplug/replug/REALLYFAST hit reset twice to get into the bootloader, and then load the older version. That took two tries as well to get it to work.
JP found it first when I had him update his board to run the demo for himself. We thought it was code, but I updated mine and the same results.
(I have to run, I'll explain it better later if you need me to, but I have to head out for the evening.)
@idle owl when you are back please file an issue with the full filenames of what you are using. thanks!
what's going on with the spi flash on metro m4? SCK and CS are connected to sercom4 and MOSI and MISO are connected to sercom0
at least that's what the schematic says
@slender iron any ideas?
its connected to the QSPI peripheral, not a sercom
oh, that's a thing?
ya
k well I guess I'll just disable that feature for now
don't feel like writing a hal around the qspi peripheral
@slender iron @idle owl reproduced the trellis m4 issue - current master does some very odd things with the neopixels and eventaully drops USB connection.
β¬ is a fix for you @solar whale
I found that I could get back to TRELLISBOOT but when I loaded older image, I had to power cycle to have itcome oute of bootloader.
@slender iron for nrf52832 and dongle or just for modules list?
I'll pull the PR after travis finishes.
my blinky doesn't work
d13 is connected to a led still, right?
otherwise it wouldn't be an arduino
the one marked L?
ya
oh it turns on, but only when I press reset
Interesting
it's supposed to do it in a loop forever
is the reset button lighting L just part of the bootloader?
ya
hmm, well I've got some debugging to do
@slender iron hmmm -- metro_m4_express does not boot with pr_1325
hrm, thats what I was testing on
I did git fetch origin pull/1325/head:pr_1325 then built merto_m4_express -- after falsh -- Blue neopixel -- no CIRCUITPY or /dev/ttyACM0
reverted to current master OK
ah -- DEBUG hides things
I think I'm probably setting up the clocks wrong
from past (long past) esperinces with DEBUG hiding issues it was often an unitintialzed variable.
@solar whale pushed a fix
just added a check to see if usb is connected before we wait for everything to be sent
yup, me too. using a tc to output a pwm you think you know can help get it tuned
@solar whale do you know how to swap bootloaders on the '832 feather? I have the mynewt version
I build from the bootloader_nRF52 repo then flash via J-link - then in CP repo use jlink to make BORAD=feather_nrf52832 sd to get proper SD
kk
finally load vi make BOARD=feather_nrf52832 dfu-gen dfu-flash SERIAL=/dev/ttyUSB0 -- or just use Jlink make BOARD... flash
woohoo! ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.2-143-gd012fd155 on 2018-11-09; Adafruit Metro M4 Express with samd51j19
help('modules')
main busio micropython storage
_os collections neopixel_write struct
_time digitalio network supervisor
analogio errno os sys
array gamepad pulseio time
audiobusio gc random uerrno
audioio i2cslave rotaryio uio
bitbangio io rtc ure
board math samd usb_hid
builtins microcontroller socket wiznet
Plus any modules on the filesystem
yay!
@slender iron I ran into a problem in the past - if I flashed sd from the bootlaoader repo, it used the wrong version as default -- CP expects s132 for the 52832
I used this bin: https://github.com/adafruit/Adafruit_nRF52_Arduino_Bootloader/blob/master/bin/feather52832/6.0.0/feather52832_bootloader_6.0.0_s132.bin
looks good
ah -- I think CP still uses SOFTDEV_VERSION 5.0.0
see the nrf/boards folder
I think if you do a make BOARD=feather_nrf52832 sd in CP repo it will be OK
as its connected over jlink or nrfutil?
jlink
the sd's and SOFTDEV's are a bit confusing....
ya, I don't know why they give options. we should just always have one we support
in the bootloader_nRF52 I think it is set up for Arduino -- the CP repo does have the defaults for us.
I think @gentle bronze understands it π
ya, that was easy to update at least
Hello, so if I want a board to support double-precision floats, all I have to do is modify the mpconfigport.h , and st MICROPY_FLOAT_IMPL to MICROPY_FLOAT_IMPL_DOUBLE? and perhaps have enough space? is this correct?
@solar whale gotta run. will let you know when I have a fix
Thanks - no rush here!
@exotic pumice Trellis M4 first Adafruit board I've seen (SAMD) that does not have D13 LED (at all).
interesting
My USB code ran first try, on Trellis M4 - I had vague plans to blink my own LED as a test for basic ops but was unneeded.
does it only have neopixels?
Has DotStar singleton, too (on the reverse side from the keyboard matrix)
May be the only Adafruit target with both DotStar and NeoPixel drivers required for full use of the board.
yeah, that's tricky
I've bit-banged DotStar APA-102 (Pimoroni Blinkt)
I still don't know how to send to the rest of the NeoPixel array -- the code I lifted only drives the first pixel.
yeah but to not have a simple led for debug is pretty crummy
with neopixel data, you just send 3 bytes per pixel
so if you want to light pixel 2 send 6 bytes
Well Trellis M4 is much like an ItsyBitsy M4 so get that going first.
I'll try that. APA102 is kind of like that as well.
I'm working on a neopixel driver as well
The seesaw code for neopixel is a lift of the arduino library - I got it from seesaw.
that nop stuff ;)
haha well if you read the original driver comments it seems recommended.
yeah, my goal is to create a driver that can control neopixels with any mcu, so it doesn't fit my vision
any mcu with dma and spi that is
oh you're the person who wants to use hardware SPI drivers. ;)
I definitely recommend a thorough read through of the Arduino lib for NeoPixel from Adafruit.
yeah I've given it a good look
nop nop nop nop nop
I'm sure there's a Star Trek TOS episode in that. ;)
(right up there with the horta)
Happy Friday all! Still doing my googling, so far coming up empty.. anyone happen to have a link to a Circuit/Micro python package that supports the OLED SSD1331 (color) by chance? https://learn.adafruit.com/096-mini-color-oled/overview for reference
@notro It was a feature that wasn't generally asked for, but someone submitted a PR which seemed to add it OK. But if it causes other problems, we can back out of that.
My clocks are so broken I can't even get a nopping blinky to work
it probably doesn't help that a lot of my clock code is trying to achieve 48MHz
Do we need to download espriff/xtensa toolchain to build circuitpython for ESP targets?
I did this already "make -C mpy-cross"
Good day all,
I have a question about NeoPixels on CircuitPython on Raspberry PI. Why must the code run under sudo?
@latent nimbus not sure of the details but it was confirmed in this discussion https://github.com/adafruit/Adafruit_Blinka/pull/32
@obsidian compass MicroPython and CircuitPython use a 3rd party SDK (includes espressif's toolchain) called esp-open-sdk. build steps for the esp8266 port are here: https://github.com/adafruit/circuitpython/tree/master/ports/esp8266#build-instructions
Thanks for sharing. @raven canopy π
@solar whale Thanks...
@solar whale the more i read up on the Particle Mesh and DeviceOS, its seems that to utilize it with all it offers we'll have to make a new port and somehow glue in the Particle Cloud stuff. otherwise its just a Feather nRF52. π΅
they've set it up in an interesting way. i think i understand why, and that was not a derogatory judgement. at least the firmware is up on GH: https://github.com/particle-iot/firmware/tree/mesh-develop
Either the crystal or two caps next to each other, across the same lines that were shorted with each other
I forgot that I had @timber mango 's code loaded so after I removed the crystal and its caps and then didn't see a CIRCUITPY drive, I kept going and adjusted the caps. Then when I was hopelessly poking around I noticed a /dev/tty.usbmodemxxxx!
I was also preparing to desolder the samd and was warming it up when I fixed the caps, so theoretically I could have reflowed an iffy connection there as well
Now I just need to see about getting uf2 and CP back on
@pastel panther yay! we generally don't use an external crystal which simplifies things
@exotic pumice it runs at 48 by default I think
It's not working again now but I'm guessing it's a software issue cause I've been loading bins willy nilly
π
Yeah it definitely runs at 48 MHz by default, @slender iron
But there's also an 8 MHz thing going on (probably for M0, don't remember).
Depends on the code base, perhaps. ;)
needs an oscope that can go higher than 25 MHz ;)
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
The scope I already have displays a 48 MHz signal kinda/sorta.
sidd: 48 MHz is probably difficult to get away from more than hard to achieve in the first place.
(USB wants it for one thing)
I think the trick is to get above 48 MHz (MCU clock) while keeping USB at 48 MHz.
Think I saw this in circuitpython tree (maybe not actively engaged):
https://github.com/wa1tnr/ainsu-CamelForth-d51-usb/blob/master/boards/metro_m4_usb/driver_init.c#L110
welp, I'm back to things solidly not working again π
I think I'm just going to write this board off and try to assemble a new one
$ pwd | cut -b17-99
Adafruit/circuitpython
$ ag 25% | ag atmel
ports/atmel-samd/asf4/samd21/driver_init.c:386:/* The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
ports/atmel-samd/asf4/samd21/driver_init.c:389:#warning USB clock should be 48MHz ~ 0.25% clock, check your configuration!
ports/atmel-samd/asf4/samd51/driver_init.c:422:/* The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
ports/atmel-samd/asf4/samd51/driver_init.c:425:#warning USB clock should be 48MHz ~ 0.25% clock, check your configuration!
I don't know if that asf4 tree is really in the compiled image or not.
or maybe just write off hardware entirely and go back to fishing
poisson!
les petit poisson?
ladyada_ says to get used to setbacks. ;)
She's said that two or three times in various videos (in differently-worded utterances)
I'm not not used to it, I'm just not good at channeling my inner duck
get one of those giant BFC capacitor ducks ;)
I liked Mr. LadyAda's "Software works until it doesn't, hardware doesn't work until it does."
It's a reoccurring theme in my projects.
Or maybe it's the reverse. scratches head
found a broken page
Guide page?
going from here
the next button to the pycharm page is broken: https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/pycharm-and-circuitpython
Oh right.
That page has been removed because it's not valid anymore. It shouldn't be trying to use it anymore, so that's odd.
Ah I see why. Fixing it now. @digital slate Thanks for catching that!
no prob!
Should be good now
Ok I've repro'd the TrellisM4 NeoPixel issue multiple ways. Filing an issue in a bit here.
Is it possible for CP to use spi flash as a memory partition?
I updated CircuitPython on my Trellis M4 and any code involving the NeoPixels is failing to function properly.
The failure is:
- All of the NeoPIxels will turn bright white (evidently
(255, 255, 255)). - After a seemingly consistent period of time (a few seconds), CIRCUITPY will disconnect, all of the NeoPixels will become a dimmer white (as though it's more like
(45, 45, 45)or something), and the status DotStar LED on the back will turn a slightly purple-tinged red (which is to s...
Just a thought. I found that setting all of the pixels white causes an over current condition so some of this issue may be masked by that.
I have reproduced this issue on my trellis m4.
Hamtonio lives! π
@pastel panther awesome!
when in doubt, throw it in the trash and start over
I went for a few months, maybe, on the UART before tackling USB.
I'm really excited to dig into your usb code. Thanks much for sharing
You're welcome!
Question does circuitpython have any moduals to operate as logic gates or like PLC?
It has no ringbuffer so a huge kludge is used -- long delays.
The USB stuff seems to complete in the background on its own; the delays make sure no new use of USB occurs while that is happening.
@rare zephyr not that I know of
Though I don't know precisely what you have in mind
Well you can do logic operations and control GPIO to correspond the what the program does with your inputs.
If you want to control relays programmatically, it can do that but it's all done by writing python
(that's true of any and all microcontrollers, generally)
what nis said is also true
i am looking to be able to detect a blinking light with a photo sensor and if it is blinking at 1hz turn on an out put pin but if it is on solid turn off the output pin
depending on the accuracy you want, that should be possible
The problem with using any microcontroller's input pins are very different from the problem of using its outputs. ;)
Generally you're looking at scanning, or interrupts (or both) or busses (serial I/O).
Whereas a standalone logic gate just 'scans' though we don't call it that.
I tried loading the current master build for the feather_m0_adalogger onto a feather_bluefruit_m0 but it failed to boot. reverting to a 20181105 build does work.
Note; the adalogger build is recommended for the Bluefruit for use with the BLESPI ligrary.
@pastel panther Excellent!
@errant grail I haven't had the huevos to put the boost converter together on this one yet
@pastel panther make install make clean and other make targets exist in most of my projects.
They're all in the final 100 lines or so of a given Makefile
good to know; does install use bosac?