#circuitpython-dev

1 messages Β· Page 134 of 1

slender iron
#

πŸ˜ƒ thanks

idle owl
#

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 πŸ˜ƒ

light gate
#

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?

timber mango
#

@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
#

having problems posting.

#

do you see this post?

opaque patrol
#

@light gate Hi Chuck, I assume you are using Windows 7 and not 10?

light gate
#

that is correct W7

opaque patrol
#

I am not sure if you need to reboot, but with Windows it usually doesn't hurt....Did you reboot?

timber mango
#

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.

opaque patrol
#

@light gate Is the status light coming on? What color or colors is it?

light gate
#

@opaque patrol I have a green lite and the .dot is varying colors.

#

@opaque patrol Yes I have restarted W7

opaque patrol
#

@light gate Did you try pressing the reset button?

light gate
#

@opaque patrol pressed the reset; red led lit momentarily ; DotStar blue > green > red.......

#

@opaque patrol and the green on LED is green

opaque patrol
light gate
#

thankyou!

opaque patrol
#

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.

light gate
#

let me check the cable........

timber mango
light gate
#

@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.

opaque patrol
#

@light gate Great. Let me know if you need any more help.

light gate
#

and I have Adafruit Trinket MO on COM20

idle owl
#

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.

meager fog
#

@idle owl hiiii

idle owl
#

@meager fog Hi!

meager fog
#

im reviewing yer starter guide

#

is now a good time to chatter?

idle owl
#

Yep!

meager fog
#

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)

idle owl
#

Ok yeah, nice!

meager fog
#

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?

idle owl
#

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

meager fog
#

ok yah

#

ill not edit that page anymore, just refresh and let me know when done

#

ill move to the next pages!

idle owl
#

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?

meager fog
#

yah plz

idle owl
#

Ok! I had something for it but it got too detailed. I'll rein it in.

meager fog
#

yah its a difficult balance

idle owl
#

We're calling them libraries and not modules right?

meager fog
#

yah

idle owl
#

keen

meager fog
#

like, at least one

idle owl
#

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

meager fog
#

i think yah just the first one

idle owl
#

ok

meager fog
#

then its just minor edits anyhow

idle owl
#

Done on that one. Still working on explaining the led lines.

#

(tested what I embedded too)

meager fog
#

ok yeah im reading the REPL code

idle owl
#

Ok I think I got the explanation.

#

That's a tough one to keep simple but be clear on.

meager fog
#

kk brb

idle owl
#

brb too!

idle owl
#

Ok

half sedge
#

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.

idle owl
#

Night!

pastel panther
#

night!

meager fog
#

@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

idle owl
#

Sounds good

#

But are you planning on mirroring this into the other guides?

#

Because if so, you'll have the troubleshooting page twice

tawny tusk
#

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

meager fog
#

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

meager fog
#

@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?

idle owl
#

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

tulip sleet
#

@idle owl I set the search prio on it to 1, so it will show up top of the list for circuitpython, etc.

idle owl
#

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...

tulip sleet
#

congrats!

idle owl
#

Thanks!

meager fog
#

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?

idle owl
#

I do not!

meager fog
#

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

idle owl
#

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?

meager fog
#

well lets start with one guide

#

how about...trinket m0?

idle owl
#

Ok will do πŸ˜ƒ

meager fog
#

for now

#

then mirror in the proper matching pages

idle owl
#

Ok. I think all of CircuitPython page is covered in the guide.

#

Ok! Will do!

timber mango
pastel panther
#

neet

idle owl
#

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

tulip sleet
#

I suggested the <>. Not sure about //

idle owl
#

Ah ok nm.

#

I didn't test it, I couldn't remember what you suggested.

tulip sleet
#

I discovered that by accident while reading something else about discord

idle owl
#

Always useful to have more tricks

pastel panther
#

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

tulip sleet
#

@pastel panther good luck! I have no immediate advice

pastel panther
#

@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

meager fog
#

@idle owl ok lemme take a look

#

i was doign some Other Guides

idle owl
#

Guidin' it up

meager fog
#

woooooo

#

yeah i am making the sensor guides point to your pages

#

instead of like, a range of different guides

idle owl
#

Yeah! I love it

idle owl
#

no it's < >

#

I was wrong

meager fog
#

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

idle owl
#

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

