#circuitpython-dev

1 messages ยท Page 132 of 1

idle owl
#

lol I love it

meager fog
#

i think for libs yah, lets put the troubleshoting parts in troubleshooting, i did solve a bunch of it by putting those special files on the trinket/gemma when they ship

idle owl
#

and then the rest about libs, should that have a separate page? Or go in the advanced users page? and if separate, where should we put it. I wanted to keep it out of the main workflow of the overall guide because you can't simply load the entire thing onto Trinket and Gemma so we'd be getting into board-specific instructions which I basically avoided through the entire thing.

#

hah had four thoughts while trying to type this out, and then came to: I think it needs to be right before what's next because what's next sends them to the board-specific guides. some of which have examples needing libraries.

slender iron
#

on creating and editing you may want to say any plain text editor will be fine to rule out word

idle owl
#

oh yeah on it.

#

plain-text hyphenated?

meager fog
#

i think libraries can actually go after the 'boards overview' page

idle owl
#

ok keen

meager fog
#

one library that will work on all devices is simpleio

#

so you can use that to 're-write' blinky

#

but lets you demonstrate "hey you got an import error, lets fix it"

idle owl
#

I'm not even sure I know how to rewrite blinky with simpleio

meager fog
#

you basically dont have to set the Direction

#

you create an Output type pin in one go

idle owl
#

ah

meager fog
#

๐Ÿ˜ƒ

idle owl
#

So at that point, though, are we just dragging simpleio over in the guide? Or explaining that it's different for trinket and gemma

#

and having them drag the entire lib folder for the boards where it will fit, and specify the little ones

meager fog
#

i think you can start by showing just adding that library

idle owl
#

ok

meager fog
#

so it works on eveything

idle owl
#

keen

meager fog
#

and THEN say "OK if you have an Express board" just grab the whole thing

#

but make the "lib" folder either way

slender iron
#

"it won't actually eject" leads my to picturing usb keys being spit out of a computer

meager fog
#

lol

idle owl
#

weirdest weapon ever

slender iron
#

newer zip files will also have lib folders in them even when they are for a single library

idle owl
#

good to know.

meager fog
#

kat, maybe also rename 'whats next?' to be called 'CircuitPython Boards' or similar?

idle owl
#

I'm thinking still use the bundle for the libs example

meager fog
#

๐Ÿค”

idle owl
#

what's next made sense when it was the last page

slender iron
#

I changed a couple things to suggest the drive is corrupted instead of the board

idle owl
#

that sounds good

meager fog
#

kat, ya! either way point them to the whole bundle, using the wildcard URL

idle owl
#

CircuitPython Hardware for that page name?

meager fog
#

sounds good to me ๐Ÿ˜„

idle owl
#

I use boards through the whole thing though

#

I think boards might make more sense

#

dunno

meager fog
#

i think either is OK!

#

go with your gut

slender iron
#

is it ok if I tweak some wording?

idle owl
#

Ok so: add cp libs, for advanced user pages. rename what's next. add the rest of the libs page to troubleshooting.

#

@slender iron yeah for sure

slender iron
#

I want to clarify that time.sleep doesn't know anything about the led

idle owl
#

limor already made changes, this kind of group work is great

#

oh I thought I worded it like that... yeah definitely clarify that

#

oh wait I had it like that and then kept trying to simplify it. I remember now

#

but yes definitely clarify that one.

#

@meager fog did you specifically see something I missed from the serial repl page that's already there, or did were you just having me make sure I covered it all

meager fog
#

i dont think you missed anything but i also didnt do a thorough check ๐Ÿ˜„

#

maybe just skim thru, see if we missed anything (i dont think we did?)

idle owl
#

ok, np, I just wanted to make sure

#

yeah for sure. I'll do that once I have the rest of it finished up

slender iron
#

@idle owl I rephrased it as time.sleep() tells CircuitPython to pause running code

idle owl
#

nice

slender iron
#

@idle owl I really like the NameError example. perhaps reiterate you can google for other errors because its just like python?

idle owl
#

I added another screenshot to the REPL page, and a sentence about potentially needing to press ctrl+c multiple times but that sentence was the only thing missing from the current page.

#

@slender iron sounds good

slender iron
#

@idle owl it looks really really good

manic glacierBOT
idle owl
#

@slender iron thank you so much!

slender iron
#

we should add featured products too ๐Ÿ˜ƒ

idle owl
#

I was going to ask about that

slender iron
#

I'd just add the five mentioned in it

idle owl
#

that was what I was thinking too

lofty topaz
#

And all this wonderful development without a single whiteboard. Amazing.
Sorry! just kibitzing again. Love the conversation. Brings back memories.

tidal kiln
#

maybe put CPX at the top? adabot

manic glacierBOT
idle owl
#

@tidal kiln think so? I was going to put them as trinket-gemma-cpx-feather-metro as it seemed like the most likely order you'd get them, but the featured ones are meant for you to get them, not that you already have them. Yeah I think CPX should go first.

tidal kiln
#

is this for right hand side? or on a guide page?

idle owl
#

right hand side list thing

tidal kiln
#

anything's fine, only suggesting CPX as lots of people getting them soon-ish to now-ish

idle owl
#

true, I think it's the best getting started board, so I like it being first on this guide. The guide itself is board-agnostic.

tidal kiln
#

yep, that too - best starter board

tulip sleet
#

@idle owl more text editor info: sublime and vi do fsync, so they are "safe" editors. nano does not do fsync.

idle owl
#

@tulip sleet good to know. Sublime still scares me ๐Ÿ˜„

#

I only recently moved from Atom to PyCharm.

tulip sleet
#

dunno about Pycharm, but i can test that too if you want

idle owl
#

That would be amazing. It's a more complicated editor, not great for beginners I don't think, but it's not nearly as intimidating as Sublime. The community edition of it is free.

tulip sleet
#

i never got started on sublime because it cost money, and it's TOO DARK in there. I like light themes ('course I could change that)

idle owl
#

@timber lion Do you have time to answer a few questions about tap detection in lis3dh?

slender iron
#

I tried sublime but atom has borrowed heavily from it so it felt very similar

idle owl
#

PyCharm has a learning curve when working with CircuitPython because of the workflow. I still run into issues sometimes. But I'm slowly figuring out how I have to use it to make it work with mutliple boards plugged in and so on. For a while it was incredibly frustrating, but I worked hard to give it a chance.

tidal kiln
#

@slender iron just PR'd ds18x20 and onewire, did a few significant last minute tweaks:

  • allow specifying start, end for readinto and write (faux slicing)
  • above let me get rid of single byte buffer
  • added resolution setting/reading for ds18x20
  • had to refactor the "wait for convert" stuff into convert_temp, it wasn't working like it was
slender iron
#

thanks @tidal kiln will look later

tidal kiln
#

@slender iron also, ads1x15 made it in latest auto bundle, so that's fixed. ๐Ÿ‘

slender iron
#

@meager fog got me into a wear leveling rabbit hole I want to explore for a little bit

tidal kiln
#

np. whenevs.

timber lion
#

oh hey @idle owl yeah totally i'm around

idle owl
#

@timber lion Great! at the moment I'm trying to write a simple program that detects taps - trying to understand it and sort if so I can add it to the cpx API. I have notes from ages ago where I figured out the binary for each axis +/- (so -x, +x etc separately). the code right now is super kludgey with the stuff from my notes and some things from your fidget spinner code. If I just do read_click and set_click it responds to shake, movement, tapping, everything, even with a higher threshold. So I'm thnking the magic lies in the FIFO buffer and streaming stuff you have in the spinner code, but I don't get how to adapt it for all axes. I'm not great with data-sheets although this is the one I've read most (that doesn't mean much), and I only have an academic understanding of interrupts.

#

So.... long story short, I'm trying to figure out tap detection, allow for specifying double/single click, using one axis, or any combination thereof.

#

And I need some help understanding what's going on in the code or the driver... and I'm not really sure what questions to even be asking. So apologies if this sounds like I'm asking the vaguest thing ever here

timber lion
#

oh gotcha, actually it might easier to start from a simpler example

idle owl
#

I agree completely

timber lion
#

so it's using a feature built in to the LIS3DH for click/tap detection

#

which is kinda cool to read about in their app note

#

don't have to fully grok all the details, good to just skim

#

and then if you want you can see exactly what registers are used for click detection in the datasheet

#

those are pretty technical and dry, it's just a raw reference of the registers

#

but super handy when you see weird hex values and wonder what they mean

#

the app note is good to get the big picture and how ST wants you to use the deivce

#

then the DS helps show the actual bits to set

#

but start with just the simple example from the library above too

idle owl
#

Ok

timber lion
#

what it's doing is turning on click detection for all 3 axes, then specifying either single or double click detection.. both those changes are just setting special values in the CLICK_CFG and CLICK_SRC registers

#

then to see if a click occured the chip will set a special bit in a register

idle owl
#

Ok I have it running, but it's doing the same thing as I was running into before trying to adapt the more complicated code

#

if I even move the board, it registers a click or two

timber lion
#

so the library checks that bit in the functions and if it's set it can return a true/false for click or no click detected (and even type of click, single or double)

#

ah yeah so click detection doesn't really know the difference between a sharp movement and a tap

#

it's all the same to it, from the app note it talks about how it looks for a sharp increase in acceleration and if it falls back down in a certain window of time

#

so you can tweak the thesholds a bit and increase how sharp of an impulse or spike it needs to see

#

and even the window of time for it to fall back down a bit

idle owl
#

ohhhhh

#

is that the latency stuff?

#

time latency parameter

timber lion
#

but those are basically the only two knobs it gives you to change

#

yep

idle owl
#

ok!

timber lion
#

so yeah it might hard to have it not detect sharply moving the board vs. a click

idle owl
#

ok

timber lion
#

but you might be able to play around with the time window and threshold parameters

idle owl
#

I thought I was missing something and that's why it wasn't working right

