#circuitpython-dev
1 messages Β· Page 134 of 1
wait so does the linter remove lint? So less lint is better? Or more lint is better...
Oh neat I've never watched travis working
Zips are there π
has anyone had problems with the driver loading but not showing up when Trinket Mo is plugged in?
I loaded W7 drivers for the trinket MO and plugged in the trinket, the drive did not show nor did the serial port. Anyone else having problems?
@stuck elbow Yes. I've lost enough small changes to files to try to remember not to edit the file on the (Express series) target board's SPI flash -- but to edit a copy held on the host PC's hard disk.
I'm still developing a stable workflow for this. When I get lost, I think I need to remember to harvest the existing code from SPI flashROM, onto the host PC hard disk's storage, before proceeding further.
So, if I know the code on the Express target is correct (but could be improved upon) I don't have to worry about finding the matching file stored on the hard disk (if the objective is to capture a thought about its current programming, by way of an improvement to it). I can just harvest what's in front of me, and edit it that way.
I'm very used to editing live HTML pages (plaintext documents) stored on the server; this workflow reminds me of that one.
@light gate Hi Chuck, I assume you are using Windows 7 and not 10?
that is correct W7
I am not sure if you need to reboot, but with Windows it usually doesn't hurt....Did you reboot?
You can monitor Discord from their website to gain a second viewpoint. Or their App running on a mobile device, for that matter. Then you'll know for sure if an utterance made it into-channel or not.
@light gate Is the status light coming on? What color or colors is it?
@opaque patrol I have a green lite and the .dot is varying colors.
@opaque patrol Yes I have restarted W7
@light gate Did you try pressing the reset button?
@opaque patrol pressed the reset; red led lit momentarily ; DotStar blue > green > red.......
@opaque patrol and the green on LED is green
here is the troubleshooting page if you need it. https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/troubleshooting#cplayboot-trinketboot-featherboot-or-gemmaboot-drive-not-present
thankyou!
Check that you are using a data usb cable and not one that is only for charging...Try plugging it into a different USB port and you can try pressing the reset twice to put it into boot loader mode
Looking at the page I linked it says to verify you installed version 2.0.0.0 version of the Adafruit Windows Drivers. If you had an older version installed you should manually uninstall them and reinstall the 2.0 drivers.
let me check the cable........
@idle owl http://www.catb.org/jargon/html/L/lint.html .. lint
@opaque patrol Your the Man!.... was power cable that I was using.... changed cable and now I get a solid Red DotStar LED and I see the CURCUITPY folder. Thanks for the help.
@light gate Great. Let me know if you need any more help.
and I have Adafruit Trinket MO on COM20
So here's an odd one. Testing the MAX31855 and it seems like the temperature that's displaying is somehow backwards.
Wait a tic.
Nm. It's a coated thermocouple so you can't tell which wire is which and apparently that's what happens if you connect it backwards.
@idle owl hiiii
@meager fog Hi!
Yep!
ok on this page
we showed a full progam and then 'chunks' but i've found that beginners get super confused if you have just 'part' of a program
so i updated all the code bits to be the full program (since its short)
Ok yeah, nice!
now, tho, the explaination bit at the end is missing the parts about import/pin decl
do you want to either add some text about those, or just handwave em?
hmm, I originally had something in there for that, so I can add something quick in there about it
I think I still have what I wrote even
ok yah
ill not edit that page anymore, just refresh and let me know when done
ill move to the next pages!
Ok!
Done π
If that works for you anyway
oop wait
nope not done.
Need to edit the "first line" part
Hmm should I add something about the led and led.direction lines too?
yah plz
Ok! I had something for it but it got too detailed. I'll rein it in.
yah its a difficult balance
We're calling them libraries and not modules right?
yah
keen
ok next up for this page - https://learn.adafruit.com/admin/guides/1845/editor/11059 - screenshots of code should have code embeds instead
like, at least one
Ok I wasn't sure. I'll do the one that's the working code as embedded
Or the first one that's working code anyway
Or I can do both working pieces as embedded. Whichever you'd like. Keep the broken code as a screenshot
i think yah just the first one
ok
then its just minor edits anyhow
Done on that one. Still working on explaining the led lines.
(tested what I embedded too)
ok yeah im reading the REPL code
kk brb
brb too!
Ok
Hey, I have almost everything that is in the ADA006 Box... let's pretend I just received it and will try your stuff. π Good night all.
Night!
night!
@idle owl ok im done i think - do we maybe want to add a troubleshooting page here
where we can put the older driver/filesys troubleshooting deets in
i think ill just 'move' this page over
Sounds good
But are you planning on mirroring this into the other guides?
Because if so, you'll have the troubleshooting page twice
I try circuit python not that long ago and is amazing but ig tend to be Very slow when using more specialized python function (liken unpacking two tupple to do an addition on every members (3) amd returning a tuple it took 0.5 sec... and it would be appriciated if the Software serial library was ported for circuit python
we have UARTs available on many pins for m0, so you can pick a few different pins to have serial ports
you aren't limited to one
@idle owl ok made it live - now we just have to go back and relink to all the existing guides
and clear out the previous pages
@idle owl i'll ask the listserv to take a look too?
Yay! Ok so how does the relinking to all the existing guides work? And I didn't want to go removing anything without making sure that was the plan
@idle owl I set the search prio on it to 1, so it will show up top of the list for circuitpython, etc.
That's great!
I really think it'll help. The number of questions I've answered in the last two weeks that are covered in it...
congrats!
Thanks!
yayy
yah to update the old guides you'd delete the mirror'd page
then mirror this new page in
and then once you're done unmirroring, delete the original
@idle owl do you have blog access?
I do not!
ok we'll get you set up so you can blog this. ill reply and cc the listserv first so others know this is ready to share
So replace the main CircuitPython page with the overview page (should retitle it CircuitPython in that case), then the quick install, the serial console, blinky, CP libraries. The mirror the rest in, in order. Yes?
well lets start with one guide
how about...trinket m0?
Ok will do π
i think skip modifiying this page https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython
for now
and https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/about-circuitpython-libraries
then mirror in the proper matching pages
You can < http://en.wikipedia.org/wiki/ > enclose a web address with angle brackets to suppress all the fluff.
neet
I think you can also enclose it in / /. Dan mentioned something like that the other day.
@meager fog Trinket M0 is updated
Oh wait need to add one more
Or two actually. Interacting with Serial Console and REPL
Now I think it's done with what you suggested
I suggested the <>. Not sure about //
I discovered that by accident while reading something else about discord
Always useful to have more tricks
heya @tulip sleet I'm deep down the status_apa102/SPI rabbit hole. I got 3.0 to build but it's crashing. Currently stepping through with the JLink to figure out why
@pastel panther good luck! I have no immediate advice
@tulip sleet thanks, I'll let you know if I find anything of note. So far it looks like rgb_led_status_init () is being called too much which leads to common_hal_busio_spi_construct being called with an already configured status_apa102
Guidin' it up
woooooo
yeah i am making the sensor guides point to your pages
instead of like, a range of different guides
Yeah! I love it
/ https://learn.adafruit.com/adafruit-vl53l0x-micro-lidar-distance-sensor-breakout/circuitpython-code /
that did not work
ok yah <> is it
whee
ok so. here's what i think we should do
each board should have a 'quick start' page
which is specific just to that board
then we'll mirror in the other pages
Ok so the CircuitPython page stays, and then we do everything after that? Same as in Trinket
"everything" being all the stuff I did for Trinket I mean
ok i did a big reorg, so refresh
you'll see i split up the starting-stuff from the code stuff
ok ready for your next quest?
Yes!
Yeah
You nailed it well π
I beginnerified it a little more I think but they're essentially the same
ok ill try to merge them so i can get rid of one
Ok.
yer quest is to make a trinket m0 'quickstart' like this https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quick-install
Got ya. Am I leaving out bossac at this point?
yeah leave it out compeltely
Awesome
we'll point people to the advanced page if they ask, which nobody does
lol truth.
advanced page? I was just going to ask about the advanced page. ( Not really, I'm just a beginner.)
@idle owl the CPX quickstart guide talks about using notepad or atom; you may want to refer to safer editors and/or the atom package
The Bossacs were the fearless horsemen of Russia.
@tulip sleet it's the CPX quickstart I'm going to be using to build the trinket one
@tulip sleet oops yeah just change those words to another editor
https://learn.adafruit.com/adafruit-circuit-playground-express/adafruit2-circuitpython-blinky#code-dot-py second paragraph here, yeah. or could you just mirror your "Creating and Editing Code" page from the Welcome to CPY guide?
It just explains installing CircuitPython
Ah ok you mean the guide overall.
I think the plan is to mirror over Blinky
With Creating and Editing Code
oh i see yeah that's later, you just want to fix the install part
But I'm waiting for the go ahead on that.
can I use circuit python on a chromebook?
Yes!
it looks like a usb drive
@tulip sleet @slender iron RE: microcontroller.cpu.uid - when adding the attribute, do I only need to build the property dict? or is there an additional place I need to add the attribute? (currently getting "has no attribute" in the REPL) small milestone, I've got it to compile and not lock the memory on reset which was causing it lockup during usb init. π
@raven canopy example of a property: https://github.com/adafruit/circuitpython/blob/36ec29d4e85b19487c868287f09d2492eecc0274/shared-bindings/microcontroller/Processor.c#L68
@toxic knot This is new: https://learn.adafruit.com/welcome-to-circuitpython/overview It explains the basics of getting started with CircuitPython. Might be worth checking out if you want to get some idea what goes into working with CP.
@tulip sleet yeah, i set it up exactly how frequency and temp are done.
@raven canopy if you did that already make sure you're doing a make clean before make, because you need to rebuild the QSTR tables.
now that is a PRO TIP!
building now....
Thanks kattni, I will check that link. I've gotten the Circuit Playground working on makecode.com and hope to get phython running on it next.
and now the "QSTR not updated" message makes sense. π€¦
@toxic knot you'll want a serial terminal too, like https://chrome.google.com/webstore/detail/beagle-term/gkdofhllgfohlddimiiildbgoggdpoea?hl=en
@toxic knot Awesome!
so you can talk to the REPL
Hmmmm. I put Beagle Term on the chromebook. Going back to look at the page again to see if I can understand install instructions for a chomebook. Wish I wasn't so slow.
OK, I downloaded the circuitpython UF2 file, now, do I drag it to the CPLAYBOOT (usb drive) that I see in my files when the CPX is plugged in and I am at the makecode.come site, as I would when programming the CPX with a block code style program?
Quick question: After looking around in many on-line sources and in my reference books and not finding anything native to Python, I created an Arduino-like helper to map and constrain an input variable (using the Arduino nomenclature). Is there something similar that's native in CPy? ```python
an arduino-like map + constrain function helper
def span_constrain(from_x, from_low, from_high, to_low, to_high) :
to_x = int((from_x - from_low) * (to_high - to_low) / (from_high - from_low) + to_low)
if to_x < to_low :
to_x = to_low
if to_x > to_high :
to_x = to_high
return to_x```
@toxic knot there are two states the target board can be in. In one state, it presents itself to the Chromebook under one name; in another state, it uses a different name.
The name with 'BOOT' in it is the one when you drag and drop a UF2 on it.
It also displays something like CURRENT.UF2 in its directory in that mode.
Ok, Here I go, dragging and dropping...
All the LEDs (ten of them!) light up in green, when CURRENT.UF2 is showing in the directory and the volume is named CPLAYBOOT.
That state (as the other state) is accessed by sequential presses of the RESET button which is in the center of the board.
Either a double-click or a single-click of the RESET button accesses any of the modes I've worked with.
I dragged and dropped. Now when I hit the reset, CIRCUITPY shows u;p intead of CPLAYBOOT
That is correct so you are golden to this point. Now you can add a library 'bundle' to the storage chip on the CPX (it's called the SPI flash to distinguish it from a smaller flash that's inside the SAMD21 chip itself).
The bundle is normally a .zip file that you unzip, but on Chromebook, I don't know what they let you do.
Inside that .zip file is a directory called /lib and that's what is copied over to the CPX.
OK, cool, I can now click between the two. Still trying to follow on how to add the library bundle.
Well, you have to find the bundle (it's on github but is linked to in any 'howto' type of article Adafruit sets out to do all this).
It should match the version of CircuitPython you just dropped as a UF2.
There are many versions, so it's important to get that correct.
Thanks nis, I will keep reading through the welcome to circuit python tutorial and will then try these links. I'm a little slow, but I keep trying.
I'm always slow. I don't know why people find that other than commendable. ;)(
A few weeks ago I coulnd't have narrated any of this to you.
Thanks nis. Hmmmm. I found an editor and copy/pasted the sample code, then exported and dragged to CIRCUITPY. It looks like ti downloaded to the CPX, but not red blinking.
@toxic knot did you do a control D?
In the Trinket MO pin description for A4 should read "use A4" "Digital #4 / A4 - this is connected to PA06 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, analog input (use 'A2'), capacitive touch, PWM output, and is also used for UART TX, and hardware SPI MOSI"
No, what does control D do?
The REPL prompts you to use it to reload. If you see no REPL, try Control C first.
The REPL is like a miniature BBS (computer bulletin board system). It's a server that talks to your telecomm program (Something about a Beagle you folks spoke of earlier).
Your dialogue is with the REPL. You ask it things, it replies to the things you ask.
Another name for it is the shell or the command line. The C: > prompt is a name used by MS-DOS people.
@toxic knot always count to 30 before unplugging the USB cable from the CPX, if you've modified the files residing on the CPX flash, recently. Probably before hitting the central RESET button, as well, in same circumstance (having recently written a file or an edit to the CPX SPI flash).
Thanks for the warning. I tried putting the library on the CPX, but got a copying error after I unzipped it and tried to move. I'll take a break for now and try again tomorrow. Thanks again for the help.
Or to put it another way: If I haven't paid any attention to it in the past five minutes, I unplug it with impunity (often, to reuse the USB port with a different target board).
Rest is good. You're welcome, Bill. It will come, and the unease will subside when you get the victory. π
If you're using Windows, you should "eject" the device before unplugging it from your system.
It took me a bit of time to understand that CPX is Circuit Playground Express. Did you only recently started to use that acronym? At least it is not on https://www.adafruit.com/product/3333 but now that I search for it, a few tutorial use this. And also, I did not notice the SALE on it.
Circuit Playground Express is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! ...
Hello, Iβm trying to load my circuit playground express using the tutorial https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quick-install. I was able to load the UF2 file and I see the CIRCUITPY drive, but Iβm unable to load the lib file. I get an error: βThe operation canβt be completed because an unexpected error occurred (error code -8058). Iβm unable to load any python code because of this. My environment is macOS High Sierra. Any ideas how I can fix this?
@half plover You mean that you can not copy a file to the CIRCUITPY drive? Do you see file there already? There would be a main.py and I guess the lib folder already. Except if it came naked.
Iβm unable to open the CIRCUTPY drive. Iβm getting βCIRCUITPYβ canβt be opened because the original item canβt be found.
@idle owl I was wondering if in your guide such as https://learn.adafruit.com/welcome-to-circuitpython?view=all when you talk about screen, you could hint how to install that on a raspberry Pi: "apt-get install screen"
@half plover If there is nothing important on the board, I would reset it... There was a procedure for corrupted "flash". Someone from Adafruit can point it to you if this is the thing to do. You might find it if you scroll up.
@half plover If the reset fail to solve your problem, maybe reflash with the Circuit Python "firmware" after the double click. But I am afraid it will not solve a corrupted file system, as upgrading the firmware does not typically erase user program in CIRCUITPY.
Ok, I think I saw that procedure. Iβll try following that. I tried on two different circuit playground express so Iβm not sure why itβs giving me the same error on both.
@idle owl One other concern with that guide is ESP8266. It is mentioned once in "Install Putty" (and that might be not needed) and no where it says that HUZZAH is different... and I guess this guide is not HUZZAH minded because HUZZAH has no file system access like your M0 board. So you may want to consider how to approach that difference.
@idle owl I confirm your page is not at all about HUZZAH, so the reference to ESP8266 and the 115200 could be simplified. However, if this is the main entry point for what is Circuit Python, I would love to see mention that some other board can do Circuit Python with less functionality, but lack the drive access. This is just not to exclude people. Or you could talk about that other kind of Adafruit Circuit Python ready board where you talk about accessing CIRCUITPY.
@idle owl The same way you provide direct link to the right forum, would you consider a direct link right into #circuitpython-dev . I am not a discord expert, but AFAIR that is the kind of link I typically get invited too.
@half sedge tried to reset my Mac and that did the trick. Still not sure why it was giving that error.
@light gate Thanks for noticing the typo re Trinket M0 pin #4/A4. I've fixed it to "use A4".
@tulip sleet @idle owl I was planing with a CPX last night and created the lastest 2.x build. I noticed that in creates a "built-in" version of hte lis3dh library and that include the examples folder from that library. help('modules') showhs them as built-in. The spinner examples work OK (from examples import spinner) but the adc and tap examples don't work because the I2C addresses are incorrect. Is including the examples folder as a frozen module intentional or just byproduct of including the library.? Does it make sense to "freeze" the examples especially if they don't work?
@solar whale I could not freeze examples. That sounds like a good idea. We'll discuss it. But could you submit an issue about the bad examples anyway? Thanks!
@tulip sleet sure - I'll open the issue this eveing when I can create some clear examples.
@solar whale Thinking about this, I believe the CPX uses a non-default I2C address for the LIS3DH. The LIS3DH breakout board uses the default address. So the examples may be for the breakout. So it's not a bug per se, but perhaps should be documented in the examples that the CPX address is different.
@jerryn pointed out that the code in the examples directory was frozen into the CPX frozen libraries. In the case he mentioned, some of the LIS3DH examples are actually buggy with respect to the CPX because the I2C address needed is different.
I propose not to freeze the examples. Not sure that .mpy's of examples are that useful anyway.
@tulip sleet that is exactly the problem. And a good reason for not freezing the examples. It is trivial to correct them in the .py file.
@tulip sleet Also, some of the exmaples, like the spinner are pretty large so they take up a significant amount of space. I think it is better for the user to just install the desired exmaples in general.
@solar whale yes, it's about 4k bytes (just rebuilt without). and it gets put in a top-level examples dir. Altogether, wrong.
agreed! thanks
@errant grail hiya we have a map fucntion in simpleio
its annoying they dont include it in python π
@tulip sleet we should probably get the frozen modules to include their real version string
@slender iron where does the __version__ = "0.0.0-auto.0" subst happen? Looked a couple of places and can't find it.
it doesn't yet
but I should probably add it before 2.2.0 stable freezes things in
I'd have the circuitpython-build-tools do it
so it will check in the revised library .py file? (not just subst in bundle)
Here is the list of libraries that still need an examples folder:
- [ ] Adafruit_CircuitPython_RTTTL
- [ ] Adafruit_CircuitPython_SD
- [ ] Adafruit_CircuitPython_IS31FL37
- [ ] Adafruit_CircuitPython_Thermistor
- [ ] Adafruit_CircuitPython_BNO055
- [ ] Adafruit_CircuitPython_DotStar
- [ ] Adafruit_CircuitPython_DS1307
- [ ] Adafruit_CircuitPython_MCP98
- [ ] Adafruit_CircuitPython_MAX7219
- [ ] Adafruit_CircuitPython_ADS1x15
- [ ] Adafruit_CircuitPython_PCF8523
- [ ] Adafruit_Ci...
@tulip sleet I wasn't planning on having it commit
@slender iron out for a couple of hours
kk, I will be in a couple too for the gym class I do. will start looking at the version stuff now
if it commits then you could id the library right away even if standalone
but its out of date the moment we change the library
unless the commit only lives under a branch or tag
...
hmm... that's a point, but a build of something often embeds the version. Maybe it's not in source but computed or there's a version.py or something... have to think about this
my plan wsa just for the build tools to do a substitution before zipping or mpy-ing
i'll simulate that in freezing (or call your script), or extract from the bundle instead of using submodules
ok now really gotta go
kk, byeee!
@meager fog Thanks! Nice that the constrain function is integrated with map. There are a couple of other simpleio functions that will be useful, too. π
python question, using from lib_name import function_name will only add that function to memory and not the whole file, right?
right
Then I agree with CGrover that we should look at other functions to add to simpleio
actually, the object and its attributes get included
I wasn't proposing adding to simpleio, just was planning to incorporate what was already there. I don't know enough about what's already in CPy to have an opinion or observation just yet.π¬
Technically, "from" copies a moduleβs attributes, such that they become simple variables in the recipient.
@meager fog hiya! ping me when you have a minute pls
@half sedge That was a good catch. I didn't realise that the ESP8266 was mentioned. This is supposed to be a very beginner guide, and working with the ESP8266 is not really a beginner situation. There are also other M0 boards that work with CircuitPython that are not mentioned in this guide. I'm going to look into what the plan was with this, but it may be that already-existing guides will be the answer.
@half sedge Discord is covered in the Welcome to the Community guide, and the CircuitPython channel is specified there.
@opaque patrol Turns out, memory-wise, it's actually better to import lib_name than to do from lib import function. Something to do with how it reads them, it takes up less memory in the end if you just import the lib. We tested this because I wanted to know. And from lib import * is the worst memory-wise.
@opaque patrol actually, "from lib_name import function_name" won't save any memory, it's equivalent to "import lib_name; function_name = lib_name.function_name"
you still have to import the whole library
however, for built-in libraries, there is almost no cost for importing them
since they reside in flash anyways
@stuck elbow @idle owl Okay, I thought that might be the case
import lib_name will use less memory, because it doesn't use memory for the additional entry in your locals dict
@meager fog nm, we're covering it in the email thread.
yep!
@stuck elbow Is there a noticeable memory impact for non-Express boards like the Trinket M0?
@errant grail it's the same
@errant grail @opaque patrol feel free to add issues to simpleio for stuff you think would be good. its kinda meant to be a "things that you'd expect to be in python or our libraries but isnt for Reasons so its going to be put here"
@meager fog I'm certainly not there yet, experience-wise! I probably won't be proposing new stuff for a while.
sometimes the beginner-er you are, the better the suggestions!
yeah, when you are all experienced, you just take things for granted and never notice that they could be simpler
Yikes! Too much responsibility too soon! π
Your telling me that "import lib_name" has a smaller footprint than "from lib import name"? Sorry, I'm having a real hard time understanding that. Unless it's an "embedded" issue.
we won't kill you if you don't come up with anything
@lofty topaz no, it's the same in "big" python too
consider what happens when you import a module
python has to execute all the code in it for it to define all the names and such
@tidal kiln Let me know if what I just sent in email works for you so we're not stepping on each other updating. Unless you've already started, in which case, I'll leave it.
it has no way of knowing which parts of code are necessary and which are not for the one name you want
it has to run the whole thing
and imported modules are cached in sys.modules, so the garbage collector will not even free the names you are not using
@idle owl yep. sounds good.
@tidal kiln Excellent. thanks again for catching all of that.
Thanks to Adabox006 I now have my 2nd CP express board (also have a M0 unused so far). I've been tinkering away and have a question I don't see addressed in the CP learn
It's great to be able to edit and run on the fly. But I am playing with multiple projects on one board. What is a best practice or technique for managing the code. I.e. when I want to switch from my Christmas light code to code for a project dealing with audio?
@tidal kiln "Code will loop "while" the condition is "true" (vs. false), and as True is never false, the code will continue forever." Does that work?
@errant grail Just find a convenient way to make it look like it was some elses idea
And is anyone using Github + Atom to manage what's on the board (talking about code.py stuff, not the CP github)
@limber tulip if you're using circuit python, just make a folder on the disk, then you can toss your files in there
it wont read a main.py if its in a folder. then name the folder what your project is
@limber tulip I use VS Code, but I always save my files on the hard-drive as well
I feel I could klutz things up and lose my code some day...
it works pretty well - you always have your code with you π
oh yeah keep backups
you can have a git repo in your CPX
i do that, when working on bigger projects
its just a bit slow
@idle owl your call. just concerned about forming an early misconception about how loops work with current wording.
Anyone know if Atom can be setup to automatically save a file to two folders (one to the Express board, one on the computer)?
(Maybe I'm over thinking this)
@tidal kiln I agree with you. I'm just checking that I'm not putting out bad info again. Is what I sent valid?
@limber tulip that's an interesting idea, maybe it could be added to the plugin that forces the usb refresh
@limber tulip Basically I edit on the board a bunch, and then copy that file to a local folder called CPXDev every so often so I have a local copy. Running a github repo from the board could run you into memory issues sooner than otherwise, but it's easy to fix since you'll have a known culprit. But it would guarantee, as long as you keep up with commits, that you have backups. It's a solid plan.
@limber tulip if you type the command to copy the file from the working directory to the usb drive, then you can use up arrow to preview it and enter to run it again
It all comes down to what workflow works best for you.
@stuck elbow Just did some reading about the import process and your right. When first loaded, the entire module is actually executed. After that, a reload is required to run the module if need be. I'm sorry for not knowing that. Way too much memory of C/C++ and the include statement which I thought it was mimiking.
@idle owl maybe change 'continue' to 'loop' -> "the code will loop forever", otherwise sounds good
Thank you!
@lofty topaz please don't be sorry for not knowing things, we are here to learn, and I'm very happy I can still tell you something you didn't know!
I have a feeling that won't last long.
@idle owl your comment makes me think I could also have Atom save to a folder on my computer. I'm sure either Atom or if not the editor then macOS could detect that and copy it to the board
then I could have it in a repo
Yeah I don't know, but that would also be a solid plan. Could use a script or something... runs a diff every so often and when it finds one rsyncs to a local directory? I have no idea if that's even a possible thing or if that would even be right, so don't take this to be an actual suggestion.
I have not done it myself but I know macOS can be set up to run a script when a folder changes
You could try this on windows https://superuser.com/questions/557132/continuously-copy-all-file-changes-from-one-folder-to-another-on-change-windows
wonder if the PlatformIO people woudl want to support this in Atom?
@timber lion and I were talking about making ampy a file watcher yesterday too
I do like Kattni and work directly in the file on the board and then copy it to the harddrive, usually I just copy/paste the file contents so I can use descriptive file names
I copy and rename.
I wouldn't want to copy the whole folder over b/c I would have repo stuff etc there too, just the actual code file.
Anyway, I'll noodle on this a bit. Done a ton of SW dev and really dislike doing it without a safety net (source control)
yeah, source control is such a great thing once you get used to it
that and code reviews
Source control is awesome, munge up your code really bad and just do a re-get
I have the BNO055 hooked up to test the PR and I'm getting no data out of it. Should be hooked up correctly, it's not complaining about not seeing it, but the example code returns 0s across the board.
@tidal kiln That should be all the other issues you pointed out cleaned up so you can do your thing whenever.
@opaque patrol you can even do stuff like bisect to find when you broke something
@idle owl that's i2c, right?
@stuck elbow Yes.
@stuck elbow most definitely
Ok
@stuck elbow yep https://github.com/adafruit/Adafruit_CircuitPython_BNO055/blob/master/adafruit_bno055.py#L3
ah, no I made that driver %)
@opaque patrol this is something we've thought about but yah we dont have a 'auto backup' solution at this time. if you find something, let us know π
@idle owl let me test it again
Ok.
I'm running it with the PR version of the lib, so if it works for you, we need to compare apparently.
check your BNO055 with arduino too just to be sure it's not a wiring or assembly issue
good to get a positive result from it first
the chip uses I2C clock stretching IIRC so it can be a little tricky
@idle owl getting all 0s too
Ok that's at least good
but I remember it used to work
if it helps it worked great for me on 2.1 about 3 weeks ago, can see the screenshots I got using it: https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/circuitpython-code
was using an m0 basic
Hmm I noticed that. I'll try the current lib.
Yeah I'm about to
and you might roll back to a previous bus device and register lib just in case
hrm i think there are problems with the pull
the initialization is swapped up a bit
it's trying to read and interact with registers before powering up the board now it seems
ah no actually it looks the same there
in any case, the communication itself is correct
it's just that the sensor returns 0s
so probably something with initialization
in case 2.2 changed anything the one thing this chip is weird about is clock stretching, i remember the pi has a bug and doesn't support clock stretching so we use the serial interface there
I think circuitpython raises an exception when it doesn't get an ack when it expects it
argh, I have a meeting in a moment, I need to run
Ok, so it's the lib overall failing, not the PR specifically?
seems so
you might roll back to 2.1 and see if it works, that was what worked for me
then it helps narrow down if something in 2.2 changed
i'll back you up, it worked 3 weeks ago π
@timber lion Ok, I'll put together a fresh board and run it from there, see what I get. Thanks for the advice, good to know I have a place to start.
@timber lion thanks!
slight regression in discussion: I created a simple python script that will watch code.py in a MacOS folder and update my CPx when it changes. So have one project all setup in Github now. Safety net installed π
No, the script just checks the modification time every second. Not elegant but fine for a first attempt.
yes, first make it work
Ok, so I was running 2.1.0 already. I just loaded the libs from the 2.1.0 release (so before we started autobundling) and I'm still getting zeros. Tried the 28 November one as well.
@idle owl did you tried to change the i2c frequency?
No, I don't know how to do that
sorry, I'm still in a meeting
That's fine!
when you create the I2C object, you can pass a 'frequency' parameter
So, here? i2c = busio.I2C(board.SCL, board.SDA)
Nothing
as a sanity check does it work in arduino with the arduino lib? good to rule out any issue with connection, soldering, etc.
that's odd if you still see zeros
I don't know Ardiuno or have anything running it, that's why I haven't tested that
maybe the firmware on the chip expired π
oh check out the board's guide, it can show you how to get a basic test running
Yeah I had it up already
It just flashes like a uf2 once you have it up in Arduino IDE or whatever the software is called?
unfortunately no, it's a little different
check out the board guide though, for example m0 basic: https://learn.adafruit.com/adafruit-feather-m0-basic-proto/setup
Same for M0 Express?
that shows you what to do to configure arduino to program the chip
i'd go to the express guide just to be sure to follow the same guide as your hardware
Ok
but yeah follow that to get a basic blink LED sketch going
then install the libraries the bno055 guide mentions, you can actually search for them in the library manager and install there easily (tools -> libraries -> manage libraries, then type in the library name in the search box and it will filter down)
once you program the boardwith arduino it will erase the circuitpython firmware too
data on the SPI flash will stay though
so after using arduino you'll want to load the circuitpython uf2 again
it's under sketch -> include lib -> manage lib...
i always look for it under tools for some reason also though, they should just move it there
oh right yeah they put the library manager in an odd spot
yep. after you add the url under preferences. stuff is kind of spread out. π¦
And apparently takes a while.
/home/sheep/Stuff/sketchbook/libraries/Adafruit_BNO055/examples/rawdata/rawdata.ino:2:29: fatal error: Adafruit_Sensor.h: No such file or directory
#include <Adafruit_Sensor.h>
yay
yeah you need the unified sensor library too, check out the guide to see the libs it mentions: https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/arduino-code
but that one is not installable from the library manager
oh search for unified, IIRC it's under an odd name
arduino's search leaves a bit to be desired :/
it's just a simple filtering.. no stemming or other simple things
ah nice, wow weird but doesn't work with 2.1 for you?
odd i wonder if it's the bus device and register lib.. i was using a slightly older version
the one updated with readinto IIRC
let me test different versions
I tested old versions of all
What versions were you using @stuck elbow ? Can you just drop the files in here so I can try them? the .mpys and your code.py.....
I just reflashed the trinket m0 I was using, so I don't have them anymore
it worked with arduino
not with cp
still all 0s on 2.0 with the latest register and bus device
wow that is odd, i'll grab my bno055 to try
got it to work
by changing the delay in time.sleep() at line 179
aaaah
time.sleep(0.01) is the same as time.sleep(0) now, isn't it?
Line 179?
I'm lost. I'm not sure I'm even looking in the right place.
def init(self, mode=NDOF_MODE):
chip_id = self._read_register(_ID_REGISTER)
if chip_id != _CHIP_ID:
raise RuntimeError("bad chip id (%x != %x)" % (chip_id, _CHIP_ID))
self.reset()
self._write_register(_POWER_REGISTER, _POWER_NORMAL)
self._write_register(_PAGE_REGISTER, 0x00)
self._write_register(_TRIGGER_REGISTER, 0x00)
time.sleep(0.01)
self.switch_mode(mode)
time.sleep(0.2)
this is the code that works for me
hrm not sure what's up but it works for me as-is right now
import board
import busio
import adafruit_bno055
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bno055.BNO055(i2c)
er
ha, because you do it manually
and you wait after creating the sensor and before reading from it
ahh interesting
that's odd if there's a timing issue with the mode switch
but yeah that might be the case, i remember ktown's arduino lib is careful about timing after mode changes
i did the same with the pi version
the datasheet says there is delay
I remember that when I was writing it
I guess circuitpython got faster?
around some i2c stuff
yeah we use a 30ms delay: import board
import busio
import adafruit_bno055
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bno055.BNO055(i2c)
geeze copy paste fail today
File "code.py", line 6, in <module>
File "adafruit_bno055.py", line 111, in __init__
File "adafruit_bno055.py", line 175, in init
File "adafruit_bno055.py", line 117, in _write_register
File "adafruit_bno055.py", line 117, in _write_register
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 94, in write
OSError: 19```
@idle owl check wires
yeah os19 means it isn't doing i2c communication as it expects, like not getting an ack back
in the initializer it's probably trying to check the chip ID
usually wiring or power
vin to 3v right? Not USB?
i use 3.3v, but 5v/USB should be ok to
too
but it requires the board to be plugged in to power up
I still had the frequency change in there you had me test
There it is!!
Works with newest versions of bus_device and register
ah nice, so yeah it looks like there might be a tweak to the mode change to add more delay
I think I found the issue with the PR too
but it might not be necessary if people are using from REPL or doing a few slower things
it can't hurt to add though
funny thing is, if you start reading too fast, you will always get all 0s
even after a while
like it gets stuck in some error state
ah fun, yeah probably buggy firmware on their side π
Ok I can't figure out how to fix the PR. I'll review it and request changes and include the change we made for comparison
there is a number of problems with it
Ok....
the mode switch is removed, the delays are removed
Do you want to do the review then? Because I was going to just say "PR fails, doesn't work right now either, here's what we changed".
I mean with better wording but not typing it all out here
I have it typed up, I can post it anyway if you want
But if you want to, you obviously have a better handle on this than I do.
I will try it
Okay
Should I hold off on the review then?
Or post it and tag that you're going to look at it
@idle owl add your feedback and also add deshipu as a reviewer
Ok
thanks for the bug finding!
Yah, I'm finding more and more it's bugs and not me, which is pretty keen
yeah i'd say close that pull and re-do it with just lint changes
the mode switch change removed the delays but they're definitely required
then as a separate pull change how mode is updated with property / etc
I don't agree, this has already had testing and eye balls on it. why discard that?
the original switch_mode function didn't have a sleep either
can update the pull, but my feelings are lint changes shouldn't change behavior that lint isn't complaining about
they should be separate changes so it's easier to test in isolation and find these bugs
yeah, I think thats fine for the future
I don't see the need to redo existing changes though
yeah, just make sure we don't forget to make the fix π
is there a comment or something to add to the pull?
can you open a bug on a pull request perhaps?
That's what I did. You can do it to specific lines of code if you want to get detailed.
yup! thanks!
@tulip sleet Hey do you want me to close the the do not freeze examples into CPX issue? The associated PR was merged.
@idle owl sure, though I was going to clean up. but go ahead
Oh I can leave it if that's the case. I wanted to offer in case it had slipped into the list of things to do
@slender iron re placeholder version: besides ".plus." did you consider using the git commit id like the CPY version thing in py/makeversionhdr.py
@slender iron the switch mode function didn't have a delay, because you don't need it for CONFIG_MODE
this tab-completion is seriously broken
anyways, you only need a delay after mode switching before you start the readings
the init() function had those
you removed them
Question: is it possible with Circuit Python to execute a .py on the fly? E.g. pressing button 1 on the Adabox006 remote would run one .py, button 2 a different one, etc?
you also removed the call to switch_mode from init that is necessary
@limber tulip yes, use __import__(name_of_the_module) β but it will only work once
I was wondering about something like: os.system("script2.py 1")
from standard python
what are you trying to do exactly? there is probably a better way
roadfun, what you want to do is make a function in your .py files like def main() and put your code there.. then on button 1 press import that file and call its main.. like if it we foo.py: import foo , then foo.main()
I am a bit disapointed that adafruit did not use their RTTTL library for the CircuitPython Snow Globe example of adabox006. I have been working on RTTTL recently (not on the CPX but on Trinket M0) and I collected in RTTTL format a few xmas related sound you may want to use: https://gist.github.com/dglaude/71525a07f5e24888a3f098fba3abf29b
there's no concept of importing a .py file to run right now, python kind of expects you to build that semantic yourself with module functions, classes ,etc.
lots of options π
It is a bit untested, but I remember listening to many of those... a nightmare.
thanks @timber lion
@fallow falcon I think that library didn't exist back then
also @stuck elbow
@stuck elbow @limber tulip I found this in the micropython forum a few weeks ago. It does seem to work in CPy:
def reload(mod):
import sys
z = __import__(mod)
del z
del sys.modules[mod]
return __import__(mod)
yes, I'm using it too for loading games in PewPew β but it won't work with every module
the first import is unnecessary
also import sys should be at the top π
it only works with modules that don't have side effects
like monkey-patching another module, or something
Hey @tulip sleet is it OK if I use your VU meter code, e.g. uploading to a repo for a project? Any license or etc?
@limber tulip I'm trying to track down the original Adafruit project that used something similar. will get back to you
I think @timber lion adapted the code from here https://learn.adafruit.com/3d-printed-led-microphone-flag/circuitpython-code. @timber lion, is that the origin?
@tulip sleet I adapted it from @timber lion's megademo. I changed it up a bit and slimmed down the functions.
I don't know past that.
@idle owl heya can i delete this? https://learn.adafruit.com/admin/guides/1854/editor
@timber mango I separated it in the event we wanted to do a more detailed intro to coding with CircuitPython because it got way too detailed for the beginner's guide. I didn't want to lose what I had written so I tossed it into another guide.
But I think we covered it well enough minus getting into class and objects and whatnot
I can delete it
its all good can keep if ya like
@idle owl about @timber lion megademo... is it going to be released?
was confused at first "wait i thought i made this guide live"
If we end up doing a next level coding-with-CP guide, it'll be a good place to start.
Oh! sorry!!
how about ya rename it then?
Will do
good!
Made it Coding with CircuitPython
@limber tulip it was kind of hacked up and we're working on a better version, but go ahead and include it - it's MIT licensed so attribute it to being adapted from code by Adafruit Industries per the license text in the link I gave above.
That's the only downside to using Discord to trade code, is if it's not ready for primetime, everyone can still download it themselves and use it. Β―_(γ)_/Β―
@limber tulip was the idea to free resources when the next .py module is called. Like: you have 2kb of RAM, and need to reuse it?
@timber mango no exact project yet, but was wondering about being to write or update code on the fly and load it to execute as part of a "larger" project. Larger being relative of course. I've not used Python on a non-OS before so trying to get my brain adapted to the limitations
Self-modifying code?
yes,in a way, or writing code on the fly to customize behavior
@meager fog I sent another review to the cpx lib changes. I thnk the API part is good to go. I offered to make the docs clearer and add another example, did you want me to go ahead and do that? Figured that would clarify some of the issues I encountered when using it this way.
Might make more sense actually to just merge this and make another PR to clean up the docs
@idle owl and @stuck elbow thanks for the review on bno055
@limber tulip python is dynamic enough to let you do most of what you would do with self modifying code without that
@slender iron np
@idle owl ill tkae a look at cpx tomrorow, still catching up on stuff for show
for example, you can define functions and classes on the fly
without having to write any code into files
@timber mango Ok np
I'll have to look into that, all part of learnin'
@idle owl I was testing tapping. I find it works great if I hold the CPX by the USB plug. Just on the table is a lot worse. Very consistent if the board actually moves. More like a flick detector than a tap.
I would nominate @stuck elbow as Always Helpful dotcom.
@tulip sleet It seems pretty consistent in a lot of ways after altering the threshold.
@timber mango thanks, but I just like to show off π
That's a valid motive!
@timber mango did the boards arrive safely?
@idle owl I was using the numbers from your example: lis3dh.set_tap(1, 80, time_limit=4, time_latency=17, time_window=110). Is 80 the threshold() you mean?
Yep.
I had it at 17 for double_tap
Single went off if I even looked at the board at that number.
I got those burst of insensitivity we were talking about where it wouldn't print. But holding it that never happens.
Right, it only happens if it sits for a bit
And it's not the board, did you add lights?
It seems like it's the serial console
Because the board never stops flashing when it's tapped if you have lights tied into the code
@Dan @idle owl no i wrote the audio meter myself, it was based on philb's arduino code
I blinked the blinky led in the loop with the print
that 3d printed project probably used it from the mega demo
Ah good to know
but i changed up the frequency scaling to simplify it a lot vs. the arduino code
i was running into a ton of memory issues and every line of simplification counted
Yeah I slimmed fscale down even more.
@timber lion everybody wants it! It's good for a mini learn guide by itself
re: megademo.. we need to dust it off and see if it works in the latest firmware
like i said i was down to literally removing single lines of code to get it to work π
Exactly
As a wanter I think that project has a lot of possibilities.
@limber tulip so you can attribute it to @timber lion and @idle owl
All kinds of "cool pulsing lights"
@tulip sleet I just put it up and included you and the 2 of them
@idle owl I jused used your handle here, if you want me to put a name in just let me know
*just
That is my name π
very good!
@tidal kiln hey how did that onewire bus go?
This isn't absolutely critical for the release although it will make it hard to flash from arduino and breaks Rosie CI which uses it to reset.
@timber mango its checked in a looked really good
ok ready for it to be added to the DS18b guide then?
Adafruit_CircuitPython_DS18X20 - CircuitPython drivers for the DS18x20 one wire temperature sensors
@tidal kiln rocked it
I made an LED blink! I've never actually used a basic LED before. π
Use a series resistor with a discrete LED to limit current .. or .. pulse them for a very short duration, and avoid high percent duty cycles.
I have a resistor in there
To save on power, blink at 400 times per second.
To draw digits on a 7-segment display, sequentially, from one digit to the next .. blank the display (entirely) before painting the next digit in series. If you don't you get ghostly artifacts across the entire display.
@slender iron I can't test the joy featherwing example on the seesaw PR - don't have one. I fixed an issue with the driver and it works with an LED. Should we wait to merge and test that example? Looks like all the changes you made to it were cosmetic not to the code.
yup to you as the reviewer
ok
we could always find someone with the joy wing too
I wanted to get one anyway π but it'd faster if someone else already has both.
I'll comment then but not merge then
kk, sounds good
Just tell the UPS guy in New York to test it in the brown truck. π
just tagged a new release tools build so newer releases will have their version filled in
Nice!
π¦ .travis.yml needs overwrite: true under deploy
@slender iron you need adafruit-circuitpython-tools sed tool to make mass edits on the libraries
yeah, we'll get there
@idle owl Just read over your welcome guide - it's great!
@prime flower Thank you!
It's so good...parts of it may benefit another guide (I'll let you know deets over PM)
@slender iron found a general tool for doing bulk work on multiple repos: https://github.com/pazdera/gitwalk
@tulip sleet starred!
@slender iron saw this on HN this morning (https://github.com/pojala/termipal). I'm going to play with the idea of making a circuit python terminal extension again π
extension for what?
This is their "microUI" example, it "attaches" a gui line to the terminal. something similar for connecting to the board/repl for people unfamiliar with the terminal
maybe a good idea, maybe not Β―_(γ)_/Β―
@idle owl your new guide is on my βto readβ list for tomorrow. Looks sweet!
@limber tulip That's great! Thanks!
got module playground boards in π
I've flashed my Circuit Playground Express with CircuitPython uf2 file .. can I go back to be able to use Arduino sketches? Do I need to flash with another uf2 file?
@rustic wind You can just upload Arduino, and the IDE will replace things.
You'll have to drop the CircuitPYthon uf2 back on if you want to swap to CircuitPython
@cunning crypt Thank you so much, I will give it a try π
Fun fact!
If you upload arduino code
You can save the current.uf2 from the board
And it'll be a backup of the compiled arduino code.
and if you're on a trinket m0 or gemma m0 or feather m0 basic and you save current.uf2 when it's CircuitPython, you get CircuitPython and everything in CIRCUITPY (this does not work on Express boards)
It won't work for CircuitPython because most of that is on the flash chip. But if your Arduino sketch doesn't mess with the flash chip, you can drop the CP uf2 back on, and your CP files should still be there.
@slender iron @idle owl I just ordered a joy wing and plan to do some work in CP with it.
Actually it turns out my partner had one. It's tested and merged π
But now we know it'll work for later!
Cool
I gots the big bunny mover coming my way BNO055. 9DOF assembly.
Manatees from Space, look out.
http://adafru.it/2472
.. I mean, when the djinn gives you three wishes .. well, you got to take them.
Thanks for the overhaul.
@timber mango think listen manatees and observe they movement patterns from they Space
@umbral dagger I wonder if there is some way to make it work consistently
I'm thinking about proposing a patch for the seesaw binaries to add a keypress buffer to it, so that it won't be missing keypresses
Added support for internal file system, and numerous 3.x series changes to bring MCU support up to date with master.
NOTE: The following addition was required to supervisor/port.h file for the nRF52:
#ifdef NRF52_SERIES
void HardFault_Handler(void);
#endif
Everything else is contained in the port folder.
For test and build instructions see ports/nrf/boards/feather52/README.md
great success, got my jlink to work with swd
turns out that you have to connect the vcc wire, because jlink has to sense the target voltage before it proceeds
I haven't done any meaningful BLE tests yet simply to keep the list of problems manageable at the start, and avoid the SD for the moment. The next item on the ToDo list is making sure SDv132 2.x and 5.x work fine, and playing with BLE support. Good to hear it works for you, though, and thanks for testing!
I merged tisi PR in my local clone of the repo. The feather52 build executed fine, but th boot-flash build fails:
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
nrfutil dfu serial --package boards/feather52/bootloader/feather52_bootloader_2.0.1_s132_single.zip -p /dev/ttyUSB0 -b 115200
Traceback...
There seems to be some sort of file property issue with the .zip files. Works fine for me locally:
$ make SERIAL=/dev/tty.SLAB_USBtoUART boot-flash
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
nrfutil dfu serial --package boards/feather52/bootloader/feather52_bootloader_2.0.1_s132_single.zip -p /dev/tty.SLAB_USBtoUART -b 115200
Upgrading target on /dev/tty.SLAB_USBtoUART with DFU package /Users/Kevin/Dropbox/microBuilder/Cod...
Ah - found the problem - the file feather52_bootloader_2.0.1_s132_single.zip in boards/featther52/bootloader appears to be corrupted - I replaced it with the file from microbuilders repo and am able to load the boot-flash and continue - everything is working fine.
I recall this happening on an earlier version as well.
Our posts crossed ;-) That was the problem - thanks
I noticed that if I upload a .py file to the file system via ampy and then execute it via the REPL:
import test
then then REPL does not respond to a Control -C to interrupt the execution as expected.
I have to manually RESET the board to get back to REPL.
Note: If I execute the code via ampy run or directlt u=in the REPL then control-c works as expected.
additional info - even if I cut/paste teh code into the REPL (using control-E) I cann interrupt with control-c
`Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 3.0.0-alpha.1-17-g60a23f0-dirty on 2017-12-21; Bluefruit nRF52 Feather with NRF52832
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import board
=== import busio
=== import time
=== import adafruit_tsl2561
=== with busio.I2C(board.SCL, board.SDA) as i2c:
=== tsl = adafruit...
Not sure if this is a place to ask, but based on what I learned here yesterday I created a game for the CPx in Adabox006. Haven't seen one like this but maybe someone has already done it? Basically the game cycles the LED's quickly with one position being red (random each game). You have to touch A7 just as that LED turns red in order to "win". Here's a video: https://www.dropbox.com/s/pjr324z6dkudtif/IMG_9217.MOV?dl=0
Wondering if it is worth finishing? Needs adjustable difficulty at least (speed of LED cycling)
BTW, hard to see the colors in the video but LED 1 is the target in the first game
simpler example from REPL:
>>> import time
>>> import time
>>> while True:
... print('hmmm')
... time.sleep(2)
...
...
...
hmmm
hmmm
hmmm
hmmm
hmmm
cannot interrupt
I can reproduce that here, thanks for the heads up.
@limber tulip cool game, nice work π
@idle owl ok i can do some work on 1) the guide 2) the cpx lib today
Thanks @meager fog ! I'll add a way to set difficulty. Running it with the shortest delay is very challenging. If interested the code is on Github: https://github.com/ronguest/Reaction-Game/blob/master/code.py
Once the difficulty is added I will post it to the Adabox forum
awesome, thank you!
PS. I originally wanted the player to have to do a hand clap to stop at the right moment, but I couldn't get it to read sound fast enough to keep the game challenging. I think that's probably unavoidable so went with a capacitive touch instead.
@idle owl I'm looking at your awesome CP guide. Can I make one request? When you do a REPL terminal on Linux you may need to do the sudo command. It took me forever to do it until I figured that out.
@flint oyster if you make youself a member of the group dialout, then you should not need to use sudo.
@flint oyster if you are not familiar with how sudo adduser <username> dialout
@tulip sleet Is this link OK? https://learn.adafruit.com/welcome-to-circuitpython#circuitpy-drive-issues
@tulip sleet that was RE: the forum post
I added difficulty settings to the Reaction game I wrote for CPx. Readme and code are on Github: https://github.com/ronguest/Reaction-Game
I'll post it to the forum later
Hi @idle owl I read through the updated "Welcome to Circuit Python" learning guide and have a little feedback since I just went through this a few days ago. What's the best way to send that?
BTW, it is incredibly detailed and incredibly helpful. Very well done!
duh, there is a feedback button the one web page πΆ
Feedback sent, hope it makes sense
@limber tulip when its ready, we can blog your project - if you can add a short video or animated gif of it working, that would get the idea across well π
Thatβd be cool. Thanks for all you do!
@limber tulip thank you for being part of this community π
@flint oyster just added: https://learn.adafruit.com/welcome-to-circuitpython/serial-console-on-mac-and-linux#permissions-on-linux
FYI build tools is broken for library packages at the moment. I'm looking at it now
@tulip sleet or someone else: https://github.com/adafruit/circuitpython-build-tools/pull/4
@limber tulip I made a game like that (though it wasn't my idea; was following a tutorial) many years ago on a Tandy PC-2 pocket computer (from Sharp, iirc, rebranded).
A researcher asked me what I was doing, so I told him (medical setting). He said it would be useful to measure reaction time of humans to novel stimulii, a somewhat unsolved problem.
Around the same time, a double-PhD guy (psychology, electrical engineering!) had me pay for one consultation session with him, by being the subject of a game where you wear electrodes (encephalogrammy stuff) and play a simple video game with a joystick. The entire idea was to keep a wandering line from moving off-center (it was constantly moving left or right, drawn top to bottom on the simple video display).
I think he was doing similar research: to see how I adapted to the game. /offtopic
sound very interesting @timber mango
@umbral dagger heya lookin at your guide! ping me when ur around
@meager fog I put a forum post up with a video of the game, not familiar with posting projects so not sure if it is "good" or not though! https://forums.adafruit.com/viewtopic.php?f=59&t=128356
@meager fog Iβm around
huzzah, i, honestly, know very littele about how to do that - but @slender iron is a pro and will help you out. meanwhile, we'll get this guide blogged π
No worries, git and I are old friends.
@umbral dagger just ping me if you have any questions
Was working through the new Circuit Python guide and on the page "Interaction with the Serial Consol" the last line of the sample code has [time.sleep = 1] but should be [time.sleep(1)].
Is there a download page (yet) for the Circuit Playground Express? I had to make my own schematic from EagleCAD, after hunting down the relevant files Eagle requires.
e.g. https://learn.adafruit.com/adafruit-metro-m0-express-designed-for-circuitpython/downloads
for the Metro M0 Express. Fritzing, schematic, yadda yadda.
No there isn't yet
@meager fog I'm digging into updating the Trinket page, and noticing you have 2.1.0 linked in the CPX page. Is the plan to update that with each release? Or is there a wildcard link for the CircuitPython builds as well?
@idle owl willlllldcard it up!
@timber mango files are here, not linked in yet. https://github.com/adafruit/Adafruit-Circuit-Playground-Express-PCB
@idle owl basically we should hvae one 'quickstart' that is direct links, and then for anything more, link to the guide
@meager fog Thank you.
Since 2.1.0 is in it twice, is it: https://github.com/adafruit/circuitpython/releases/download/2.*/adafruit-circuitpython-trinket_m0-2.*.uf2
use 'latest'
Ok
Ah ok
π
I was trying to get to a link that looked like that and it wasn't working, so I Wasn't sure it would work
Thank you!!
yah, it requires a little finesse, but will help avoid constant tweaks
Exactly, that's why I didn't like what I was trying to do
@limber tulip got it, will send to the blogteam π
Is this file more general? Could it be merge with ports/nrf/README.md?
Is this indentation weird because of tabs vs spaces?
Yup yup, and in the future I was to play with dynamically placing the heap in memory so we can dynamically change the size.
The zip file issue might be due to git's auto line-ending stuff thinking its a text file. .gitattributes can be used to ensure its correct.
@meager fog Is there an image already of Trinket with a green LED, or do you want me to do one up? (realised I should ask before I setup anymore photo stuff)
i dont have one π¦ if you wanna try taking it
I have a pretty solid setup here. I should be able to do it.
Finally sat down and flashed Blinka with custom firmware. Everything seems to work (except the fact that I connected the power from the regulator to gnd and had to work around that with a piece of wire).
it has a led in the eye, a speaker, and two touch pads on the front
I removed analogin to make room for audioio
@stuck elbow You could make the tongue a red status led that flashes π
those look cool
Next version will be a bit larger, with a battery β I just need @slender iron to upload the SVG files for the logo
because the ones I got by tracing the bitmap don't scale very well
@stuck elbow That's great! I am still waiting on getting mine, but I have all the parts to put it together.
I have to upload the version with fixed gnd
I have v1 I believe.
Scott might have figured out what was going on with why it didn't work, there were two pins needing to be bridged. Haven't had a chance to check yet though.
I never got v1 to work, because my programmer didn't work with the chip that I soldered on it
but now that I got j-link working, it's not a problem
How long until mk3? Should I wait?
Kurt's the one who bought these v1 boards. I have a friend who can actually solder the bits on - neither Kurt nor I could π
well, I'm waiting on the vector logo
gimme π
On it
so I can't promise how long it will take, but probably I will work on it over the holidays
That's totally fair π
I will probably also enter it in the Hackaday's Coin Cell Battery Contest
Oh so a lot bigger
@stuck elbow didn't I posted the ai files to discord last time you asked?
I see why you needed vector
@slender iron I sent them
You posted them for someone else I think last time you posted them
I think you guys have just missed each other every time he's asked
@slender iron I thought you would put them in the repository under "logos"
@slender iron if you posted them, I didn't see, sorry
Lol again
@cosmic fractal sorry, I have no idea how this tab completion works here
you would think that if you type the same thing twice, it would complete to the same nick
but no
Usually if you just type @ it shows you a list of the recent people who have spoken, that's usually what I use.
Type @ and then go down the list
@stuck elbow yeah I need to put them there
@idle owl that would require me taking my hands off the home row
Unless you just want to tag the most recent person in which case it's @ + tab
No moving from home.
I usually type @tan TAB
and for instance just now it suggested @crystal raft for that
gotta love computers π
So much!
Using any key modifier (shift, alt, ctrl) seems like a broken interface to me. π
.foo
See the dot commands aren't even in use.
Apparently the / on a newline brings up mischief here.
Oi.
π€ They've added possibly useful prefixing with the : key on newline such as π€ (can go anywhere in the line, apparently).
@idle owl I sent my feedback using the link on the learning guide. If you don't get it I can post it here too. All minor suggestions.
@limber tulip Also good. I'll let you know if I need to get the info from you. Thank you for giving feedback!
@meager fog Like this? https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython
l00kn!!
ok good!
last step...
have them install the 'default zip'
it will put on the special files to keep macos from creating things
also its a good emo
Oh nice. Ok
So sad! Poor mac os can't make hidden files
mm
yah! nice
hmm, unzip it, copy all the files over and tell it to replace? does it automatically take the hidden files with it if they're not visible? I'll need to do this on a different machine, I have hidden files enabled and it won't look the same.
@idle owl Is that true? I'm not surprised that the GUI "Finder" won't do it. But can't you make a file in Terminal whose name starts with a dot? Must try this and see.
That was partially a question, not entirely a statement
Also, I have hidden files visible in my Finder, so it won't look the same as most people's version of that folder, is the rest of what I was saying. So I shouldn't do screenshots for a guide from my version of it.
That's why I'll use a different machine for that.
I think I've come into the middle of something. I'm reading back now trying to get the flick.
No worries
Also, this trinket apparently already has that on it, heh. Let me see if my older one doesn't.
I apparently showed hidden files on the other machine too. Should have known I had done that π
The hardest thing to do is to arrange things so that you are seeing them just the same as a beginner is apt to see them. I don't even notice when I change the defaults to something that works well for me, personally, but isn't in the shipped version from the factory/manufacturer. Like, I don't even notice I'm doing that.
@meager fog Did we remove the troubleshooting page from the CPX guide?
Or apparently moved it completely.
Doesn't work from the cached link I have for the Feather M0 guide either. I see, it's not mirrored into either of those two anymore. Should I fix that? Or did we do that for a reason.
@slender iron That default zip for the Trinket. Is that just a highlight all the files and copy them, tell it to replace, and it's good? I'm not entirely sure what's going on with it because all the files are already on both Trinkets I have.
not sure what you are asking
Ok so Limor sent me a "default zip": https://cdn-learn.adafruit.com/assets/assets/000/046/589/original/trinket_m0_2.0.0.zip?1505610539
and told me to tell people, in the Trinket guide, to install it
ah ok
I'm a little confused
yeah, drag should work
because there's also a main.py in there which would replace theirs if they've edited it already
ok
Just making sure
It worked for me, but I wanted to make sure I knew what was going on with it
yup, thats to get back to the default state as we ship them
Ok
Odd to put it in the quickstart section then? Or should I specify to copy only the .files since that's what she was referencing when she said to "install it" to (her words:) "it will put on the special files to keep macos from creating things"
So should I just have them drag over the .fsevenblah and .metadata_never_index files?
It's also supposed to be a demo about dragging files to the CIRCUITPY Drive I think
(food is here, bbiab, sorry to leave in the middle of a question)
np
@idle owl @upper gull @limber tulip @timber lion I fixed a bad bug in the microphone code in 2.2.0-rc1. The tip of 2.x has this fix, and it will be 2.2.0-rc.2 when that comes out. I also rewrote the sound level meter code quite a bit. It now does root-mean-square computation of the volume, and it seems to work better. There are a lot of values to tweak to make it more/less sensitive, more/less jumpy, etc. Preliminary version is here: https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_SoundMeter.py
Thanks @tulip sleet Iβll give it a try when rc.2 is out
@limber tulip - here is the latest .uf2 if you want to try it
Cool, Iβll give it a go tomorrow
@tulip sleet Thanks! Very cool.
@tulip sleet Nice!
@idle owl didya try it? it's a lot less erratic now.
@tulip sleet Getting the files now
I gussied up the pixel colors a bit, but if it's ugly tell me: my color vision is non-standard.
π Ok I'll let you know
No it's great! Only thing I might do is go the opposite direction, start with another color and go to red since usually once you're in the red zone it's really loud π
It was rainbow before, I changed it up when I was messing with it to slim down the code.
But this is great and the color bit is super slim!
feel free to adjust it: just need to change that one routine that computes the color. And I fiddled with the settings a lot, but it really depends on how close the sound source is to make it do what you want. We could maybe make it adaptive (adapts to some recent average of the loudest sound or something). The Amplitie project does that, I think.
Ok yeah. The adaptive stuff we tried before didn't work all that well, but there were obviously a ton of other issues going on, so we can't really say it wouldn't have worked anyway.
Reading into this a little more, I see you have commented out the options to make it set values. Nice
i do set the floor based on an initial reading. The ceiling is just what worked well.
yeah, I want people to play with it
Yeah I see that, and it wasn't quiet in here when I started it. Still working pretty well
Yeah you grabbed a lot of people with your amazing props show on S&T π
i was going to demo with a guitar but it was kind of too big. The Einstein was just a non-sequitur. I've had the pillow in the background for all kinds of AF videos: nobody ever said anything. It was a birthday present like 35 years ago in Berkeley.
It's brilliant!
we still have a lot of kids' toys and stuff; not sure what I'll come up with next time
Well I look forward to it! You always seem to come up with entertaining props.
@meager fog Let me know if this is the right idea or if you want it changed up: https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython
Ugh. This is annoying. I can't find my CPX
Oh wait no. It's right there.
Best way to find things: Complain about not finding it
Valid.
Oh boy. Arrays in Arduino are... a lot simpler than they are in CP.
Arduino effectively has just one type of array. Python has tuples, lists, sets, and dictionaries, each with their own quirks.
@cunning crypt but the choices are nice when flexibility are desired. and your unique id request is driving me batty. well, it's more a fault of my lacking C skills. π¦ π
@raven canopy Oh, I love the possibilities that the multiple types give.
And you're doing better than me on it. I wouldn't know where to even start.
well, i've gained a pretty good sense of how M/CPy is built. kind of like taking an engine apart to see how a car moves. it frustratingly fun! I think I'm close (or is it hope?). just gotta wade past pointer-to-pointer-to-pointer-to-array. lol
I'd love to give you some pointers on it, but it seems you have enough of them.
man, i tee'd that one up, and didn't even realize it. good form!
Trying to make a TFT breakout work. Code runs, display has power. Nothing is displaying.
@idle owl What type of TFT?
st7735r, the 1.44"
Oh, yeah, I had some issues with that one.
Primarily: There's two separate initializers, one for ST7735, one for ST7735R
oh....
One worked. The other did exactly as you described.
bugger. Do you know what the one for the R is?
Because this is apparently not right then.
Wait like totally different drivers?
Different code. One sec, let me dig it up
I assume the size difference won't matter, it's definitely the R though.
OK, so, in the adafruit rgb display library