meager fog
#

ok i did a big reorg, so refresh

#

you'll see i split up the starting-stuff from the code stuff

idle owl
#

Oh yeah I see

#

nice!

meager fog
#

ok ready for your next quest?

idle owl
#

Yes!

meager fog
#

the same (essentially)?

idle owl
#

Yeah

#

You nailed it well πŸ˜„

#

I beginnerified it a little more I think but they're essentially the same

meager fog
#

ok ill try to merge them so i can get rid of one

idle owl
#

Ok.

meager fog
idle owl
#

Got ya. Am I leaving out bossac at this point?

meager fog
#

yeah leave it out compeltely

idle owl
#

Awesome

meager fog
#

we'll point people to the advanced page if they ask, which nobody does

idle owl
#

lol truth.

toxic knot
#

advanced page? I was just going to ask about the advanced page. ( Not really, I'm just a beginner.)

tulip sleet
#

@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

timber mango
#

The Bossacs were the fearless horsemen of Russia.

idle owl
#

@tulip sleet it's the CPX quickstart I'm going to be using to build the trinket one

meager fog
#

@tulip sleet oops yeah just change those words to another editor

idle owl
#

Oh I got you, the other way around.

#

I'm not seeing it in the CPX quickstart...

tulip sleet
idle owl
#

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

tulip sleet
#

oh i see yeah that's later, you just want to fix the install part

idle owl
#

But I'm waiting for the go ahead on that.

toxic knot
#

can I use circuit python on a chromebook?

idle owl
#

Yes!

tulip sleet
#

it looks like a usb drive

raven canopy
#

@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. πŸ˜„

idle owl
raven canopy
#

@tulip sleet yeah, i set it up exactly how frequency and temp are done.

tulip sleet
#

@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.

raven canopy
#

now that is a PRO TIP!

tulip sleet
#

whenever you change a QSTR_foo_bar, you have to do that...

#

add or remove

raven canopy
#

building now....

toxic knot
#

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.

raven canopy
#

and now the "QSTR not updated" message makes sense. 🀦

tulip sleet
idle owl
#

@toxic knot Awesome!

tulip sleet
#

so you can talk to the REPL

toxic knot
#

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?

errant grail
#

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```

timber mango
#

@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.

toxic knot
#

Ok, Here I go, dragging and dropping...

timber mango
#

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.

toxic knot
#

I dragged and dropped. Now when I hit the reset, CIRCUITPY shows u;p intead of CPLAYBOOT

timber mango
#

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.

toxic knot
#

OK, cool, I can now click between the two. Still trying to follow on how to add the library bundle.

timber mango
#

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.

toxic knot
#

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.

timber mango
#

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.

toxic knot
#

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.

timber mango
#

@toxic knot did you do a control D?

light gate
#

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"

toxic knot
#

No, what does control D do?

timber mango
#

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).

toxic knot
#

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.

timber mango
#

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. πŸ˜‰

errant grail
#

If you're using Windows, you should "eject" the device before unplugging it from your system.

half sedge
#

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.

half plover
#

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 sedge
#

@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.

half plover
#

I’m unable to open the CIRCUTPY drive. I’m getting β€œCIRCUITPY” can’t be opened because the original item can’t be found.

half sedge
#

@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.

half plover
#

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.

half sedge
#

@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 plover
#

@half sedge tried to reset my Mac and that did the trick. Still not sure why it was giving that error.

tulip sleet
#

@light gate Thanks for noticing the typo re Trinket M0 pin #4/A4. I've fixed it to "use A4".

solar whale
#

@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?

tulip sleet
#

@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!

solar whale
#

@tulip sleet sure - I'll open the issue this eveing when I can create some clear examples.

tulip sleet
#

@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.

manic glacierBOT
solar whale
#

@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.

tulip sleet
#

@solar whale yes, it's about 4k bytes (just rebuilt without). and it gets put in a top-level examples dir. Altogether, wrong.

solar whale
#

agreed! thanks

meager fog
#

@errant grail hiya we have a map fucntion in simpleio

#

its annoying they dont include it in python πŸ˜„

slender iron
#

@tulip sleet we should probably get the frozen modules to include their real version string

tulip sleet
#

@slender iron where does the __version__ = "0.0.0-auto.0" subst happen? Looked a couple of places and can't find it.

slender iron
#

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

tulip sleet
#

so it will check in the revised library .py file? (not just subst in bundle)

manic glacierBOT
#

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...
slender iron
#

@tulip sleet I wasn't planning on having it commit

tulip sleet
#

@slender iron out for a couple of hours

slender iron
#

kk, I will be in a couple too for the gym class I do. will start looking at the version stuff now

tulip sleet
#

if it commits then you could id the library right away even if standalone

slender iron
#

but its out of date the moment we change the library

#

unless the commit only lives under a branch or tag

#

...

tulip sleet
#

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

slender iron
#

my plan wsa just for the build tools to do a substitution before zipping or mpy-ing

tulip sleet
#

i'll simulate that in freezing (or call your script), or extract from the bundle instead of using submodules

#

ok now really gotta go

slender iron
#

kk, byeee!

errant grail
#

@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. πŸ˜€

opaque patrol
#

python question, using from lib_name import function_name will only add that function to memory and not the whole file, right?

lofty topaz
#

right

opaque patrol
#

Then I agree with CGrover that we should look at other functions to add to simpleio

lofty topaz
#

actually, the object and its attributes get included

errant grail
#

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.😬

lofty topaz
#

Technically, "from" copies a module’s attributes, such that they become simple variables in the recipient.

idle owl
#

@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.

stuck elbow
#

@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

opaque patrol
#

@stuck elbow @idle owl Okay, I thought that might be the case

stuck elbow
#

import lib_name will use less memory, because it doesn't use memory for the additional entry in your locals dict

idle owl
#

@meager fog nm, we're covering it in the email thread.

meager fog
#

yep!

errant grail
#

@stuck elbow Is there a noticeable memory impact for non-Express boards like the Trinket M0?

stuck elbow
#

@errant grail it's the same

meager fog
#

@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"

errant grail
#

@meager fog I'm certainly not there yet, experience-wise! I probably won't be proposing new stuff for a while.

meager fog
#

sometimes the beginner-er you are, the better the suggestions!

stuck elbow
#

yeah, when you are all experienced, you just take things for granted and never notice that they could be simpler

errant grail
#

Yikes! Too much responsibility too soon! 😐

lofty topaz
#

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.

stuck elbow
#

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

idle owl
#

@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.

stuck elbow
#

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

tidal kiln
#

@idle owl yep. sounds good.

idle owl
#

@tidal kiln Excellent. thanks again for catching all of that.

limber tulip
#

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?

idle owl
#

@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?

opaque patrol
#

@errant grail Just find a convenient way to make it look like it was some elses idea

limber tulip
#

And is anyone using Github + Atom to manage what's on the board (talking about code.py stuff, not the CP github)

meager fog
#

@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
#

That's what I've been doing

#

Just wondered if there was a better way

opaque patrol
#

@limber tulip I use VS Code, but I always save my files on the hard-drive as well

limber tulip
#

I feel I could klutz things up and lose my code some day...

meager fog
#

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

tidal kiln
#

@idle owl your call. just concerned about forming an early misconception about how loops work with current wording.

limber tulip
#

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)

idle owl
#

@tidal kiln I agree with you. I'm just checking that I'm not putting out bad info again. Is what I sent valid?

stuck elbow
#

@limber tulip that's an interesting idea, maybe it could be added to the plugin that forces the usb refresh

idle owl
#

@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.

opaque patrol
#

@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

idle owl
#

It all comes down to what workflow works best for you.

lofty topaz
#

@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.

tidal kiln
#

@idle owl maybe change 'continue' to 'loop' -> "the code will loop forever", otherwise sounds good

idle owl
#

Thank you!

limber tulip
#

I might write a python script to switch between projects. it would copy the code.py of the current project to it's subfolder and copy "up" the code.py from the project I want to "activate"

stuck elbow
#

@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.

limber tulip
#

@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

idle owl
#

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.

limber tulip
#

I have not done it myself but I know macOS can be set up to run a script when a folder changes

opaque patrol
limber tulip
#

wonder if the PlatformIO people woudl want to support this in Atom?

slender iron
#

@timber lion and I were talking about making ampy a file watcher yesterday too

opaque patrol
#

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

idle owl
#

I copy and rename.

limber tulip
#

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)

stuck elbow
#

yeah, source control is such a great thing once you get used to it

#

that and code reviews

opaque patrol
#

Source control is awesome, munge up your code really bad and just do a re-get

idle owl
#

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.

stuck elbow
#

@opaque patrol you can even do stuff like bisect to find when you broke something

#

@idle owl that's i2c, right?

idle owl
#

@stuck elbow Yes.

opaque patrol
#

@stuck elbow most definitely

stuck elbow
#

I think I did the micropython driver for it

#

let me see

idle owl
#

Ok

tidal kiln
stuck elbow
#

ah, no I made that driver %)

meager fog
#

@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 πŸ˜ƒ

opaque patrol
#

I ALWAYS work on a copy

#

That and ctrl-S is a habit

stuck elbow
#

@idle owl let me test it again

idle owl
#

Ok.

#

I'm running it with the PR version of the lib, so if it works for you, we need to compare apparently.

timber lion
#

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

stuck elbow
#

@idle owl getting all 0s too

idle owl
#

Ok that's at least good

stuck elbow
#

but I remember it used to work

timber lion
#

was using an m0 basic

idle owl
#

Hmm I noticed that. I'll try the current lib.

timber lion
#

or maybe the PR broke it?

#

try without the pull branch

idle owl
#

Yeah I'm about to

timber lion
#

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

stuck elbow
#

I'm using the current master

#

and also get all 0s

timber lion
#

oh weird πŸ˜ƒ

#

huh yeah try with 2.1 and previous bus device and register i wonder

stuck elbow
#

in any case, the communication itself is correct

#

it's just that the sensor returns 0s

#

so probably something with initialization

timber lion
#

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

stuck elbow
#

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

idle owl
#

Ok, so it's the lib overall failing, not the PR specifically?

stuck elbow
#

seems so

timber lion
#

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

stuck elbow
#

yeah, after the meeting I will try it

#

I swear it worked when I wrote it

timber lion
#

i'll back you up, it worked 3 weeks ago πŸ˜ƒ

idle owl
#

@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.

stuck elbow
#

@timber lion thanks!

limber tulip
#

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 πŸ˜ƒ

stuck elbow
#

yay

#

did you use pyinotify?

limber tulip
#

No, the script just checks the modification time every second. Not elegant but fine for a first attempt.

stuck elbow
#

yes, first make it work

idle owl
#

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.

stuck elbow
#

@idle owl did you tried to change the i2c frequency?

idle owl
#

No, I don't know how to do that

stuck elbow
#

sorry, I'm still in a meeting

idle owl
#

That's fine!

stuck elbow
#

when you create the I2C object, you can pass a 'frequency' parameter

idle owl
#

So, here? i2c = busio.I2C(board.SCL, board.SDA)

stuck elbow
#

yes

#

try with 100000

#

(that should be the default, but you never know...)

idle owl
#

Nothing

timber lion
#

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

idle owl
#

I don't know Ardiuno or have anything running it, that's why I haven't tested that

stuck elbow
#

maybe the firmware on the chip expired πŸ˜‰

timber lion
#

oh check out the board's guide, it can show you how to get a basic test running

idle owl
#

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?

timber lion
#

unfortunately no, it's a little different

idle owl
#

Ok

#

Let me try to at least get it loaded into the Arduino software

timber lion
idle owl
#

Same for M0 Express?

timber lion
#

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

idle owl
#

Ok

timber lion
#

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

idle owl
#

Oh ok. Knew the first part, not the second.

#

Right

tidal kiln
#

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

idle owl
#

yah I found it. Doing boards manager right now which was under tools.

#

Thank you

timber lion
#

oh right yeah they put the library manager in an odd spot

tidal kiln
#

yep. after you add the url under preferences. stuff is kind of spread out. 😦

idle owl
#

And apparently takes a while.

stuck elbow
#

/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

timber lion
stuck elbow
#

but that one is not installable from the library manager

timber lion
#

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

stuck elbow
#

got it, thanks

#

it works

#

returns something else than all 0s anyways

timber lion
#

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

stuck elbow
#

let me test different versions

idle owl
#

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.....

stuck elbow
#

I just reflashed the trinket m0 I was using, so I don't have them anymore

#

it worked with arduino

#

not with cp

idle owl
#

Ah ok

#

I'm still trying to get that working

stuck elbow
#

still all 0s on 2.0 with the latest register and bus device

timber lion
#

wow that is odd, i'll grab my bno055 to try

stuck elbow
#

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?

idle owl
#

Anyting 0.01 and higher sleeps a little

#

from testing anyway

stuck elbow
#

has to be at least time.sleep(0.09) for the sensor to work

#

for me at least

idle owl
#

Line 179?

stuck elbow
#

last sleep in init()

#

I would set it to 0.2 just to be on the safe side

idle owl
#

I'm lost. I'm not sure I'm even looking in the right place.

stuck elbow
#
    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

timber lion
#

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

stuck elbow
#

ha, because you do it manually

#

and you wait after creating the sensor and before reading from it

timber lion
#

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

stuck elbow
#

the datasheet says there is delay

#

I remember that when I was writing it

#

I guess circuitpython got faster?

#

around some i2c stuff

timber lion
#

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

idle owl
#
  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```
timber lion
stuck elbow
#

@idle owl check wires

idle owl
#

That's using the current version without changing that time.sleep

#

Ok

timber lion
#

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

idle owl
#

vin to 3v right? Not USB?

timber lion
#

i use 3.3v, but 5v/USB should be ok to

#

too

#

but it requires the board to be plugged in to power up

idle owl
#

I still had the frequency change in there you had me test

#

There it is!!

#

Works with newest versions of bus_device and register

timber lion
#

ah nice, so yeah it looks like there might be a tweak to the mode change to add more delay

idle owl
#

I think I found the issue with the PR too

timber lion
#

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

stuck elbow
#

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

timber lion
#

ah fun, yeah probably buggy firmware on their side πŸ˜ƒ

idle owl
#

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

stuck elbow
#

there is a number of problems with it

idle owl
#

Ok....

stuck elbow
#

the mode switch is removed, the delays are removed

idle owl
#

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.

stuck elbow
#

I will try it

idle owl
#

Okay

#

Should I hold off on the review then?

#

Or post it and tag that you're going to look at it

slender iron
#

@idle owl add your feedback and also add deshipu as a reviewer

idle owl
#

Ok

slender iron
#

thanks for the bug finding!

idle owl
#

Yah, I'm finding more and more it's bugs and not me, which is pretty keen

timber lion
#

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

slender iron
#

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

timber lion
#

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

slender iron
#

yeah, I think thats fine for the future

#

I don't see the need to redo existing changes though

timber lion
#

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?

slender iron
#

nah, just review it with "request changes"

#

its an option under "review changes"

idle owl
#

That's what I did. You can do it to specific lines of code if you want to get detailed.

slender iron
#

yup! thanks!

idle owl
#

@tulip sleet Hey do you want me to close the the do not freeze examples into CPX issue? The associated PR was merged.

tulip sleet
#

@idle owl sure, though I was going to clean up. but go ahead

idle owl
#

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

tulip sleet
#

@slender iron re placeholder version: besides ".plus." did you consider using the git commit id like the CPY version thing in py/makeversionhdr.py

stuck elbow
#

@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

limber tulip
#

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?

stuck elbow
#

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

limber tulip
#

I was wondering about something like: os.system("script2.py 1")

#

from standard python

stuck elbow
#

what are you trying to do exactly? there is probably a better way

timber lion
#

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()

half sedge
timber lion
#

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 πŸ˜ƒ

half sedge
#

It is a bit untested, but I remember listening to many of those... a nightmare.

limber tulip
#

thanks @timber lion

stuck elbow
#

@fallow falcon I think that library didn't exist back then

limber tulip
#

also @stuck elbow

tulip sleet
#

@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)
stuck elbow
#

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