#

So there's no point in trying to include the write_byte_register stuff from your spinner code?

timber lion
#

ah that stuff is just a little wrapper to make setting register values easier

#

it's already in the lis3dh lib though, let's see what i called it

idle owl
#

because as it is it calls a protected class member, so I wasn't sure if there was a better way to do it. or whether it was even needed for tap detection.

timber lion
idle owl
#

ok yeah

timber lion
#

ohh gotcha, yeah so that's in the example it wanted to change the click and other registers to specific values

#

the library didn't expose public functions for it since it's kind of complicated and lesser used stuff

#

but since i knew how the library worked i just reached in and called the 'private' function rather than doing all the I2C calls etc myself

#

it's not ideal to do it that way but a lot simpler than adding extra stuff to the lib right now

#

but yeah ultimately that stuff is just adjust the click detection to only look at one axis

#

vs. for more general click/tap you probably want to look at all 3

#

the spinner only wanted to tell when you hit a specific side of the board

idle owl
#

I was thinking of including individual axes, maybe that's a bit much for the API?

timber lion
#

but for a person tapping the board/chip it might come from any direction

idle owl
#

right

timber lion
#

yeah i'd say keep it simple to start.. go for all 3

idle owl
#

default to all, but allow choosing one was what I was thinking

#

ok

timber lion
#

if you see people asking or good use cases come up for just one or two axes then might make sense to add later

idle owl
#

that does make things simpler to start

#

good call

timber lion
#

yep totally.. one big thing i come back to a lot.. YAGNI

#

You Ain't Gonna Need It

#

๐Ÿ˜ƒ

#

nice philosophy from the agile world

idle owl
#

๐Ÿ˜ƒ

timber lion
#

it's easy to jump in and want to add every feature.. but ultimately it's just extra code and complexity that has a cost to write and maintain

#

so start simple and add is a good way to approach stuff

idle owl
#

and memory usage.

#

yeah that's how I came to a lot of it. Added things later.

#

ok, thank you! I might ping you again but I'm getting it much more than I was. much better place to start

timber lion
#

yep no problem!

lofty topaz
#

Guard Against Feature Creep
If it can, it will.
KISS, Keep It Simple Sir.
Software philosophies one should always abide by. Good work people.
...just kibitzing... ><>

timber lion
#

yeah when i was younger and more inexperienced i took great pleasure in writing a lot of code.. the more the better

#

now i take pleasure in writing the least amount ๐Ÿ˜ƒ

#

i treat it like a dangerous substance

lofty topaz
#

ain't it the truth. We have reuse for a reason. Right?

#

Gotta love inheritence.

#

Computers are funny people.
They rarely will do exactly what you want them to do yet they always do exactly what you tell them to do. ๐Ÿ˜‰

tulip sleet
#

@idle owl PyCharm syncs after write if "safe write" is turned on in Settings->System Settings->Synchronization. Tested on Windows briefly. Seems to do the right thing.

#

"Safe Write" is on by default (out of the box).

idle owl
#

@tulip sleet Oh nice! Thank you!

#

Hmm so double click detects single as well.

#

Is this even doing anything in CP? time.sleep(0.05)

#

I'm on 2.x

#

I seem to remember there being something about super tiny time.sleep values

tidal kiln
#

anything above 0.001 seems to do at least some amount of sleeping

idle owl
#

ok thank you

tidal kiln
idle owl
#

ah ok

#

nice testing ๐Ÿ˜ƒ

tidal kiln
#

@slender iron the onewire PR is failing travis. looks like it's related to pylint? i tried some stuff, but none of it worked. i'd like to know / learn what's up there. (when you get to it)

idle owl
#

@tidal kiln I might be able to help.

idle owl
#

Ok here are your errors: ```W:136,12: Unused variable 'i' (unused-variable)

W:200,16: Unused variable 'bit' (unused-variable)

R:190, 4: Method could be a function (no-self-use)```

#

The last one I needed to use a @classmethod decorator to make it happy. The other two might need to be disabled, depends on where they are in the code.

#

Link me to the code please

tidal kiln
#

yah, i linted locally and saw those. i don't think they're worthfixing.

idle owl
#

ok, then you'll have to do the # pylint: disable=error-name thing at those points in your code

#

Fairly certain it's the bit in parens that is the error name

#

so # pylint: disable=unused-variable etc

tidal kiln
#

is travis setup to require a 100% pass from pylint?

idle owl
#

Yes

tidal kiln
#

oof

#

so we have to kluge it

idle owl
#

You did pretty good!

#

Well it's not kludging it

#

it's showing that we chose to not follow the linter so there's consistency across the board

#

It's not bad form to disable pylint, it's simply a form

#

At least that's how I see it

tidal kiln
#

that makes sense. i was thinking it'd be nice to dumb it down at the travis level.

idle owl
#

Means we'll have inconsistencies later though with new people coming in. We all know how we're doing things, but we won't be it for long.

tidal kiln
#

but having the flag in code does what you said "yah, we know pylint doesn't like this, but....meh"

idle owl
#

yep exactly

#

or we know pylint doesn't like this but it works better for what we're doing, etc.

#

The errors go at the point in the code where the error occurred like so: python @property def touch_A1(self): # pylint: disable=invalid-name

#

Similar for disabling entire sections but I don't think you need to do that yet

#

If you need to know how to do that, look into any of the merged PRs that have register settings in them. pylint doesn't like the extra whitespace needed to have them lined up readable.

#

So those are all disabled.

tidal kiln
#

well...let me try it....

idle owl
#

running pylint locally is what travis is doing, so if you pass locally, you should pass travis.

tidal kiln
#

can you just use the label in paren of error message for the disable?

W:136,12: Unused variable 'i' (unused-variable)

so then...

# pylint: disable=unused-variable
idle owl
#

I think so

#

I did it based on error number and Dan corrected me. So I think you just get the name from the error in pylint yes

idle owl
#

Of course!

#

Nice job!

tidal kiln
#

i ended up just using pylint: disable=no-self-use for that one instead of a decorator

idle owl
#

Ah nice. I really wanted to know why it was failing, so I looked into how to fix it, that's why I changed mine. Didn't end up needing it anyway. Changed how the method worked in the end.

tidal kiln
#

yah, i might look into it a little more. one of these detail things. i actually tried refactoring things so it actually did get called, but it still complained. so dunno. went back to original and added the flag.

idle owl
#

yeah

manic glacierBOT
fading solstice
#

@tidal kiln @idle owl i ran into "unused-variable" in a loop like yours. The code fix is replace "i" with "_".

idle owl
#

Interesting. Thanks!

fading solstice
#
for i in range(0xff): # pylint: disable=unused-variable
            rom, diff = self._search_rom(rom, diff)
            if rom:
                devices += [OneWireAddress(rom)]
            if diff == 0:
break
#
for _ in range(0xff): 
            rom, diff = self._search_rom(rom, diff)
            if rom:
                devices += [OneWireAddress(rom)]
            if diff == 0:
break
idle owl
#

Odd.

fading solstice
#

it a python thing, not sure it is better

idle owl
#

that's where the decision part of the linting process comes in

#

still good to know

tidal kiln
#

thanks. interesting.

#

it's also possible that the entire looping could be done more pythonic

#

it's inherited code with a c legacy

lofty topaz
#

The name that is just a single underscore (_) retains the result of the last expression when you are working interactively.

Lutz, Mark. Learning Python (p. 355). O'Reilly Media. Kindle Edition.

#

pyLint is just complaining that i isn't used.

tidal kiln
#

neat. doesn't look like that's in CP though:
python3:

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.time()
1513203583.4167595
>>> _
1513203583.4167595

CP:

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> import time
>>> time.monotonic()
84728.1
>>> _
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '_' is not defined
>>>  
lofty topaz
#

It appears the underscore works iteratively as well from the code use.

#

Ahhh, good catch. It should be.

fading solstice
#

question about SimpleIO. There is a function called bitWrite() which is pylint says is invalid. do you know if there is any adafruit documentation that references bitWrite in SimpleIO?

idle owl
#

We were just going through simpleio for something else. No idea on that though.

fading solstice
#

am i working on something that is being worked on?

#

sorry

idle owl
#

oh no no

fading solstice
#

ok

idle owl
#

I meant literally looking through it for a way to use something in it.

fading solstice
#

this is what the comment says

#
Based on the Arduino bitWrite function, changes a specific bit of a value to 0 or 1.
    The return value is the original value with the changed bit.
    This function is written for use with 8-bit shift registers
idle owl
#

Hmm

fading solstice
#

SimpleIO was supposed to make it "easy" to switch from Arduino to CircuitPython

#

i want to renam it to bit_write()

idle owl
#

But need to know what that will break

fading solstice
#

i can leave it.

slender iron
#

@fading solstice I'd be tempted to disable the variable namign check for simpleio because it matches arduino

fading solstice
#

ok, that is what i need to know thanks

slender iron
#

@tidal kiln @lofty topaz thats a great catch. it'd be good to file an issue

tidal kiln
#

@slender iron is it an issue? i thought it was just something not in micro / circuitpython

slender iron
#

ideally we'd work like CPython. it won't be urgent

tidal kiln
#

@lofty topaz want to file it?

tulip sleet
#

it's implemented in MicroPython, so I bet we just have to turn it on

#

i just tried it on a pyboard

#

enable MICROPY_CAN_OVERRIDE_BUILTINS: that does other stuff too; not sure why it's coupled to that

timber mango
#

Cannot find a rendered schematic for Circuit Playground Express 3333 on the website.