limber tulip
#

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?

tulip sleet
#

@limber tulip I'm trying to track down the original Adafruit project that used something similar. will get back to you

idle owl
#

@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.

timber mango
idle owl
#

@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

timber mango
#

its all good can keep if ya like

half sedge
#

@idle owl about @timber lion megademo... is it going to be released?

timber mango
#

was confused at first "wait i thought i made this guide live"

idle owl
#

If we end up doing a next level coding-with-CP guide, it'll be a good place to start.

#

Oh! sorry!!

timber mango
#

how about ya rename it then?

idle owl
#

Will do

timber mango
#

good!

idle owl
#

Made it Coding with CircuitPython

tulip sleet
#

@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.

idle owl
#

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. Β―_(ツ)_/Β―

timber mango
#

@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?

limber tulip
#

@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

timber mango
#

Self-modifying code?

limber tulip
#

yes,in a way, or writing code on the fly to customize behavior

idle owl
#

@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

stuck elbow
#

one of my favorite Escher illustrations

#

@limber tulip madness lies that way

slender iron
#

@idle owl and @stuck elbow thanks for the review on bno055

stuck elbow
#

@limber tulip python is dynamic enough to let you do most of what you would do with self modifying code without that

idle owl
#

@slender iron np

timber mango
#

@idle owl ill tkae a look at cpx tomrorow, still catching up on stuff for show

stuck elbow
#

for example, you can define functions and classes on the fly

#

without having to write any code into files

idle owl
#

@timber mango Ok np

limber tulip
#

I'll have to look into that, all part of learnin'

tulip sleet
#

@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.

timber mango
#

I would nominate @stuck elbow as Always Helpful dotcom.

idle owl
#

@tulip sleet It seems pretty consistent in a lot of ways after altering the threshold.

stuck elbow
#

@timber mango thanks, but I just like to show off πŸ˜‰

timber mango
#

That's a valid motive!

stuck elbow
#

@timber mango did the boards arrive safely?

tulip sleet
#

@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?

idle owl
#

Yep.

#

I had it at 17 for double_tap

#

Single went off if I even looked at the board at that number.

tulip sleet
#

I got those burst of insensitivity we were talking about where it wouldn't print. But holding it that never happens.

idle owl
#

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

timber lion
#

@Dan @idle owl no i wrote the audio meter myself, it was based on philb's arduino code

tulip sleet
#

I blinked the blinky led in the loop with the print

timber lion
#

that 3d printed project probably used it from the mega demo

idle owl
#

Ah good to know

timber lion
#

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

idle owl
#

Yeah I slimmed fscale down even more.

tulip sleet
#

@timber lion everybody wants it! It's good for a mini learn guide by itself