I already have my own in Eagle (which I suddenly remembered I'd created for my own use).

BIG NUDGE

tulip sleet
#

@timber mango you could post something in the forums to remind us. There's a draft page in the Learn Guide but it's not populated yet.

#

or never mind: I'll pass it on

timber mango
#

Appreciate it. It's been quite a few weeks now. Last time I asked, I believe I was directed to Eagle CAD (which was a good experience).

#

@idle owl just jumping into an old thread - even tho there are multiple tap axes, the CPX is too small/light to reliably tell which axis it is.

idle owl
#

@timber mango I was able to get it to pretty reliably with some really specific code. Usually the mistakes it made were thinking it was the opposite end of the same axis, like it was bouncing back in my hand. But I've got it down to tweaking it to be reliable with any clicks. Left out axis detection for now for the API.

stuck elbow
#

@fading solstice by the way, it's better to use .append() than to create a 1-element list and add it to an existing list

fading solstice
#

why didn't pylint find that one?

tidal kiln
#

@stuck elbow talking about that onewire code?

stuck elbow
#

yes

#

@fading solstice well, the pylint doesn't know what you mean

slender iron
#

I'm doing the review for that now too

stuck elbow
#

it just matches patterns

#

I think you can add a check for this particular pattern, if you want

fading solstice
#

i like your suggestion, but cater is the one that needs to know

tidal kiln
#

i did that. well i reused that. good point though. easy enough to change.

stuck elbow
#

I know that operators often look better than methods

tidal kiln
#

sometimes hard to think python and not c

stuck elbow
#

but there is a funny effect of learning python -- your C becomes more readable too!

slender iron
#

@stuck elbow did you comment on the PR about append?

stuck elbow
#

I didn't see the PR, only the code pasted in here

stuck elbow
#

I guess I should start reviewing the pull requests regularly

slender iron
#

that'd be awesome!

tidal kiln
#

should i have added reviewers or something to the PR?

slender iron
#

you can

#

you pinged me about them so I'm looking

idle owl
#

@tidal kiln I got a notification about your PR, so it's at least sending those

stuck elbow
#

@tidal kiln sorry, got a bit carried away with review

slender iron
#

@stuck elbow your comments seemed good to me

stuck elbow
#

yeah, but most of them are style, so should go into the second pass

slender iron
#

@idle owl you should rarely use @classmethod. @staticmethod is more likely because it doesn't need a reference to the class either then

stuck elbow
#

and often it's fine to just define a function

idle owl
#

@slender iron That particular one didn't work as a staticmethod

#

I tried that first because I knew about it

stuck elbow
#

@staticmethod is really only useful when you need to override it in some child classes

slender iron
#

what would you do for crc8 @stuck elbow ?

tidal kiln
#

@stuck elbow np. good comments. esp. about kwargs, first time i've coded for them.

lofty topaz
#

@tidal kiln Just got back from dinner and saw the posts about the uderscore and filing it. You should do it if you haven't already. Sorry for the delay.

stuck elbow
#

@slender iron a normal function, maybe name it with _ in front so it doesn't show up in tab completion

slender iron
#

even with self ignored?

stuck elbow
#

well, a function, outside the class

#

global

slender iron
#

ah that'd work too

tidal kiln
#

@stuck elbow @slender iron thanks for review. i have homework now.

slender iron
#

๐Ÿ˜ƒ great work!

tidal kiln
#

@tulip sleet looks like you were looking into that _ thing...do you think it's still worth an issue?

tulip sleet
#

@tidal kiln it's worth putting an issue in just as a reminder. you can make it real brief and just mention that MICROPY_ flag as the way to turn it on. Thanks!

manic glacierBOT
covert birch
#

hi y'all - i'm having a problem with my feather - i can access it in bootloader mode, but when it goes back to circuitpy, i lose access to the keyboard/mouse on my laptop it's plugged into. what am i doing wrong?

idle owl
#

I don't think you're doing anything wrong. There's a few things to try. You can try a different USB port or reboot your computer. The other possibility is that the drive on the Feather is corrupted. If you follow the steps found on the Troubleshooting page in the board guide, you can erase the board and start fresh. Let me grab the link.

covert birch
#

ah, thx @idle owl

idle owl
#

Make sure you backup your code first, the erase will remove it.

covert birch
#

there's nothing on it yet - just got it from adafruit last week

tulip sleet
#

@covert birch it's because CIRCUITPY is emulating a keyboard and mouse (though you're not using that feature).You probably have the internal keyboard and touchpad suprressed when an external one is plugged in. Try turning off that suppression.

idle owl
#

That's a better option to try first

covert birch
#

hmm, ok. i only have a wireless mouse that connects via usb module

idle owl
#

Hmm.

tulip sleet
#

what OS?

covert birch
#

mac 10.11.6

idle owl
#

And you lose the built in keyboard?

covert birch
#

yes, both

slender iron
#

@pastel panther you are on el capitan as well right?

covert birch
#

btw, you might want to know this is my first foray into circuitpython

idle owl
#

That's one I haven't seen before.

#

That's good to know too ๐Ÿ˜ƒ

covert birch
#

i was kinda following along with tony d's video

tulip sleet
#

@covert birch did you enable any assistive features?

covert birch
#

no

idle owl
#

I'm wondering if there's a setting somewhere that disables the internal kb when you attach an external one, and it's seeing the Feather as an external keyboard input.

#

Like disabling the touchpad.

covert birch
#

at least i don't think - the mouse is programmable tho

#

that's what i was thinking

tulip sleet
#

I know of such a thing for trackpads: it's a setting on the trackpad driver options (have seen this on Windows). I googled this but I don't see an obvious setting.

covert birch
#

but why is it seeing it as such if the case

idle owl
#

It can emulate one, so it might be reading extra features of it once the CIRCUITPY drive mounts. I'm guessing here though.

covert birch
#

plausible

#

i'll try y'alls' suggestions after aae

idle owl
#

Check both the keyboard/mouse settings, and try to dig into the assistive settings, because some of them are on by default or get turned on (somehow, I don't know, I've run into that) and mess with things you don't notice until something like this happens.

covert birch
#

that i can try now

idle owl
#

I've had to dig deep before to find the offending setting.

slender iron
#

I haven't had an issue on newer mac osx

idle owl
#

Neither have I but I'm guessing there's a rogue setting somewhere.

slender iron
#

@covert birch did you install any drivers for your external keyboard and mouse?

tulip sleet
covert birch
#

it's just this logitech trackball/mouse and yes, it has it's own config software that appears in the settings

#

i'm looking at it now

#

let me disconnect mouse and try it

slender iron
#

one other person had trouble with the drive because they had a third party driver

idle owl
#

yeah a weird one they didn't even know was installed.

covert birch
#

ok, so there was a setting in assistive i've unclicked, and plugged in the feather, but now the feather isn't showing up at on desktop at all

tulip sleet
#

it could still be in a Finder window. Usually doesn't show up on desktop

#

look in left sidebar in a Finder window

covert birch
#

i looked in finder window

#

not showing up

idle owl
#

Does it show up as the bootloader? Or neither

covert birch
#

no

#

it's not showing in serial list either

tulip sleet
#

did you switch to a different cable. make sure it's plugged in all the way at both ends

covert birch
#

always a good idea - i'll do now

#

oh, btw - it's getting power

tulip sleet
#

what did you change in assistive settings?

idle owl
#

There are cables that only send power and not data, but you had a FEATHERBOOT drive before, right? So that probably isn't the issue with the cable.

covert birch
#

aha new stuff with diff cable...

#

right

#

in boot mode now i think

#

pulsing green

idle owl
#

Pulsing green usually means it's in CircuitPython mode and is happy.

split ocean
#

do we have IR receiver support on CPy working?

covert birch
#

ok, think i got it now. thanks y'all. gonna watch aae, but i'll be back with more questions i'm sure later

idle owl
#

@split ocean Sort of? What are you looking for

covert birch
#

@tulip sleet it was a checkbox that said ignore built-in trackpad when mouse or wireless trackpad is present. must've been set by logitech's software

slender iron
#

@coral burrow I'd love to see you make a circuitpython video too!

manic glacierBOT
raven canopy
#

@slender iron while vagrant is doing its thing, I was thinking about tossing the link to the MP-samd21 Build Firmware guide into RTD/GitHub. I understand that having a bunch of people building their own firmware might not be desired, as that may raise "I borked my board" questions. But, when it comes to contributing to the core stuff, it would be nice to have that EXCELLENT guide to get up and running. Thoughts?

slender iron
#

do it @raven canopy !

#

make it happen

raven canopy
#

Alrighty. now to pick the best spot... ๐Ÿ˜„

lofty topaz
#

@slender iron His wish is your command. Now that's the way to manage a project.

raven canopy
#

lol. empowerment is a powerful tool.

slender iron
#

๐Ÿ˜ƒ

lofty topaz
#

Great Wednesday Scott. From 3D Hangouts webcast to S&T and AAE, this is my favorite day of the week.

slender iron
#

yup totally!

idle owl
#

@slender iron Moved all of the non-express board running out of space stuff into the Troubleshooting page. It's in two places for now but I'm going to let Limor do the deleting when she's ready. Waiting to hear from her on a couple of questions, but otherwise I think I covered everything else she wanted covered.

raven canopy
#

this rst stuff sure puts up a fight! haha.

#

while I'm in the docs, anything anyone wants edited before I PR?

idle owl
#

@slender iron Are interrupt handlers (ISRs, callback functions) included in CircuitPython?

raven canopy
#

I decided to knock out issue #243 (Improve explanation of safety of microcontroller.delay_us()) before I PR.
Does time.sleep() act the same way? want to give an alternative for the docs. only other thought is the arduino way, using millis()...

idle owl
#

I think you're looking for time.monotonic()

lofty topaz
#

@idle owl Are you talking about this sort of ISR implementation?

from pyb import Pin, ExtInt

callback = lambda e: print("intr")
ext = ExtInt(Pin('Y1'), ExtInt.IRQ_RISING, Pin.PULL_NONE, callback)

raven canopy
#

ok. so it would be...

stopTime = time.monotonic()
while (True):
    currTime = time.monotonic()    
    if currTime - stopTime >= 1000:     #stop @ 1 second
        break
    end