timber lion
#

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 πŸ˜ƒ

idle owl
#

Exactly

timber lion
#

i agree it would be an awesome guide

#

right now the focus is drivers

limber tulip
#

As a wanter I think that project has a lot of possibilities.

tulip sleet
#

@limber tulip so you can attribute it to @timber lion and @idle owl

limber tulip
#

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

idle owl
#

That is my name πŸ˜ƒ

limber tulip
#

very good!

timber mango
#

@tidal kiln hey how did that onewire bus go?

manic glacierBOT
slender iron
#

@timber mango its checked in a looked really good

timber mango
#

ok ready for it to be added to the DS18b guide then?

slender iron
timber mango
#

huzzah

#

thx!

slender iron
#

@tidal kiln rocked it

manic glacierBOT
idle owl
#

I made an LED blink! I've never actually used a basic LED before. πŸ˜„

timber mango
#

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.

idle owl
#

I have a resistor in there

timber mango
#

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.

idle owl
#

@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.

slender iron
#

yup to you as the reviewer

idle owl
#

ok

slender iron
#

we could always find someone with the joy wing too

idle owl
#

I wanted to get one anyway πŸ˜„ but it'd faster if someone else already has both.

#

I'll comment then but not merge then

slender iron
#

kk, sounds good

timber mango
#