end
``` (its been a while since I Python'd; my syntax may be off)
lofty topaz
#

no need for end
remove () around True
otherwise....

raven canopy
#

although, I wouldn't put all that in the doc. i would just reference the use of monotonic.

lofty topaz
#

how are you updating currTime?

#

nevermind

raven canopy
#

in arduino, you...hehe. ok. ๐Ÿ˜„

lofty topaz
#

gotta turn my glasses on. ๐Ÿ˜ƒ

raven canopy
#

proof test...
old:

Dedicated delay method used for very short delays. **Do not** do long delays
because it will stall any concurrent code.

new:

Dedicated delay method used for very short delays. **Do not** do long delays
because this stops all other code from completing. Think of this as an empty
`while` loop that runs for the specified `(delay)` time. If you have other
bits of code that require specific timing or processing while you are waiting,
explore a different avenue, such as using `time.monotonic()` to evaluate time
in a loop.
#

hmm. actually, it stops more than just code from running. to the datasheet, boywonder! :batman emoji:

manic glacierBOT
slender iron
#

@raven canopy looking at your PR now

manic glacierBOT
slender iron
#

@raven canopy you around? did you get sphinx warnings about the delay doc?

raven canopy
#

@slender iron caught me just before shutting the rig down. no, didn't get any (but didn't necessarily check it either ๐Ÿ˜„ )

slender iron
#

k, I think some of the stuff in single ` will cause warnings as it tries to find a place to link to

raven canopy
#

oh yeah. it's double ticks. i'll hook 'em up real quick.

slender iron
#

๐Ÿ˜ƒ

raven canopy
#

hmm. single ticks are used throughout that one. want me to update all of them?

slender iron
#

let me look

#

single ticks are ideal when it can find the reference

#

so time.sleep should be single but while and delay should be double

#

I think the rest are probably ok

raven canopy
#

ok. so the time.sleep would be good with single, but the while and standalone delay will cause an issue. understanding....

slender iron
#

yup, I think so

#

sphinx should warn about ones it can't find (it matches from the method and module names). its not smart about function arguments though

raven canopy
#

would it warn me on commit or PR? or would I need to go somewhere to explicitly check? (only travis checks were running on the PR)

slender iron
#

running sphinx locally or read the docs after it was submitted

raven canopy
#

alrighty. i'm out. told myself I'd stop staying up this late... there's always next year. ๐Ÿ˜ด

slender iron
#

thanks @raven canopy !

manic glacierBOT
cunning notch
opaque patrol
#

If you open the repl it should tell you the version number

cunning notch
#

@opaque patrol Thanks!

opaque patrol
#

@cunning notch No problem, if you need anything else, just ask ๐Ÿ˜ƒ

cunning notch
#

Just now getting around to CircuitPython/MicroPython stuff. I've been on RPI for a long time. ๐Ÿ˜ƒ

opaque patrol
#

Yeah, its pretty neat...I few years ago when someone suggested running python on a micro-controller, people laughed and now here we are

cunning notch
#

It makes sense.

#

I have to walk the line between Java/Android and Python. I think I smile more when coding in Python. lol

opaque patrol
#

I do the same with javascript, c++ and python...

#

And I kick myself when I use a colon in javascript or c++

cunning notch
#

Most of my hobbies end up at work. I have over a dozen RPIs deployed running Python at work. I've been working on PLCs with HMIs for a while and now I working with Android for HMIs. It's a battle at times to decide if I want PyQt5 or Android. Android is smoother but takes longer. PyQt is python and, well, I like it more. Decisions, decisions.

#

I bought a Trinket M0, Feather M0 Express, and a Feather HUZZAH. Working on another automation controller. ๐Ÿ˜ƒ

#

Well, a controller that doesn't require a $500 PLC. ๐Ÿ˜ƒ

manic glacierBOT
solar whale
manic glacierBOT
tidal kiln
#

dolt! just realized i've been running a 2.x pylinter locally. things look better running it with a 3.x version.

cunning notch
#

@solar whale Thanks!

tidal kiln
#

@slender iron @stuck elbow updates to ds18x20 and onewire pushed based on review comments

tidal kiln
#

@slender iron one sec though, i think i'm going to do one last tweak based on @stuck elbow 's comment about bus._readbit and bus._writebit

slender iron
#

@tidal kiln ok. I think I'll go grocery shop now anyway

#

get it done so I can come back and focus

tidal kiln
#

np, it's minor, shouldn't take long

manic glacierBOT
manic glacierBOT
idle owl
#

@slender iron Did you get my question from last night

slender iron
#

on discord?

idle owl
#

Yah

slender iron
#

I think I missed it

idle owl
#

Do you know if interrupt handlers (ISRs, callback functions) are implemented in CircuitPython? They exist in MicroPython but I don't know if they're ported, and I don't know how to check.

slender iron
#

They may be interhited from MicroPython but its untested and therefore unsupported

idle owl
#

Ok

jovial steppe
#

@slender iron No reason to believe that any of the hooks are conditionally-compiled out? I've got a rotary encoder object that's currently using an update() [non-blocking API] that misses transitions occassionally and I'd prefer to use intrs. I thought that first I'd try to turn off interrupts between the two GPIO reads just to see if that changes anything.

#

But if you think that it's unlikely that I'm getting interrupted, then I guess I would expect no difference. Mechanical encoder being twisted at a reasonable rate.

slender iron
#

They could be compiled out. I haven't looked into it.

jovial steppe
#

OK, I'll see if I can figure out what's going on.

slender iron
#

I'd say its likely that Python is being interrupted. Its not meant to be strict time

#

there are a number of interrupts that happen plus "background tasks" that happen between loops of the vm

jovial steppe
#

I'm guessing you must use interrputs somewhere for wall-clock time maintenance or something. Maybe even systick?

#

But are those loops synchronous or async?

#

As in polled to look like an interrupt with a fake-async callout?

#

One of the libraries does this IIRC in main() outside of loop() to get around synchronization issues in the mainline code.

#

in Arduino.

#

It basically does the polling for you btw calls to loop() and calls your callback when it finds that an event has happened. Not bad for what it does, although of course users have to know that they can't while(1) in loop().

cunning notch
#

Is the Feather HUZZAHH ESP8266 compatible with CircuitPython?

idle owl
#

Yep!

tidal kiln
cunning notch
#

@idle owl @tidal kiln Thanks. That's the tutorial I couldn't find. ๐Ÿ˜ƒ

slender iron
#

@jovial steppe yup, systick is one interrupt, usb is another. gamepad is an example C module thats used to track state using interrupts more reliably

tulip sleet
#

@jovial steppe @slender iron I did check the code to answer @idle owl's query. Python-visible interrupts are not available in CPy. In other impls the pyb class provides some callback routines, and in other impls machine.Pin.irq() provides an interrupt routine. We don't have those. These features were port-specific and so it's not even that it's turned off -- it's just not part of our port.

idle owl
#

@slender iron Ping me when you're around. I need a chat about the tap API. Thanks.

slender iron
#

@idle owl just got back

manic glacierBOT
jovial steppe
#

@slender iron @tulip sleet I take a took at gamepad as a potential model. A maintained-polled model works "ok" for a manually-operated mechanical encoder, but it needs one hack in it to make it a more tolerant to missed transitions, versus always giving up outright. For my target audience, writing C plugins isn't much of an option, so I'll have to look into providing custom C-coded pieces for things that I know that I need. So far, rotary encoder support is the only one that I know of -- so, not probably not so bad. Avoiding custom builds is a high-want, but it looks like something has to give here.

#

ty for getting back to me.

tidal kiln
#

@jovial steppe not sure if it's useful for your use case, but there are dedicated encoder interface hardware options. basically outsource the counting to an external device and interact via something like spi.

tidal kiln
#

@slender iron question when you're done chatting api with kattni

manic glacierBOT
jovial steppe
#

@tidal kiln That's worth looking into for the general case, but in my immediate one I already have a shield that has an encoder on A3 & A4, so I'm looking for a soft solution. Can revisit that when the MetroM4 comes out, or switch another platform down the road, like maybe to a PSoC6 with a real crossbar fabric.

tidal kiln
jovial steppe
#

Yeah, saw that already. But unless it happens to be pinned-out to my particular pins, the solution won't be ideal, even if the peripheral dupes them out to multiple places. If you have a good, handy reference to using SPI, I'll take it but don't spend any time on it. I've seen people use things like UARTs/SPI in the past to weird things like pre-smoothed DACs.

#

ty

#

Ideally the Atmel side will start doing things like PPS as they have on the Microchip PIC24 side of the house.

tidal kiln
prime kernel
#

I need some help connecting to my CPE. When I plug it into my computer it turns on, but it doesn't show up. I used the driver installer from the tutorial and checked to make sure the cable had data. Any ideas?

jovial steppe
#

Yeah, there's no shortage of encoders/decoders in MSI parts. Our board is already what it is. One might as well throw another $0.25 MCU at it if you're going to off-chip your encoder. Like a SeeSaw -- programmable, customizable.

#

Although it ain't goin' to 20MHz!

#

But I don't know anyone with nimble enough thumbs to spin a mechanical encoder at 1M RPM...๐Ÿ˜ƒ

tidal kiln
#

@vocal shale what computer and os?

jovial steppe
#

Did you ever see it work? Do you see any action on the RGB LED?

prime kernel
#

Windows 10

#

Yes speaker bleeps and the lights do their thing.

jovial steppe
#

But you've not yet been able to speak to it the first time?

prime kernel
#

That's right.

jovial steppe
#

So basically a fresh-outta-the-mail board.

prime kernel
#

Yep, came in the Adabox.

jovial steppe
#

I'm using a different CircuitPython board (I don't have a CPE yet) but with power and data I was able to see a drive show up immediately. I'm also Win10.

#

Win10 doesn't need any special driver, so that rules that out.

prime kernel
#

Ok

#