Just tell the UPS guy in New York to test it in the brown truck. πŸ˜‰

slender iron
#

just tagged a new release tools build so newer releases will have their version filled in

idle owl
#

Nice!

slender iron
#

😦 .travis.yml needs overwrite: true under deploy

tulip sleet
#

@slender iron you need adafruit-circuitpython-tools sed tool to make mass edits on the libraries

slender iron
#

yeah, we'll get there

manic glacierBOT
prime flower
#

@idle owl Just read over your welcome guide - it's great!

idle owl
#

@prime flower Thank you!

prime flower
#

It's so good...parts of it may benefit another guide (I'll let you know deets over PM)

tulip sleet
slender iron
#

@tulip sleet starred!

prime flower
#

@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 πŸ˜ƒ

slender iron
#

extension for what?

prime flower
#

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 Β―_(ツ)_/Β―

limber tulip
#

@idle owl your new guide is on my β€œto read” list for tomorrow. Looks sweet!

idle owl
#

@limber tulip That's great! Thanks!

ruby lake
rustic wind
#

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?

cunning crypt
#

@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

rustic wind
#

@cunning crypt Thank you so much, I will give it a try πŸ˜ƒ

cunning crypt
#

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.

tulip sleet
#

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)

cunning crypt
#

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.

umbral dagger
#

@slender iron @idle owl I just ordered a joy wing and plan to do some work in CP with it.

idle owl
#

Actually it turns out my partner had one. It's tested and merged πŸ˜ƒ

#

But now we know it'll work for later!

umbral dagger
#

Cool

timber mango
#

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.

sick creek
#

@timber mango think listen manatees and observe they movement patterns from they Space

stuck elbow
#

@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

manic glacierBOT
stuck elbow
#

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

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...
manic glacierBOT
#

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...

limber tulip
#

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

manic glacierBOT
meager fog
#

@limber tulip cool game, nice work πŸ˜ƒ

#

@idle owl ok i can do some work on 1) the guide 2) the cpx lib today

limber tulip
#

Once the difficulty is added I will post it to the Adabox forum

meager fog
#

awesome, thank you!

limber tulip
#

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.

flint oyster
#

@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.

solar whale
#

@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 that was RE: the forum post

limber tulip
#

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

meager fog
#

@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 πŸ˜ƒ

limber tulip
#

That’d be cool. Thanks for all you do!

meager fog
#

@limber tulip thank you for being part of this community πŸ˜ƒ

tidal kiln
slender iron
#

FYI build tools is broken for library packages at the moment. I'm looking at it now

slender iron
timber mango
#

@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

limber tulip
#

sound very interesting @timber mango

meager fog
#

@umbral dagger heya lookin at your guide! ping me when ur around

limber tulip
umbral dagger
#

@meager fog I’m around

meager fog
#

ok i just made it live!

#

did you want to put this in the contributors bundle?

umbral dagger
#

I’d be honoured.

#

I’ll put in a PR later this afternoon.

meager fog
#

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 πŸ˜ƒ

umbral dagger
#

No worries, git and I are old friends.

slender iron
#

@umbral dagger just ping me if you have any questions

idle owl
#

@meager fog ok!

#

@limber tulip You can post feedback here

upper gull
#

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)].

idle owl
#

Good catch!

#

Fixed πŸ˜ƒ

timber mango
#

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.

idle owl
#

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?

meager fog
#

@idle owl willlllldcard it up!

#

@idle owl basically we should hvae one 'quickstart' that is direct links, and then for anything more, link to the guide

timber mango
#

@meager fog Thank you.

meager fog
#

use 'latest'

idle owl
#

Ok

idle owl
#

Ah ok

meager fog
#

πŸ˜ƒ

idle owl
#

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!!

meager fog
#

yah, it requires a little finesse, but will help avoid constant tweaks

idle owl
#

Exactly, that's why I didn't like what I was trying to do

meager fog
#

@limber tulip got it, will send to the blogteam πŸ˜ƒ

manic glacierBOT
idle owl
#

@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)

meager fog
#

i dont have one 😦 if you wanna try taking it

idle owl
#

I have a pretty solid setup here. I should be able to do it.

stuck elbow
#

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

opaque patrol
#

@stuck elbow You could make the tongue a red status led that flashes πŸ˜ƒ

stuck elbow
#

You didn't see the front side

flint oyster
#

those look cool

stuck elbow
#

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

idle owl
#

@stuck elbow That's great! I am still waiting on getting mine, but I have all the parts to put it together.

stuck elbow
#

I have to upload the version with fixed gnd

idle owl
#

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.

stuck elbow
#

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

idle owl
#

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 πŸ˜„

stuck elbow
#

well, I'm waiting on the vector logo

idle owl
#

Oh

#

I have it

stuck elbow
#

gimme 😍

idle owl
#

On it

stuck elbow
#

so I can't promise how long it will take, but probably I will work on it over the holidays

idle owl
#

That's totally fair πŸ˜ƒ

stuck elbow
#

I will probably also enter it in the Hackaday's Coin Cell Battery Contest

idle owl
#

Oh so a lot bigger

slender iron
#

@stuck elbow didn't I posted the ai files to discord last time you asked?

idle owl
#

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

stuck elbow
#