I see it as a USB device on COM3, but I can't seem to get more.

jovial steppe
#

I do think that there's an image download tool to un-wedge a messed-up board -- an interface that doesn't use the USB mass-storage method.

#

Ah.

prime kernel
#

Wait a second I plugged it into another port and it showed up.

jovial steppe
#

That's probably the access method for the other initialization tool (Bossa, I believe). For my board it's documented how to use that in case the USB mass-storage doesn't work, but out of the box that shouldn't be necessary.

#

Yeah, if you talk about electronics, sometimes they get scared and start to work.

prime kernel
#

Haha yeah

jovial steppe
#

Just like us sometimes.

#

Windows is just like insanity. Sometimes you have to do the same thing over and over trying to get a different result.

tidal kiln
#

is the behavior repeatable? won't work in the one port, but does in the other?

jovial steppe
#

Might be a marginal cable, too. Either end could be wonky.

timber lion
#

ouch hrm reading an analog input on m0 seems to take 10ms

#

do we have an explicit delay built in perhaps?

jovial steppe
#

Or as @tidal kiln says, maybe the port is sloppy. I have at least one of those on my laptop.

timber lion
#

trying to see how fast i can sample ADC.. not promising with 10ms per sample :/

final night
#

hola

#

Has anyone messed with circuit playground? It has GPIO, but the only thing I can get working is capacitive touch. I can't really find any resources on using the gpio other than touch either

tidal kiln
#

@final night have you looked through the learn system?

final night
#

I thought I did haha. I guess I'll go back and check it out again

tidal kiln
#

a better question may be, when did you look?

#

a lot of things are being added and updated right now, and on going...

final night
#

Just found that one haha

tidal kiln
final night
#

Is circuit python syntactically different than python in basic stuff? Like could I write a Blinky program the same way?

inner wagon
#

HEY

#

can somone check my arduino code?

#

in projecthelp?

#

im wondering why the the real pressure is only printing 0

tidal kiln
#

@final night circuitpython is python3, with a few exception due to the limited hardware. but in general, just pretend it's python3.

final night
#

ah, cool cool. Does the same apply to micropython?

manic glacierBOT
tidal kiln
#

pretty much, circuitpython is a fork of micropython

jovial steppe
#

@inner wagon this is for CircuitPython.

inner wagon
#

aorry

#

sorry

tulip sleet
#

@timber lion AnalogIO reads from the ADC twice, because it doesn't know what state it's in, and if the ref voltage has changed, the first read is not reliable. Clock is being divided by 128. Looks like it's running at 375 kHz and it might take 16 clock cycles to read. But it gets enabled and disabled. don't know how long it takes to get set up.

slender iron
#

@jovial steppe if you add a C helper for toary encoder it'd be awesome to have it added to core CircuitPython like gamepad is

jovial steppe
#

This may be an Arduino implementation artifact. Since Arduino lets the user sloppily flip back and forth between using an analog pin and digital pin statelessly, they have to go through ADC setup every time in a worst-case fashion. If CP can/wants to reserve a pin for one or the other use during the lifetime of a created object, there are almost certainly setup optimizations that could be made to short-curcuit much of them. Maybe even let the ADC free-run during the life of an AnalogIn object.

#

You'd probably have to tie together all of the AnalogIn pins' configs though, since they're all mux'ed together.

#

@slender iron I'd be willing to look into that. I haven't done any ARM development yet, although I probably have all of the hardware to do it. Do you have a cookbook for dev-env setup, or is Atmel Studio all that's needed? I'm Win10, but I haven't used AS since version 4.

#

and only on AVR8.

#

I do have an Ulink-EDU around somewhere unused in a box.

slender iron
jovial steppe
#

@slender iron Here's my existing soft encoder impl which works "ok". Let's see if/how cut-N-paste works...

idle owl
#

@jovial steppe Surround code in three backticks (top left of keyboard) to create a codeblockIf that's what you're wondering how to do.

jovial steppe
#

Eh, it doesn't -- 2K chars max.

#

Ah, I'll try.

idle owl
#

Ah yeah, gist it

#

Same limit on code I believe

jovial steppe
#

Sigh. I'll try anyways.

#

Yeah, same problem. Maybe in two chunks.

idle owl
#

If it's that big, it might work better elsewhere

#

It's hard to read and discuss huge codeblocks here.

#

Comments are great though!

jovial steppe
#

`# This CircuitPython class implements a software, polled encoder object.

It's polled because at the current time there no support for interrupts or

hardware encoders on the M0.

Construct one by supplying the two board.Dnn pins.

The return value is a triple composed of the running count, a boolean

indication of a non-recoverable error, and a boolean indication of whether

a recoverable error occured.

This seems to work well enough to be useful with a 20count/rev mechanical

rotary encoder spun manually at a reasonable rate of speed without too

many errors (which can usually just be ignored depending on you needs).

class PolledEncoder:
ch1 = None
ch2 = None
state = 0b00
count = 0
lastChg = 0

`

#

` # Ex. PolledEncoder(board.D17, board.D18)
def init(self, ch1, ch2):
self.ch1 = DigitalInOut(ch1)
self.ch1.direction = Direction.INPUT
self.ch1.pull = Pull.UP
self.ch2 = DigitalInOut(ch2)
self.ch2.direction = Direction.INPUT
self.ch2.pull = Pull.UP

    if self.ch1.value:
        self.state = self.state | 0b10
    else:
        self.state = 0
    if self.ch2.value:
        self.state = self.state | 0b01

`

#

` def update(self):
err = False
fixedErr = False

    c1 = self.ch1.value
    c2 = self.ch2.value

    if c1:
        st = 0b10
    else:
        st = 0b00
    if c2:
        st = st | 0b01

    if self.state == st:
        return (self.count, False, False)

    if self.state == 0b00:
        if   st == 0b01: chg = -1
        elif st == 0b10: chg =  1
        else:            err = True
    elif self.state == 0b01:
        if   st == 0b00: chg =  1
        elif st == 0b11: chg = -1
        else:            err = True
    elif self.state == 0b10:
        if   st == 0b00: chg = -1
        elif st == 0b11: chg =  1
        else:            err = True
    else:   # state == 0b11:
        if   st == 0b01: chg =  1
        elif st == 0b10: chg = -1
        else:            err = True

    if err:
        # This is a kludge to deal with some missed transitions -- assume
        # that the missed transition was in the same direction as the last.
        #print("ERR:", self.state, st)
        if self.lastChg != 0:
            chg = self.lastChg
            self.lastChg = 0
            err      = False
            fixedErr = True
    else:
        self.count = self.count + chg
        self.lastChg = chg

    self.state = st

    return (self.count, err, fixedErr)

`

#

It's basically a re-entrant impl. You just keep calling update() as often as you can to see if anything's changed since the last call.

#

I haven't fully unit-tested it yet, but the happy case works well enough.

tidal kiln
#

@slender iron just PR'd the lingering onewire items

jovial steppe
#

My Python is three-years rusty but I'm refurbing. So probably not as pythonic as it could be. Would like to know how it could be better/more-concise.

flint oyster
#

Can you create files with circuit python on the circuit playground express? I'm looking at the documetnation and it looks like you can, but it's not working for me

jovial steppe
#

Should be able to if it works like the non-CPE boards. There are some editor-specific gotchas though, but may only come into play once you're (re-)writing-out files for execution. You could always create them locally and drag on onto the board the first time, just for fun.

#

Some editors don't write out files completely to fake-flashstick devices in some circumstances (that's the gotcha).

#

Notepad++ seems to be one editor with said issues. I use Emacs which works, but Emacs isn't for everyone.

flint oyster
#

This is what I have so far. It works like ths, but when I uncomment the file lines it doesn't run

#

import digitalio
import board
import neopixel
import time

f = open ('output.txt', wt')

f.write('test output')

f.close()

get the status LED by the USB port

led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

#led.value = 0

pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness = .2)
pixels.fill((10, 0, 0))
pixels.show()

tidal kiln
#

@slender iron FYI - that residual cookiecutter template stuff was my bad. i was trying to do a manual copy pasta update. obviously i didn't understand how it works. ๐Ÿ˜ฆ

jovial steppe
#

@flint oyster I'm no python expert, but it looks like you've got a mismatched single quote in the open() call.

#

When in doubt, add code one line at a time when it comes to syntax error tracking-down.

flint oyster
#

oh yeah, that would affect it

jovial steppe
#

The name is Balancer... Quote Balancer. Nice to meet you.

#

Shaken not stirred.

flint oyster
#

Nice to meet you too

timber lion
#

@tulip sleet ah hrm I think we should look at ways to speed it up. does arduino do the double read i wonder? i did a test to compare to arduino and it's 0.4 milliseconds for an ADC read vs. 10ms for circuitpython.. ouch big diff. with arduino it typically pushes filtering down to the user's code, so if you get noisey values do smoothing there (many arduino ADC sketches do a buffer of 5 samples and average them for example). i think we want the same approach

flint oyster
#

Tried fixing it, still has issues

#

import digitalio
import board
import neopixel
import time

f = open ("output.txt", "wt")
f.write("test output")
f.close()

get the status LED by the USB port

led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

#led.value = 0

pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness = .2)
pixels.fill((10, 0, 0))
pixels.show()

tulip sleet
#

@timber lion I'm writing an email -- should have some numbers and info for you soon.

jovial steppe
#

@flint oyster I don't have a CircuitPlayground nor have I done file I/O, but I'd be concerned that there's a module that needs to be imported to allow you to write to the file system. Unless you've seen an existing working example that shows that's the way to deal with files on CircuitPython, that's what I'd suspect. What you're doing is fine regular Python though.

opaque patrol
#

@flint oyster when you say "it has issues", do you mean writing to the file or with the neopixels? You have the brightness set to .2 and only setting the r value to 10. This may not be high enough to see. Try bumping it up to 155 or higher and see if that works (max value for r, g and b is 255)

jovial steppe
#

The issues I referred to is your editor of choice not flushing your code text out to the board when you write/save it to have it run.

slender iron
jovial steppe
#

There you go. Didn't anticipate that you could write files to the flash filesystem just like regular Python.

flint oyster
#

@slender iron That looks like what I need thanks.

jovial steppe
#

Everyone should have their own tannewt.

opaque patrol
#

if you get one now, it won't be tan until summer

jovial steppe
#

Gotta start somewhere. It takes three seasons to get edible asparagus, too.

opaque patrol
#

Really, I never thought asparagus was edible

jovial steppe
#

Lol. How do you think you can make pee smell that way otherwise?

#

Don't get me started on the veggie wars.

#

I've been practicing for decades on the emacs-vs-vi wars. I will crush you!

#

Emacs rules!

opaque patrol
#

no bash ing allowed

jovial steppe
#

Bash, as the successor to "sh" is clearly The Good Side. "csh" script writers also need to be shot alongside their "vi" users.

#

I love how "Tr ump" is in the censored language filter.

#

I'm finding them all firsthand.

#

Forgot to mention that I served as a general in the Spaces vs Tabs wars too. I have "the best" decorations.

#

You wouldn't believe it. Noone knew someone could earn so many medals.

flint oyster
#

I got a file written HUZZAH!

jovial steppe
#

Excellent. We knew you were better than they were!

#

The dark forces of programming have been vanquished.

final night
#

@tidal kiln I got digital input working. Thanks!

tidal kiln
#

@final night yay! np. glad it worked.

raven canopy
#

vagrant is putting up a serious fight right now...

raven canopy
#

so I totally missed documentation issue #448 last night while I was docupdating. got it done, but now when creating the PR, it wants to push the commits from last night that were already merged. does that seem odd?

manic glacierBOT
#

@tdicola has measured that AnalogIn.value takes about 10msecs per sample, which is very long. Currently it takes 16-bit samples with the 12-bit ADC using the builtin decimation and oversampling. This means it takes 256x the normal time: decimation and oversampling is 4^n.

In addition, there's a clock divisor which is set to 128 and could be set to 32 now, gaining another factor of 4. And finally, two readings are taken for each reading, in case the reference voltage has changed beforehan...

manic glacierBOT
#