@slender iron I thought you would put them in the repository under "logos"

#

@slender iron if you posted them, I didn't see, sorry

cosmic fractal
#

Lol again

stuck elbow
#

@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

idle owl
#

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
#

I wonder, is there a circuitpython jingle?

#

like some simple melody?

slender iron
#

@stuck elbow yeah I need to put them there

stuck elbow
#

@idle owl that would require me taking my hands off the home row

idle owl
#

Unless you just want to tag the most recent person in which case it's @ + tab

#

No moving from home.

stuck elbow
#

I usually type @tan TAB

#

and for instance just now it suggested @crystal raft for that

#

gotta love computers πŸ˜ƒ

idle owl
#

So much!

timber mango
#

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.

idle owl
#

Oi.

timber mango
#

πŸ€” They've added possibly useful prefixing with the : key on newline such as πŸ€” (can go anywhere in the line, apparently).

limber tulip
#

@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.

idle owl
#

@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
#

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

idle owl
#

Oh nice. Ok

meager fog
#

demo

#

also emo, very sad

idle owl
#

So sad! Poor mac os can't make hidden files

meager fog
#

mm

idle owl
#

Picture turned out pretty good!

#

I think anyway πŸ˜„

meager fog
#

yah! nice

idle owl
#

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.

hot moon
#

@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.

idle owl
#

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.

hot moon
#

I think I've come into the middle of something. I'm reading back now trying to get the flick.

idle owl
#

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 πŸ˜„

timber mango
#

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.

idle owl
#

@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.

manic glacierBOT
idle owl
#

@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.

slender iron
#

not sure what you are asking

idle owl
#

and told me to tell people, in the Trinket guide, to install it

slender iron
#

ah ok

idle owl
#

I'm a little confused

slender iron
#

yeah, drag should work

idle owl
#

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

slender iron
#

yup, thats to get back to the default state as we ship them

idle owl
#

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)

slender iron
#

np

tulip sleet
#

@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

limber tulip
#

Thanks @tulip sleet I’ll give it a try when rc.2 is out

tulip sleet
limber tulip
#

Cool, I’ll give it a go tomorrow

upper gull
#

@tulip sleet Thanks! Very cool.

idle owl
#

@tulip sleet Nice!

tulip sleet
#

@idle owl didya try it? it's a lot less erratic now.

idle owl
#

@tulip sleet Getting the files now

tulip sleet
#

I gussied up the pixel colors a bit, but if it's ugly tell me: my color vision is non-standard.

idle owl
#

πŸ˜„ 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!

tulip sleet
#

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.

idle owl
#

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

tulip sleet
#

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

idle owl
#

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 πŸ˜„

tulip sleet
#

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.

idle owl
#

It's brilliant!

tulip sleet
#

we still have a lot of kids' toys and stuff; not sure what I'll come up with next time

idle owl
#

Well I look forward to it! You always seem to come up with entertaining props.

idle owl
cunning crypt
#

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

idle owl
#

Valid.

cunning crypt
#

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.

raven canopy
#

@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. πŸ¦‡ πŸ˜„

cunning crypt
#

@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.

raven canopy
#

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

cunning crypt
#

I'd love to give you some pointers on it, but it seems you have enough of them.

raven canopy
#

man, i tee'd that one up, and didn't even realize it. good form!

idle owl
#

Trying to make a TFT breakout work. Code runs, display has power. Nothing is displaying.

cunning crypt
#

@idle owl What type of TFT?

idle owl
#

st7735r, the 1.44"

cunning crypt
#

Oh, yeah, I had some issues with that one.

idle owl
#

Oh.

#

Did you sort them?

cunning crypt
#

Primarily: There's two separate initializers, one for ST7735, one for ST7735R

idle owl
#

oh....

cunning crypt
#

One worked. The other did exactly as you described.

idle owl
#

bugger. Do you know what the one for the R is?

#

Because this is apparently not right then.

#

Wait like totally different drivers?

cunning crypt
#

Wait, I was using the slightly larger one, the 1.77" one.

#

Nope, same driver

idle owl
#

Or just a different way to initialise them

#

ok

cunning crypt
#

Different code. One sec, let me dig it up

idle owl
#

I assume the size difference won't matter, it's definitely the R though.

cunning crypt
#

OK, so, in the adafruit rgb display library