I changed to prescaler division 32. Using the test program below (a slightly sped up variant of @tdicola's), I get these measurements. The "none" measurement is not using the ADC at all, just returning a fake value immediately from the low-level routine.

bits of resolution sample time samples per sec num times ADC is read per call
none 0.17ms 5800 0 (measuring overhead only)
12 0.29ms 3450 2
12 0.28ms 3500 1
13 0.33ms 3030 2
14 ...
#

yah the intention w/16-bit value is that 16-bits is greater than the resolution of microcontroller's ADC resolution (which is 10-bit or 12-bit...maybe rarely 16-bits but as you can see that is terribly slow). and its an int so cleaner, clearer and easier to compare/do math with.

default, the ADC should read whatever is the native rez (12-bit for M0/M4) then pads 0's for the bottom 4 bits

for reading audio, even arduino cannot sample analogRead() very fast, we would always set up a...

ruby lake
#

oh good, getting analogIn to go faster ๐Ÿ˜‰

manic glacierBOT
tulip sleet
#

@slender iron @idle owl is LIS3DH ready to be re-frozen? Latest PR is approved but not yet merged. Tnx. Maybe waiting for @timber lion review?

slender iron
#

@raven canopy when you are back I can help with git

#

@tulip sleet if you are ok with it too I think its ok to merge

tulip sleet
#

@slender iron it looks ok if you've tested

slender iron
#

yup I tested the three examples I changed

tulip sleet
#

good enuf

slender iron
#

@idle owl has too I think

tulip sleet
#

I'll make a new PR. Won't bother for a review, since it's just a submodule update. Are you OK with the AnalogIn fix?

slender iron
#

yup

#

will ook now

#

how did you test the analog change @tulip sleet ?

tulip sleet
slender iron
#

ok cool

slender iron
#

@tulip sleet want me to do a 3.0.0 LIS3dh release?

tulip sleet
#

sure, then it will be a labeled release for the frozen module in 2.2.

slender iron
#

yeah, I don't think we should freeze non-released versions of libraries

opaque patrol
#

Is audioio a builtin module?

slender iron
#

I believe its only enabled on express builds by default

opaque patrol
#

Okay, I was trying to use the trinket, I will switch to an express board

slender iron
#

yup yup, thats the case now

#

we ran out of flash space on the trinket

manic glacierBOT
#

Just to make sure we don't lose it, this was one thing discussed in the email thread.

From Dan: "So, in the short run, I can speed it up by x4 immediately without losing accuracy. Do you have some feeling for what to do for 2.2? For 3.0 we can do whatever. In chat Scott mentioned returning a float voltage value. We can add ".voltage" later, say in 3.0. I can also add some optional args that set the precision and/or scale the output if it's integer."

My thoughts for ADC, similar to volta...

idle owl
#

@tulip sleet @slender iron Thanks!

manic glacierBOT
#

Also to clarify, Dan mentioned "Tony proposes reducing to 12-bit to allow at least audio sampling." Actually I proposed speeding it up for all uses, not just audio. Right now for example we can't reliably catch a fast knock or signal when sampling a piezo. 10-20ms period or 50hz sample rate is just too slow unfortunately and frequently misses any quick impulse, like a sudden spike from a knock. If using timer & DMA is the desired way to go then should we open a new issue to add these for ...

idle owl
#

@slender iron I was going to test amg88xx last night but it looks like it needs to be rebased. I evidently only understand how to read what it tells you is supposed to be changed if I'm the one who wrote it because it looked really confusing to me. Or I would have done it myself.

slender iron
#

not sure how I did it, but my CPX flash got wiped overnight

#

such a tricky bug

idle owl
#

Truth

#

@tulip sleet Waiting on travis and then I'll merge the CPX PR

tulip sleet
#

@slender iron do you mean the power-down SPI erase bug or an amg88x bug

slender iron
#

power-down I think

#

not sure what the amg bug is

idle owl
#

There isn't one that I know of, I was saying the PR needs a rebase

tulip sleet
#

i didn't know if there was an amg bug or not! I do have a tentative fix for the power-down bug but it's not perfect. I have a closed PR but I could put it in anyway. It's not more dangerous.

slender iron
#

nah, lets sit on it

raven canopy
#

@slender iron after sleep, I think I have a plan. I need to pull from Adafruit/CPy to sync my fork...then do a PR for my new changes. Don't know why that didn't occur to me last night...

slender iron
#

I feel like we're rushing too much into 2.2

#

we should just call it good after the lis3dh stuff

tulip sleet
#

that's fine

slender iron
#

we can always do 2.3

tulip sleet
#

@raven canopy are these doc-only changes?

raven canopy
#

@tulip sleet yes. Issue 448.

slender iron
#

@raven canopy yup, I think you are on the right track

raven canopy
#

Adding audiobus to support matrix. @tulip sleet

tulip sleet
#

if you do this now I'll put it in 2.2. should be quick.

raven canopy
#

Yep. Luckily I can GitHub at work. Doing it now.

tulip sleet
#

or are you doing it on master?

raven canopy
#

Yep

tulip sleet
#

then it's 3.0

#

ok never mind

raven canopy
#

You want on 2.x?

tulip sleet
#

if you want the experience, sure. I will merge all changes from 2.2 to master in a big PR, so you don't need to do both. So git fetch upstream [or adafruit]; git checkout 2.x; git merge adafruit/2.x; git checkout -b 2.x_448_audiobusio_support_matrix; [do your change]; git push

raven canopy
#

Can only run GitHub at work, unfortunately. I'll just drop it to master to keep the confusion down. @tulip sleet

tulip sleet
#

@raven canopy np!

manic glacierBOT
idle owl
#

@slender iron ```python
def double_tap():
tapped = lis3dh.tapped
first_double_tap = tapped and not self._last_tap
self._last_tap = tapped
return first_double_tap

#

Actually so does the first version you sent me.

slender iron
#

really? weird

#

ah, shouldn't it fail since the method doesn't take self in?

idle owl
#

I added self.

#

And removed parens from the code loop below.

slender iron
#

can you post it again?

#

did you add self._last_tap = False to __init__?

idle owl
#

I did not

#

Still returning true. Here's what I have: ```python
last_tap = False

def double_tap(self):
tapped = lis3dh.tapped
first_double_tap = tapped and not self._last_tap
self._last_tap = tapped
return first_double_tap

while True:
if double_tap:
print('Double tap!')```

#

It's not in express class yet, this is trying to get it to work in code first.

#

If I make it self._last_tap above it, I get self not defined because it's not part of an init yet.

slender iron
#

in your loop do double_tap() since its not a property yet

#

and self should fail then

idle owl
#

TypeError: function takes 1 positional arguments but 0 were given

slender iron
#

exactly ๐Ÿ˜ƒ

#
last_tap = False

def double_tap():
    global last_tap
    tapped = lis3dh.tapped
    first_double_tap = tapped and not last_tap
    last_tap = tapped
    return first_double_tap


while True:
    if double_tap():
        print('Double tap!')
idle owl
#

Ok, why does that work?

slender iron
#

the original if double_tap was checking if the double_tap variable was True and a function value is True

#

self is only added implicitly when you call a function on an object like cpx.double_tap()

idle owl
#

Ok, what does the global last_tap do?

slender iron
#

since you called it directly, it was "static" aka unrelated to a specific object

#

global last_tap tell python you want to use the one you defined outside the function rather than create a new one inside

#

without global I think it'll warn you are reading before you assign it

tidal kiln
#
>>> def foo():
...   return False
... 
>>> 
>>> if foo:
...   print("hello")
... 
hello
>>> if foo():
...   print("hello")
... 
>>>  
idle owl
#

I originally had it with parens but removed them when the self bit failed, thinking that would fix the rest of it.

#

Thanks!!

tidal kiln
#

one of those python gotchas. it will continue to work, but with behavior you probably weren't expecting.

#

and for global example:

>>> foo = 23
>>> def global_test():
...   new_foo = foo
...   foo = 42
...   return new_foo
... 
>>> global_test()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in global_test
UnboundLocalError: local variable 'foo' referenced before assignment
>>> def global_test():
...   global foo
...   new_foo = foo
...   foo = 42
...   return new_foo
... 
>>> global_test()
23
>>> foo
42
>>> 
idle owl
#

Hmm

#

PyCharm is complaining. I'll see if it works. Nope, can't even mpy-cross it. Hmm. I'm supposed to put self._last_tap = False into _init_ ?

tidal kiln
#

but also watch out for doing this:

>>> foo = 23
>>> def global_test():
...   foo = 42
... 
>>> global_test()
>>> foo
23
>>> 
idle owl
#

Hah! Fixed it. Essentially anyway ๐Ÿ˜„

#

The last_tap's don't want self._ before them.

#

So it looks like this in express class: python @property def double_tap(self): global last_tap tapped = self._lis3dh.tapped first_double_tap = tapped and not last_tap last_tap = tapped return first_double_tap

#

with this in _init_: python self._lis3dh.set_tap(2, 18, time_limit=4, time_latency=17, time_window=110) self._last_tap = False

slender iron
#

no need for global in the class because you have self now

idle owl
#

Ah ok

#

Then do I even need the line at all?

slender iron
#

nope, just switch back last_tap to self._last_tap then

idle owl
#

Doesn't look like it!

#

Thanks!

slender iron
#

good work!

idle owl
#

Thank you ๐Ÿ˜ƒ

#

you too!

#

@slender iron Can you take care of the PR currently open for CPX?

slender iron
#

looks

#

merged

idle owl
#

Thank you!

slender iron
#

thank you for fixing it up!

idle owl
#

@slender iron So something like this Detect a double-tap on the device. Quickly tap the CPX twice to register a double-tap event. for RTD? I wasn't sure whether you wanted me to get into more explanation there or not, after everything we talked about.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 2\.2\.0rc1
#
[adafruit/circuitpython] New tag created: v1\.9\.3
#
[adafruit/circuitpython] New tag created: 3\.0\.0\-alpha2
slender iron
#

@idle owl maybe "True once after a double tap."?

idle owl
#

Added to that or instead of?

slender iron
#

instead of

idle owl
#

ah ok

slender iron
#

Detect is a bit weird because its after the fact

idle owl
#

Should I leave the second sentence in then? Explaining how to do it?

#

or use "Quickly tap the CPX twice to double-tap." sounds weird, but maybe it's needed? dunno

#

Actually I'll add that after the image, like we did with explaining how to "move the board" to change the values printed by acceleration.

#

I think it works there. Right before the code.

slender iron
#

yeah, that sounds good!

manic glacierBOT
#
[adafruit/circuitpython] tag deleted: 2\.2\.0rc1
#
[adafruit/circuitpython] tag deleted: 3\.0\.0\-alpha\.1
#
[adafruit/circuitpython] New tag created: 2\.2\.0\-rc1
idle owl
#

@slender iron Ok one more PR for you. Once that's done I'll update Limor on the situation.

slender iron
#

k looking

#

PR back to you @idle owl

idle owl
#

Wait, I misread that. I did the attribute error for CP being too old. But that's the issue, right because lis3dh is frozen? So if it's not working, it's your CP that's too old correct?

#

@slender iron let me know if that's not what you were looking for. changes are pushed.

slender iron
#

right

idle owl
#

ok keen

slender iron
#

since we explicitly use the built in version

idle owl
#

OK yep, I second guessed myself when I reread the change request is what it was.

#

Yay rc1!

tulip sleet
#

github seems to have moved the downloads to the top and called them "assets". not sure i like that

idle owl
#

I saw that, for some reason I thought that was our change.

tulip sleet
#

i'll be out for a few hours for an early dinner - see ya

idle owl
#

I'm going to do a new release on CPX.

#

@tulip sleet have a delicious one!

split ocean
#

Hi all, I've got a crash happening when using IR remote on CPX that I could use a hand in figuring out.

#

here's the crash message in REPL:

#

File "main.py", line 56, in <module>
File "/lib/adafruit_irremote.py", line 163, in read_pulses
MemoryError: memory allocation failed, allocating 512 bytes

slender iron
#

@split ocean can you post the code you are running in a gist?

split ocean
#

i'll post a Gist

idle owl
#

It's a .py

#

That might be the issue

slender iron
idle owl
#

@split ocean Is the file adafruit_irremote.py in your lib folder actually .py or is it a .mpy file?

idle owl
#

Did you change anything in it or did you use it from the repo I sent you

split ocean
#

just grabbed the .py there

idle owl
#

Let me make you a .mpy to try before we dig into the code. It's quick and worth a try

split ocean
#

super! thnx

idle owl
#

Remove the .py and put that in there instead

#

This may not be the issue, but it's a quick step

split ocean
#

OK, swapped it and still managed to get same crash.

#

File "main.py", line 56, in <module>
File "adafruit_irremote.py", line 163, in read_pulses
MemoryError: memory allocation failed, allocating 1024 bytes

Press any key to enter the REPL. Use CTRL-D to reload.

idle owl
#

oi ok

#

I'm grabbing your code to test it

split ocean
#

is it odd that it still blames "adafruit_irremote.py"?

#

even though I have .mpy?

idle owl
#

No I think it still sees it as a .py...

split ocean
#

k

slender iron
#

its not crashing on import, its crashign when its trying to read the pulses

split ocean
#

correct

idle owl
#

oh

split ocean
#

it works for a while

#

then after a few successful color changes from the remote, it crashes

idle owl
#

hmm

#

Maybe we need to clear a buffer?

slender iron
#

you could try not using neopixel brightness

#

that uses memory every show

split ocean
#

ok

idle owl
#

@split ocean Great job with this though! I'm really impressed ๐Ÿ˜ƒ

split ocean
#

thanks!

#

those arrow buttons were meant to change the brightness, but I can do that w the color value instead, eh?

slender iron
#

yup

split ocean
#

BTW, the crashing seems to be when I use the arrow buttons or soon after

#

so great deduction.

idle owl
#

Yeah that's how we were controlling brightness before we figured out cpx.pixels.brightness worked. Just set it really low in the RGB call.

split ocean
#

thanks guys, I think you've cracked the case! I can't get it to crash it seems if I lay off the brightness calls.

#

oh crud, I spoke too soon

#

just crashed it w color changes

slender iron
#

yeah, interesting

split ocean
#

those were a lot of rapid calls on the things, I hit color buttons over and over pretty quickly

slender iron
#

sounds like a memory leak or memory fragmentation

idle owl
#

ok give me a minute to finish something up and then I'll grab the remote and I can actually test and see how it's working.

slender iron
#

is it plugged into usb?

split ocean
#

OK thanks much. I just had a crash after only three button presses, so ignore my previous theory

#

yes, plugged into USB

#

w REPL open

slender iron
#

it should work better when its not

split ocean
#

OK, good! This'll be a battery project

#

I'll try that

slender iron
#

(there is a 4k buffer that gets allocated to help with writing files when on usb)

#

don't forget to do a nice eject!

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 3\.0\.0\-alpha\.1
prime flower
#

@split ocean lurking, but are you turning off pixels after each press (like 0,0,0)?

#

just a guess - maybe try turning off the pixels when you dont detect a press on the button (i.e: button up vs button down)

split ocean
#

no @dim lava just doing a fill of the new color. should I try blanking them first?

#

freaky, the thing is much more crash prone on battery power it seems.

idle owl
#

Hmm. Getting a CPX ready for testing

split ocean
#

wait, scratch that. fresh batteries seems to fix

prime flower
#

(just finished my last final, so ill be in here more often over break)

slender iron
#

yay!

split ocean
#

nice!

prime flower
#

discrete time linear systems and signals was a pain, but I learned a lotta theory that I didnt know so thats good

#

getting back to that though, ive done IR remote + neopixel with blanking when they're not pressed (@jp check your PMs, sent you some code)

split ocean
#

OK, still able to crash it on battery power w either the brighness change buttons or the color change buttons

idle owl
#

Hmm.

#

I have an idea. Testing it

slender iron
#

I fixed a crash when the decode fails

#

in the except clauses add continue

#

so python try: code = decoder.decode_bits(pulses,debug=False) print("Decoded:", code) except adafruit_irremote.IRNECRepeatException: # unusual short code! print("NEC repeat!") continue except adafruit_irremote.IRDecodeException as e: # failed to decode print("Failed to decode: ", e.args) continue

#

with try indented

split ocean
#

k

idle owl
#

Having trouble crashing it after that change!

#

Even changing brightness isn't crashing it

slender iron
#

@split ocean a style thing would be that you don't need () in the if. so if(command == 103): # 8 would be if command == 103: # 8

split ocean
#

thanks

idle owl
#

Oh finally crashed it.

#

But that took a lot.

split ocean
#

hmm, I'm still crashing, and also having a lot of cases where it recognizes and decodes the ir blast but doesn't light the neopixels

idle owl
#

I was able to do it a ton, really quickly and it took a long time to crash it

split ocean
#

@idle owl sometimes it takes many presses, other times it's after one or two hits

idle owl
#

Trying again with the pixel brightness code

#

I'm also still on USB.

split ocean
#

it seemed pretty similar on battery, so I'm back on USB

idle owl
#

I finally put it in 2 hands and tried to change it as fast as possible and this time it crashed with "list index out of range" but it took a ton of effort. I commented out the 3 ifs at the bottom and changed cpx.pixels.brightness to 0.5, and added Scott's change from above.

solar whale
#

quick test of 2.2-rc1 on metro_m0_express and CPX - no problems - On metro_m0 tested i2c (bme280) PSI (Sdcard read on Adalogger wing) , nepopixels , UART ( GPS) - On CPX - just dis spinner demo, and accel demo.

umbral dagger
#

@tulip sleet I just upgraded the FeatherM0 Express I'm using for the library I'm working on. No problems. Tried mpy-cross. No problems.

slender iron
#

ooh I got the memory issue

idle owl
#

Now I keep getting list index out of range. I added a time.sleep to the IR reading. python try: code = decoder.decode_bits(pulses, debug=False) time.sleep(1)

slender iron
#

cpx is huge

idle owl
#

Was wondering if it wouldn't run out as fast if it wasn't reading as quickly

#

means it's not as responsive, because there's 1 second between readings.

slender iron
#
memory after board: 15824
memory after ir: 11888
memory after cpx: 832
memory after import: 528
memory before: 96```
idle owl
#

oh.

#

Yeah... Freeze it?

slender iron
#

wait don't trust that

idle owl
#

ok

#

not trusting

slender iron
#

wasn't collecting gc first

idle owl
#

Ah

slender iron
#
memory after board: 16400
memory after ir: 13504
memory after cpx: 5424
memory after import: 5120
memory before: 4688```
split ocean
#

commence trusting

idle owl
#

It is big though, I know this. The endgame idea was to freeze it too. But we wanted to get everything else added to it. All that's left is the soundmeter if we want it, and IR which is low priority. Seems like we could freeze it for 2.2 if we wanted.

charred spindle
#

Is this the correct place to ask for helpwith trinket M0 + neopixel + circuitpython issues?

slender iron
#

yup!

idle owl
#

Is there some way to clear things every few loops or something? I mean it works for a few tries, then fails, so something must be building up? Or is it clearing every loop and every so often there's a loop that's too big in itself.

prime flower
#

can set a counter, not a very good solution though but it'll confirm if that's the issue

charred spindle
#

ok, I have a trinket M0 plus a neopixel 24 ring, I've updated the trinket to 2.1 and dropped the newer neopixel library into lib. Tried following https://learn.adafruit.com/kaleidoscope-eyes-neopixel-led-goggles-trinket-gemma but it wasn't lighting. I've managed to get it to light using a rainbowcyle demo, (I'll paste code as soon as i figure out how), but the full demo here doesn't work https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-neopixel It doesn't run on usb, and on battery i get blink codes. Also I get no output in serial console no matter what i print. Any ideas what I'm doing wrong?

Fashion headwear for cyberpunks, steampunks and Daft Punks.

Make faster and easier than ever with MakeCode, CircuitPython or Arduino!

slender iron
#

@idle owl it should clear as it needs it

idle owl
#

ah ok

slender iron
#

I think we may need a limit to how many pulses read_pulses can return

idle owl
#

I'm not getting memory allocation failures lately, I'm getting that list index out of range in reference to command = code[2]

prime flower
idle owl
#

I changed it to use neopixel instead to see if it was cpx being too big that was the issue. But the list thing was happening with cpx as well.

#

Oh wait I think the list index issue is related to code not specifically command

slender iron
#

I need lunch

#

be back in 20 or so

idle owl
#

Do it up

charred spindle
#

except that it doesn't work with usb plugged in, even while battery is plugged in.

#

oh, the rainbow is slowly moving!

idle owl
#

@split ocean Do you want to try some changes to the code?

charred spindle
#

(i adjusted pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2) to match the other code)

#

what do i need to do to test this while connected to usb, the constant unplugging is not what i expected, and serial console over linux screen isn't printing anything but >>>

idle owl
#

There are a lot of other changes that would have to be made to that to work with your bigger ring

split ocean
#

@idle owl yes

idle owl
#

@charred spindle If you're seeing >>> press ctrl+D

charred spindle
#

beyond the board, and pin? ```pixpin = board.D0
numpix = 24

pixels = neopixel.NeoPixel(pixpin, numpix, brightness=0.3, auto_write=False)```

idle owl
#

Yeah. I think some of the math assumes you're using the Circuit Playground Express. Maybe not, but at a glance it looks like it might.

charred spindle
idle owl
#

Could be wrong though. But if you're seeing >>> in the serial console, you're in the REPL and your code won't run.

split ocean
#

@idle owl excellent -- that code has no desire to crash it anymore

idle owl
#

Is your ring RGB or RGBW?

charred spindle
#

so how do i see print statements? as soon i as get these neopixels working I plan to wire in a temp sensor, where would i see temp outputs while testing

idle owl
#

I don't see why that code wouldn't work.

split ocean
#

should i just stay away from cpx w ir for now?

idle owl
#

@split ocean Is it working for you?

charred spindle
#

RGB

idle owl
#

@charred spindle Ok then that's not the issue. You see print statements in the serial console. But only when there is code running, and you're not in the REPL. Which is the >>> prompt.

median shadow
#

I corrupted my Trinket MO's main.py. I attempted to create a copy, too. However, it seemed to be taking too long to get it to run and I pressed to reset it - twice! I now see both files as having zero-bytes. But, I cannot delete them. And, I cannot over-write them. But, after creating a new file, named it code.py file, that worked okay. I can edit it, copy it, save it, and delete it Any idea how to clear out the corrupt main.py and main_copy.pyzero-byte files?

charred spindle
#

ok. as soon as i get my code running while attached to usb i'll give serial console print statements a shot. Any ideas why this doens't run on usb?

idle owl
#

@median shadow Backup anything you can though, that will erase the board entirely.

#

You will need to reload CircuitPython when that's done.

#

The other option is to try to delete them via command line if you have access to a terminal program - this is easier on MacOS and Linux than Windows.

#

Have you loaded CircuitPython before?

#

@charred spindle Not sure, no. There's obviously something unhappy. Do you have the appropriate libraries loaded on the board?

split ocean
#

@idle owl yes!

median shadow
#

Yes - I have loaded it before using the uf2 method. As for libraries, they are okay. I even copied libs from Github for one device and these seem okay, too. Just trying to erase the corrupt files seems to be the issue. I'll follow te instructions above. Thanks!

idle owl
#

@split ocean Ok nice! I'm going to discuss freezing the library into the CPX build, but until then, evidently it's a little too much for the IR code to handle. So go with what I sent you, try adding brightness back in and so on step by step.

#

@median shadow You'll need to use the uf2 you previously loaded when you're done erasing it. Same process you did when you loaded it before!

median shadow
#

@idle owl okay

idle owl
#

@split ocean Also if you want the red LED back you'll need digitalio so if that's a funcitonality you want, maybe try that first to make sure it doesn't cause memory issues adding it.

split ocean
#

ok, got it

idle owl
#

@split ocean Also I would remove it printing "code error" just take that print statement out completely so it's python try: command = code[2] except: continue

#

That was for me to make sure it was working.

split ocean
#

thanks again @slender iron and @idle owl

idle owl
#

For sure! Let me know if you need anything else!

split ocean
#

OK, I need to run in a second, but I have some questions for you later about running animations while still listening for IR blasts...

idle owl
#

Excellent, I'll be around! Ping me when you're back.

#

@charred spindle My suggestion would be to step back your code, start with something simple that just prints, see if you can get the serial console working. Then move from there. Start from a place of known good code and then move into more complicated stuff. The serial console displays (sometimes vague, but still) errors so once you know it's working, it should help you debug why the LEDs aren't working right.

charred spindle
#

jumpered USB to BAT pins with battery disconnected and I'm getting serial console and lights

idle owl
#

Nice!

#

I wouldn't have considered that

median shadow
#

@idle owl My Trinket is back up. However, a couple of Oops! Should I have tried to save the .Trashes files first? How important are these?

idle owl
#

Shouldn't be a problem at all, the only thing you would have wanted to save is your code.

#

Everything else is either an artifact of the OS, or can be reloaded like libs and so on

median shadow
#

@idle owl Thanks much!

idle owl
#

For sure! Great job!

charred spindle
#

What's the best way to ensure code is loaded to trinket m0? Code changes are not taking effect after saving file.

#

until I unplug/plug usb

idle owl
#

What OS are you on and what editor are you using?

#

Wait, you have serial console? You can use ctrl+D to reload, or ctrl+C to interrupt and then reload.

#

But it should reboot on its own.

charred spindle
#

linux, and whatever text editor comes with xfce,

idle owl
#

Ok that's good, you shouldn't run into an issue with it reloading before it's done writing, then. But I'm not sure why it's not reloading on its own once it's done saving.

charred spindle
#

I can switch to vim if there is good bindings, it just keeps popping up and so I'm using it there

idle owl
#

You should be good, it was more whether or not you were on Windows.

#

Editor shouldn't matter.

charred spindle
#

cool

#

thank you

tidal kiln
#

didn't dan do some linux editor delayed write testing the other day?

idle owl
#

Yeah I think so

#

I thought it wasn't typically an issue

slender iron
#

I think it can be

tidal kiln
#

not 100% sure, but thought some of the gui ones had issues

slender iron
#

from a linux command line you can run sync to sync the file systems

idle owl
#

@charred spindle ^^

jovial steppe
#

Dan did point out a few days ago that it's not necessarily a platform-specific thing only. Some editors do go out of their way to flush their data and parent directory entries so that The Right Thing(tm) happens. Emacs is apparently one such editor (even on WIndoze) and NotePad++ (from personal experience) is not.

tulip sleet
#

vim is good; it does a sync on each file write.

slender iron
#

great @tulip sleet

#

I know the rc.2 thing is weird

idle owl
#

@tulip sleet Should we consider freezing express?

tulip sleet
#

@idle owl I think so, when there's a version that you consider stable. Then it works out of the box and no mem problems. But it's been evolving a lot. So when you think it's ready for that. It should be pretty well tested.

#

Originally I though it might have been frozen a long time ago, but it wasn't ready at the time, and it didn't matter so much.