#circuitpython-dev

1 messages ยท Page 171 of 1

stuck elbow
#

and add a library for the wing

rigid path
#

Looks like it is the 69, "Adafruit Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit"

idle owl
#

Oh right. Which one is the board and which one is the wing?

rigid path
#

Both are feather boards

#

The M0 feather adalogger is the last one I need to get setup.

solar whale
#

@rigid path what frequency will you be using? 915 or 433?

rigid path
#

@solar whale - not sure yet, for now I am playing with a handful of boards. Trying to learn cp.

solar whale
#

This is only for the rfm69. Not the rfm9x.

rigid path
#

@solar whale - Thanks for the heads up.

solar whale
#

The difference in the CP build is that it defines board.RFM69_CS for the chip select. Youโ€™ll still need to load the library.

idle owl
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Start debugging CircuitPython on the SAMD21 or SAMD51 chips from Microchip using Windows 10 and Atmel Studio 7. This guide discusses using the compiled CircuitPython firmware for Atmel Studio projeโ€ฆ

manic glacierBOT
idle owl
#

So satisfying. Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

manic glacierBOT
raven canopy
#

@idle owl it is indeed. especially on the first go... ๐Ÿ˜„

idle owl
#

@raven canopy That was even run on an entire directory full of code.

raven canopy
#

bonus!

manic glacierBOT
#

Neither 3.0.0-beta.0 or master have the asf4 change so you'll need to build
a custom version to test the increased number.

On Thu, May 24, 2018 at 3:00 PM Dan Halbert notifications@github.com
wrote:

@paulswirhun https://github.com/paulswirhun Since you tried this change
of increasing the count, we've turned on the instruction/data cache on
SAMD51, which may make the timeout loop now run too fast again. Could you
try it again with 3.0.0-beta.0 or the tip of master?

โ€”
You ar...

#

There's not enough flash if I leave I2C and UART in. That's the main reason I removed them -- it wasn't because there are no pins for the functionality. To gain space, I have to empty the locals dict, etc. so that the routines aren't compiled in, and that involved a lot of #ifdef'ing.

I don't think anyone is going to try I2C or UART on the pirkey because there's nothing to connect to to use them. We need to keep SPI for the on-board DotStar.

slender iron
#

@tulip sleet ifdef out names from a module is a precedence I realllllyyy don't want to set

tulip sleet
#

I removed other base modules (like rtc and samd) that weren't really necessary. It's already the case that for certain base modules we don't include everything on certain builds for space reasons, like certain string operations and certain math functions.

I tried creating a set of stubs like common-hal/busio/I2C_not_implemented.c but the Makefile structure makes it hard to substitute these for the full files. Also a set of stubs could have been in shared-modules, but there is already code there to fallover to bitbangio, so that avenue isn't available either.

I am short about 750 bytes. I could look at other stuff, but the build will probably grow slightly in the future anyway. In this case this is functionality that just doesn't exist on the board. It's just one level down in a module instead so we can't just excise a top-level module.

#

like touchio isn't included, period, there aren't stubs to throw "NotImplemented", etc.

#

I actually think that if it's completely missing it's clear that it will never work, as opposed to constructors that can't be used because there are no such pins.

slender iron
#

I want to do it on the module boundary like touchio. The reason I don't want to change is because MicroPython allows this and it leads to a whole bunch of modules that are a variety of things.

manic glacierBOT
slender iron
#

@tulip sleet can you use a set of weak functions to provide generic implementations? it'd be useful for new ports too

manic glacierBOT
slender iron
tulip sleet
#

@slender iron do you wanna audio chat about the above?

slender iron
#

I can in a bit. not at my desk atm

manic glacierBOT
#

The trivial (and I think most common) case is when the display is the only device on the SPI bus โ€” you can just tie CS to GND then permanently and only block when a transfer is requested when the previous transfer is still happening. All displays that Adafruit carries support that (perhaps with the exception of the SHARP displays, which as haven't been able to get to work as of yet). That case also lets us optimize busdevice a bit, because we don't have to re-set the speed and polarity each t...

tulip sleet
#

@slender iron discord was not doing well, missed some of your comments until i restarted

raven canopy
#

yeah, there was a hiccup. had to do the same...

slender iron
#

@tulip sleet still want to chat? I'm back at my desk

tulip sleet
#

@slender iron sure

stuck elbow
#

@slender iron is it expected that AudioIO.play() suddenly requires 512 bytes of memory?

#

it didn't need it in 2.x

wintry notch
#

Hello everyone, Iโ€™m new here and to Adafruit and Iโ€™m new to all of this coding stuff that Iโ€™ve been working on to an extent. I was hoping that some of you guys here could help me accomplish some of the mini projects Iโ€™m working on?

stuck elbow
#

Hi, sure, just ask anything you don't know, and if someone here knows, they will answer.

wintry notch
#

Thanks man.

#

So, does anyone here know of any existing libraries for CircuitPython that scroll text on a NeoPixel?

slender iron
#

@stuck elbow the constructor grabbed it last time. its used for the double buffer

stuck elbow
#

is there a way to disable it?

slender iron
#

what are you playing? a wav file?

stuck elbow
#

yes

slender iron
#

no, its needed

stuck elbow
#

can I make it use a pre-allocated buffer somehow?

tulip sleet
wintry notch
#

@slender iron you know if there is such a library?

idle owl
#

@wintry notch There was something written for DotStar that does it, it's possible you could port it, but I don't think anything exists at the moment.

wintry notch
#

Wha

#

Whatโ€™d I say?

idle owl
#

It was written specifically to work with the DotStar Featherwing, so it would require porting.

tulip sleet
#

you used a mild curse

wintry notch
#

Wait am I not allowed to say d*mn?

tulip sleet
#

that's right

wintry notch
#

Oh ok. My apologies.

#

Well, anyways, Iโ€™m trying to scroll text on an 8x8 NeoMatrix with a Metro M0 Express as the micro controller. I have been busting my head trying to figure it out for the past few days.

idle owl
#

Ah. Yah the only thing I know of was written by a community member for the DotStar Featherwing matrix.

wintry notch
#

Ah. Yeah I believe I saw that.

#

Could you by any chance link it to me?

idle owl
#

I can link you the guide, which has links to the library in it

wintry notch
#

Yeah exactly.

idle owl
wintry notch
#

Please and thank you.

idle owl
#

You're welcome

manic glacierBOT
manic glacierBOT
tulip sleet
#

@idle owl can I make a new release of cpx lib after Tuesday's merge? I need a tagged release for freezing

idle owl
#

@tulip sleet Yah I thought you already had. I didn't add any of the iffy stuff in. Should just be the 3.x update. Actually wait, we have touchio. Want me to test it?

#

It hasn't actually been tested with 3.0 when it should work

tulip sleet
#

yah, go ahead, and then make a release if it's ok, since you can describe what's new more easily than me

idle owl
#

ok keen

#

@tulip sleet Found a problem.

tulip sleet
#

is?

idle owl
#

with start tone, I think it's an audioio issue, Jerry caught the one in play_file, I think he missed that evidently generate_sample used in start_tone also uses audioio

#

I think I know what it is. I think I can fix it.

solar whale
#

Oops. Sorry about that. Iโ€™m on a plane with intermittent Wi-Fi, but let me know if I can help. Iโ€™ll try.

idle owl
#

Hah!

#

I fixed it!

#

Now I have to do all of the cross compatibility buggery to get it to work with both

manic glacierBOT
#

I only have SAMD21 (Trinket M0).

On Thu, May 24, 2018, 3:03 PM Scott Shawcroft notifications@github.com
wrote:

Neither 3.0.0-beta.0 or master have the asf4 change so you'll need to build
a custom version to test the increased number.

On Thu, May 24, 2018 at 3:00 PM Dan Halbert notifications@github.com
wrote:

@paulswirhun https://github.com/paulswirhun Since you tried this
change
of increasing the count, we've turned on the instruction/data cache on
SAMD51, wh...

idle owl
#

And that is the sound of success!

tulip sleet
#

๐Ÿ”Š

idle owl
#

I linted it. It passes.

#

But let it build anyway.

spare storm
#

Hey everyone, just wanted to thank you all for your help! The CP+Crickit Tom Servo is now operational. ๐Ÿ˜„

idle owl
#

It failed.

tulip sleet
#

W:600,12: Attribute '_sine_wave_sample' defined outside __init__ (attribute-defined-outside-init)

idle owl
#

I know. Already fixing

tulip sleet
#

it was 9.95 out of 10. That would get a you gold medal in most circumstances

idle owl
#

NOT GOOD ENOUGH.

#

Passed. ๐Ÿ˜ƒ

#

I'm waiting until I can pull all of the 2.x crap out of there and have it just be 3.x+ compatible.

tulip sleet
#

ok remerged

idle owl
#

ok

tulip sleet
#

i can remerge even a closed PR

idle owl
#

Drafting a release

#

@tulip sleet Ok released.

tulip sleet
#

Thanks!

#

will go into the latest

idle owl
#

@solar whale Thanks for the offer of help, but I sorted it ๐Ÿ˜ƒ

solar whale
#

Nicely done!

idle owl
#

@tulip sleet Whenever we're done with 2.x updates, I'll pull all of that out. Space is already so tight with this one, that it'll be worth it to lose backwards compatibility.

#

@solar whale Thanks ๐Ÿ˜ƒ

manic glacierBOT
tulip sleet
#

@idle owl I retagged to 2.0.0 (need the last digit), but do you know how to trigger a re-make of the files?

#

in travis?

idle owl
#

@tulip sleet I do not. Sorry about that.

#

Would have had it nailed if I kept it 1.x.x... bleh

#

I'm out for the evening

tulip sleet
#

@slender iron how do I re-trigger travis to remake a library after changing its tag? Go into travis or do from github?

slender iron
#

what do you mean by changing the tag?

solar whale
#

@idle owl have a good evening,

tulip sleet
#

kattni tagged the lates cpx lib as 2.0, but I thought it shoudl be 2.0.0, so I edited the release, but the old built .zip files are stil there

slender iron
#

lemme look

tulip sleet
#

same is true of the lis3dh lib, labeled 4.2 instead of 4.2.0 .. Maybe it's not an issue that there's no 3rd digit?

slender iron
tulip sleet
#

ah great ok

slender iron
#

it should have the third digit for consistency

tulip sleet
#

I'll redo lis3dh too

slender iron
#

thanks

wintry notch
#

I know you guys are busy with fixing an issue for a new release, but when you guys have a chance. I have a concern about something Iโ€™ve been thinking about. I wanted to see if you guys could help me out with writing a function in CircuitPython.

manic glacierBOT
slender iron
#

@wintry notch Go ahead and ask and we'll get back to you when we have time.

manic glacierBOT
wintry notch
#

I wanted to write a function that would take 8 strings/values in a table form, and it takes 2 values, either X or . and if it was an X turn on a certain NeoPixel, and if itโ€™s a . turn it off/leave it off.

manic glacierBOT
tulip sleet
#

@wintry notch Is there a reason you want to use "X" or "." as opposed to True or False?

#

change_pixels((True, False, True, True, True, False, False, True))

#

something like that?

manic glacierBOT
tough ridge
#

does anyone know where I can download cmath? an fft library I'm trying to use has it as a dependency but I cant find the download for it anywhere

raven canopy
#

For CPython? My first guess would be PyPi...

#

actually...cmath is a native CPython module.

tough ridge
#

yeah, that's what I'm confused about lol. cant even import it in repl

raven canopy
#
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import cmath
>>> dir(cmath)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'cos', 'cosh', 'e', 'exp', 'inf', 'infj', 'isclose', 'isfinite', 'isinf', 'isnan', 'log', 'log10', 'nan', 'nanj', 'phase', 'pi', 'polar', 'rect', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau']
tough ridge
#

the circuitpython repl, that is

raven canopy
#

ahhh. we don't have cmath that I'm aware of.

#

just math:

>>> import math
>>> dir(math)
['__name__', 'e', 'pi', 'sqrt', 'pow', 'exp', 'log', 'cos', 'sin', 'tan', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'copysign', 'fabs', 'floor', 'fmod', 'frexp', 'ldexp', 'modf', 'isfinite', 'isinf', 'isnan', 'trunc', 'radians', 'degrees']
tough ridge
#

ah ok, is there an equivalent I can use?

#

the fft deals with complex numbers but I found a recursive version which doesn't (although it sucks and eats memory)

raven canopy
#

micropython appears to have cmath.

tough ridge
#

oh huh, can I get at that somehow? I'm using a circuit playground express

raven canopy
#

it is also still "available" in the circuitpython repo, but it might take a bit of work to get it compiled into a local version. and no, micropython doesn't support the SAMD. sorry.

tough ridge
#

oh ok, thanks for clearing that up lol, you've saved me a lot of time and head-scratching

raven canopy
#

you're welcome. sorry i don't have an answer that would help you get past the obstacle.

#

and to clarify my earlier bumbletygoop. you might be able to build a custom version of the firmware that includes cmath. but, due to memory constraints you'll most likely have to exclude other things. which is probably why it isn't in the released firmware.

tough ridge
#

sounds good, I might try implementing the required cmath function on it's own but I forget what it was atm

timber mango
#

I think there may be some new math-related hardware in the SAMD51 M4 that is not present in the SAMD21 of the CPX.
Metro M4 Express: SAMD51J19A

raven canopy
#

True Floating Point, iirc...

timber mango
#

Yeah that's exactly what I'm thinking. I'm thinking I can do a floating point forth if I wanted to.

#

Hm. RS485!

raven canopy
#

last test build of the night. may have figured something out, but we'll see. now it's play time. ๐ŸŽฎ

hearty stratus
#

Traceback (most recent call last):
File "main.py", line 10, in <module>
File "/lib/bitmapfont.py", line 28, in init
OSError: 2

#

trying to use the bitmapfont library but not successful

#

`import board
import busio as io
import adafruit_ssd1306
import bitmapfont

i2c = io.I2C(board.SCL, board.SDA)
oled = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)

bf = bitmapfont.BitmapFont(128, 32, oled.pixel)
bf.init()`

#

i could just be doing this wrong

tulip sleet
#

@tough ridge cmath is not turned on because there has been no room for it in the past. We might consider turning it on for the M4 builds, but we haven't checked how big it is, and we have other possible uses for the space. If this is the library you're using: https://github.com/peterhinch/micropython-fourier it also uses inline assembler, which we have also not enabled.

#

Sorry this may be somewhat disappointing. If you feel you have the skill, you could try a custom build enabling these things. They are not going to fit on an M0 board.

tough ridge
#

oh ok, thanks for the update. I'll make do with a workaround then

manic glacierBOT
#

I have been looking again at a problem where Gemma M0 using CircuitPython cannot talk to a STM32L-based tinyLiDAR over i2c. I've been using the pins which I believe allow it to use a hardware optimised driver.

Is there a difference between the software implemented i2c and that in the ATSAMD21? What version of CircuitPython would be best to try this with if this is the case? Can I just change pin to a non-hardware capable one and the s/w implementation will kick-in?

Discussion of problem...

tough ridge
#

@tulip sleet @raven canopy I just took another look at the code and realized that, while cmath is imported, it's never used lol. So I just pulled out the function from the library and it's working fine it seems

raven canopy
#

score one for the home team!! maybe an earlier version used it. version control is not always as simple as it seems... ๐Ÿ˜„

manic glacierBOT
tulip sleet
#

@tough ridge OK, great! I thought the library you were using required complex arithmetic.

raven canopy
#

finally got it to fail gracefully! it's kind of kludgey though...

186
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
RuntimeError: Frequency captured is above capability. Capture Paused.
tough ridge
#

yeah me too...

raven canopy
#

@tulip sleet & @slender iron, what are your thoughts on using NVIC_DisableIRQ vs common_hal_mcu_disable_interrupts? using the mcu approach was keeping me from fully exiting the endless interrupt loop...

#

uploading a gist

slender iron
#

is it generating an interrupt on every edge?

manic glacierBOT
raven canopy
#

@slender iron only on HIGH: uint8_t sense_setting = EIC_CONFIG_FILTEN0 | EIC_CONFIG_SENSE0_HIGH_Val;

slender iron
#

huh, why did you do it on value instead of an edge?

raven canopy
#

the EIC is only to generate the event for the TC.

slender iron
#

could that be why you are running over? if its high, you clear the interrupt and it sets it again because its still high

#

what is your interrupt handler for?

raven canopy
#

TCn_Handler

slender iron
#

ah

raven canopy
#

i'm just trying to avoid the same issue as PulseIn locking up. INTFLAG.ERR/INTFLAG.OVF have proved "unreliable" as barometers, since the issue is circuitpython clearing the registers quick enough..

slender iron
#

right, I wouldn't do an interrupt to the cpu every edge

#

how fast can you get now?

raven canopy
#

~520kHz. Sending a 512kHz, but it's read as ~520kHz. resolution gets worse as the value goes up...

#

which may be due to the overflow, and the fact that i'm not handling it (yet)

slender iron
#

overflow should only occur 8 times a second then

#
>>> 512000 / 65536.
7.8125
raven canopy
#

well, i'm not prescaling it, so it's on GCLK (48MHz).

slender iron
#

ah, you are trying to measure the pulse length

raven canopy
#

just period, but yes, width is included in the TC capture. ๐Ÿ˜„

slender iron
#

so you are generating an interrupt every input cycle

raven canopy
#

that's my assumption.

slender iron
#

how responsive does it need to be? why not increment the counter based on the input and comparing to ticks_ms to measure the duration

#

it'll be a huge average but that should be ok

raven canopy
#

well, that's just re-creating PulseIn, and I fear we'll run into the same problem at the current level (~64kHz).

slender iron
#

no, pulsein interrupts every input edge

#

instead, use the tc to count to a top limit and then interrupt

#

you could measure how long 1000 cycles of the input clock takes then

raven canopy
#

oh. well, that's what i understood that TC capture was doing. just that TOP = MAX.

slender iron
#

is your code anywhere besides the gist?

raven canopy
#

nope.

slender iron
#

I believe you are measure the period of a single input cycle

#

can you push it somewhere?

raven canopy
#

there is a fuller version in there. i just posted the three "relevant" functions on that last one.

slender iron
#

why not just push the full branch?

raven canopy
#

vagrant + windows...remember? hehe. I should anyway, just need to copy everything over to the clean git.

slender iron
#

ah

raven canopy
#

i'll have it up in a few.

simple pulsar
#

hello, i have a quick question on bitbangio

slender iron
#

@simple pulsar ask away

simple pulsar
#

I was going to try it to see what it does wrt to the i2c issues i've seen

#

Can it be used with Gemma M0?

#

That's the only M0 board I have at the moment

slender iron
#

ah, I think its off by default to save space

simple pulsar
#

it does appear not to be there

slender iron
#

what i2c issues are you thinking of? (are you on github as a different username?)

simple pulsar
#

I'm kevinjwalters on github

slender iron
#

ah kk

simple pulsar
slender iron
#

the gemma is using the hardware i2c which does support clock stretching

simple pulsar
#

Ah, well i can't get it to work with the little device.

slender iron
#

do you have pull up resistors on the bus?

#

ah yeah, I see you are

simple pulsar
#

There's an interesting and thorough description of clock stretching on that page I mentioned, it turns out it can occur in different parts of protocol and some implementations don't support all of them

slender iron
#

ah

simple pulsar
#

The tinyLiDAR doesn't work with the bog standard arduino or raspberry pi i2c libs

#

I can borrow a circuit playground express - is the bitbangio going to be included on that?

slender iron
#

I think it is

#

what makes the tinylidar worth the trouble?

#

you could use the sensor directly

simple pulsar
#

I bought a few including for friends as gifts. It seemed like a nice idea but it turns out i2c isn't a great bus in terms of compliance with spec!

#

And I thought it would be useful if your boards could talk to them, apparently it does nothing special with i2c, it's just the STM32L device

slender iron
#

yup, seems like you may have crossed the time vs cost of buying something else threshold

#

yeah the stm32 code could be funny

simple pulsar
#

it looks ok on the wire to me so far, it just puts in this extra delay for the ack

#

maybe i should get another trace with the high analyzer sample frequency, i had it a bit low before and it had missed a short SCL pulse

#

I'll ask a friend for their CPE at come back to this in a few weeks, thanks for your help

raven canopy
#

@slender iron i'll have it up later. i bungled the first attempt since i tried a "smooth" way. ๐Ÿ˜† have to change the oil in my car and grab some lunch...

tidal kiln
simple pulsar
#

Funny you mention that, i do have one of those still in its "box" !

#

But i have 1+5 tinyLiDARs too

tidal kiln
slender iron
#

@simple pulsar have you checked with an oscilloscope too?

simple pulsar
#

No, only the SQ25

#

I'm living in the 80s and only have a somewhat old bulky scope

#

with no capture

slender iron
#

it'd probably be enough

#

it'd just be a sanity check on the signal integrity

simple pulsar
#

Yes, i have seen a few other people have problems with noise which has only shown up on 'scopes

#

But I think in this case it's unlikely because it works fine on the arduino i checked it with

manic glacierBOT
simple pulsar
#

and it has a track record of not working with "basic" i2c implementations ๐Ÿ˜ฆ

tidal kiln
simple pulsar
#

wry 778, tinyLiDAR command sequences are miniscule, a few chars so 64 limit would be no problem

#

I could try a high frequency SQ25 analysis again against the Gemma M0 output now I know a bit more about i2c and know that the 9th pulse wasn't missing on Arduino.

#

I do not expect it to work but I may be able to see and describe the protocol fault now.

slender iron
#

<@&356864093652516868> Is it ok if we do the meeting on Tuesday? Becca has the Monday off (Memorial day here in the US) so I'll take it off too.

idle owl
#

@slender iron That's fine.

simple pulsar
#

Ok, i'm off now, thanks for your help and ideas

tidal kiln
#

later. goodluck @simple pulsar

#

@slender iron i'm gone all next week, so i'm null response

fluid helm
#

that suits me @slender iron ๐Ÿ˜ƒ

cunning crypt
#

Works for me. I work on Monday but not Tuesday

tidal kiln
#

oh wait, this is CP channel, sry, meant to say None response

manic glacierBOT
slender iron
#

<@&356864093652516868> Next week's meeting will be on Tuesday instead of the normal Monday due to a US Holiday. It is Tuesday May 29th at 11 am Pacific / 2pm Eastern here on Discord.

errant grail
#

Having some timing issues with dropped MIDI bytes received via busio.UART with the stable CPy release and 5/23 3.0 beta. It acts like a baud rate (31250) or framing issue when working with closely-spaced Note-On and Note-Off streams. Tested it on both M0 and M4 hardware. Wondering if anyone else has seen it. Next step will be to confirm baud rate accuracy on the o'scope. I'll submit an issue after that. Not an issue: MIDI output streams may be implemented with the bandwidth-saving Running Status shortcut. Not all vendors use this shortcut, but MIDI input devices are (informally?) expected to support it. #NeverMind ๐Ÿค”

marble hornet
#

hi all, im looking at the pins.c file for the metro m4 revb and there are a bunch of pins undefined. could one add them then and re-burn ? (assuming they were broken out )

idle owl
#

You could add them and rebuild, yes, assuming they're broken out.

marble hornet
#

im making a atsamd51 board for myself , but am missing some info b/c the eagel files aren't on github yet

#

@idle owl thank you !

idle owl
#

Yep!

marble hornet
#

is there a place i could fine some...? like crystal frequency... (32.687?) flash chip pins ... ?

#

etc

idle owl
#

I don't know on that one

slender iron
#

@static zealot metro m4 revb is not the production one

marble hornet
#

?

#

@slender iron what is the production pcb ?

slender iron
#

rev f

#

in boards it doesn't have a rev next to it

marble hornet
#

okay

#

and is that in the most current master ?

slender iron
#

yeah its simply metro_m4_express

idle owl
#

It didn't occur to me to ask about that, I thought maybe you had a revb and you were using it. Sorry about that.

slender iron
marble hornet
#

THANK YOU!

slender iron
#

ya, thats the production rev

marble hornet
#

WHOOP WHOOP !!

#

@slender iron a long time ago i added a 16Mb flash chip the the devices.h file. its is untested but if i note that in the code is it a good idea to push ?

slender iron
#

up to you

#

not super useful though if its untested

marble hornet
#

okay, ill keep it in mind

slender iron
#

cool cool

#

๐Ÿ˜„

idle owl
#

Yeah!

fluid helm
#

WOOOOOOOOOOOOOAH

idle owl
#

@slender iron I think you preempted the surprise. ๐Ÿ˜„

tidal kiln
#

anyone working on a CP doom port?

raven canopy
#

but man oh man...all the activity over the last week+ is going require some de-conflicting... ๐Ÿ˜„

#

luckily, it's just the makefile. :phew:

opaque patrol
#

Will the gaming platform be using Deshipu's stage and ugame?

stuck elbow
#

@slender iron oh wow, are you going to use the stage library?

#

I'm all for making it work with it

#

hopefully the keys won't require some weird scanning that can't be done in the background

slender iron
#

@opaque patrol it will be different hardware but we'll make sure the C helpers help everyone ๐Ÿ˜ƒ

#

@stuck elbow its all theoretical at this point but we'll definitely have cycles to spend on improving things

stuck elbow
#

I would really love this to become a reality

#

so that I don't have to run my own

slender iron
#

๐Ÿ˜„ its looking to be awesome. still early days though

marble hornet
#

sounds like a great thing for async io

stuck elbow
#

it's probably going to be all Arduino initially

#

plain Python is too slow without the right libraries

slender iron
#

nah, I think we're thinking circuitpython

stuck elbow
#

should be possible to port arduboy and gamebuino games to it

#

and maybe some gameboy emulator

#

to get some games at the beginning

slender iron
#

we'll see

stuck elbow
#

I'm definitely going to look at it

#

by the way, I managed to work around the additional memory requirements of audioout by baking the bmp files into the .mpy

slender iron
#

nice!

stuck elbow
#

but I would really prefer to be able to use a smaller buffer

slender iron
#

its possible the memory thing is a bug too since it was redone

stuck elbow
#

512 bytes is a lot

slender iron
#

smaller buffers have a higher risk of underflowing

stuck elbow
#

and to be able to pre-allocate it, so that it's immune to fragmentation

slender iron
#

it'll be much less of an issue on m4

stuck elbow
#

right

#

I need to sit down to it properly, I haven't been able to recently because of moving to an new flat

slender iron
#

well, we should definitely keep brainstorming. I'll probably have time to dedicate to it post-3.0.0

stuck elbow
#

it's a bit weird how you can stream things directly from flash when it's in .mpy files, but not when it's in data files

slender iron
#

that doesn't make sense

stuck elbow
#

some kind of mmap would be awesome

slender iron
#

yes, totally

#

I love the idea of leaving bytecode in flash

stuck elbow
#

anyways, I need to go to bed, hackaday Belgrade tomorrow

#

good night

slender iron
#

goodnight! have fun!

slender iron
#

fyi, I'm reorganizing a bunch of files in ports/atmel-samd

hearty stratus
#

sorry to ask this again but im having trouble with my Trinket M0 and bitmapfont libs

#

im only getting this error in console Traceback (most recent call last): File "main.py", line 10, in <module> File "/lib/bitmapfont.py", line 28, in init OSError: 2

#

I'm trying to get text to display on my OLED. im sure im overlooking something simple. maybe you guys know?

tidal kiln
#

do you have the font file on there?

raven canopy
#

@hearty stratus OSError 2 is "No such file or directory".

tidal kiln
#

looks like it's after font5x8.bin (which is in the library repo)

raven canopy
#

yep. and line 28 is the f.open line.

hearty stratus
#

do i have to import font5x8 too?

#

all my stuff is in lib

#

maybe it's looking for it there

#

err. in the root

tidal kiln
#

no. just needs to be...oh

#

yep. try that.

hearty stratus
#

that was it!

#

thanks @tidal kiln

#

now to figure out how to write text ๐Ÿ˜„

ruby atlas
#

hmmm data in mpy files!

#

wondering out loud: can i create an mpy with from a running script and dump data into it.

#

(thinking about LED animation sequences and performance again)

tidal kiln
#

why does it need to be a mpy file?

hearty stratus
#

btw, how to i convert py to mpy?

#

is there any benefit?

tidal kiln
#

mpy-cross

hearty stratus
#

(new to circuitpython)

tidal kiln
marble hornet
#

mpy is a py file converted to byte code. this means the same stuff is in there but it is not human readable. it also saves space for running programs in ram. (b/c it does not use full words) ( * this is not a complete explanation *)

tidal kiln
#

^^that. also, it gets around memory issues when trying to import larger .py files

marble hornet
#

sometimes using mpy versions of large libraries can save you ALOT of memory

raven canopy
#

@ruby atlas do you mean putting data into an mpy while circuitpython is running? or having a set of boilerplate data that can be placed onto the board (e.g. in /lib)?

ruby atlas
#

dynamically writing a structure to an mpy on flash (if space permits) in the right form to import later.

#

it's a bit of a crazy idea, probably not the right thing to do.

tidal kiln
#

๐Ÿค” hmmm what is available for object serialization in CP?

raven canopy
#

well, there is an open issue for mpy-cross within circuitpython, but it hasn't been tackled yet.

hearty stratus
#

thanks @marble hornet that would probably be what i'll do since i'm already low on space for the M0

#

and need the BMP280 libs on here as well

marble hornet
#

@hearty stratus what board are you using ?

hearty stratus
#

trinket m0

marble hornet
#

ah

#

@hearty stratus are you running out of storage or memory?

#

like is the flash drive full?

#

@hearty stratus

#

@slender iron is aref required for internal cir-py stuff or could i give it another name and use it as io ? if i don't connect it to 3v3

slender iron
#

@marble hornet its needed on the m4 since the microcontroller internal ref is currently broken

marble hornet
#

okay, thank you ๐Ÿ™‚ so short to 3v3 ?

slender iron
#

yeah, think so

prime flower
#

quick q - bit of weirdness on the CCS811 library...shouldn't eco2's property (https://github.com/adafruit/Adafruit_CircuitPython_CCS811/blob/master/adafruit_ccs811.py#L161.) also contain a call to _update_data() since it's populated on L146 (https://github.com/adafruit/Adafruit_CircuitPython_CCS811/blob/master/adafruit_ccs811.py#L146)

slender iron
#

@prime flower yup think so

prime flower
#

ok, thanks!

slender iron
#

thank you!

prime flower
#

np!

marble hornet
#

do the tx/rx led pins on the m4 need to be there for cir-py to function? or could they be redefined for io ?

#

thanks for all the help either way!

ruby atlas
#

Man I wish the REPL honoured ctrl-u

#

is there any reason it doesn't?

timber mango
raven canopy
#

@ruby atlas thanks for that; didn't even know it existed. ๐Ÿ˜„ as for why it isn't in circuitpython? dunno. but shouldn't be too hard to implement. might get kind of wonky working with the history though.

ruby atlas
#

ctrl-u just erases what you've typed so far, so it should not affect history.

#

actually, in most implementations, it erases from the cursor to start of line

timber mango
#

That's unix, iirc. gforth leverages libreadline to provide a command line history (I think that's how it does it) but not in a serial terminal. gforth runs on the host PC in an xterm or a regular console terminal.
Big difference.

raven canopy
#

i've only read the history code in passing. not sure when exactly it "takes note" of typed commands. hence the might. heh, i can't even recall which all files/functions its in off the top of my head...

timber mango
#

How many lines are buffered in the history?

#

Ctrl+A and Ctrl+E work as expected.

#

Based on that one observation, Ctrl+U should be somewhat straightforward to implement as a keybinding in the CircuitPython REPL.

ruby atlas
#

same with ctrl-a and ctrl-e

#

๐Ÿ˜ƒ

timber mango
#

.. one ..more ..truffle..โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒ(Brazil)

raven canopy
#

ctrl-e is in there. well, ctrl-e as paste mode is there.

ruby atlas
#

oh ctrl-a is there too

#

i forgot i'm using screen

#

ctrl-a a

raven canopy
#

ctrl-i is on the docket to bring back, as well.

timber mango
#

I use Ctrl+e to jump to EOL and Ctrl+a to jump to beginning of line.

#

Right .. the recommended terminal was (or still is) SCREEN.

raven canopy
#

after like 2 weeks of having it, i'm finally attempting my first build for the Metro M4. and, i'm greeted by a word i least expected...

In file included from ./common-hal/touchio/TouchIn.h:32:0,
                 from ../../shared-bindings/touchio/TouchIn.h:31,
                 from common-hal/touchio/TouchIn.c:34:
freetouch/samd21_ptc_component.h:31:10: fatal error: Arduino.h: No such file or directory
 #include <Arduino.h>
          ^~~~~~~~~~~
compilation terminated.
#

๐Ÿ˜†

timber mango
#

haha arduino.h

raven canopy
#

yeah. skipped a git submodule update after pulling to current master.

timber mango
#

I don't know .. I think I built M4 once already.

#

Usually log builds to disk with /usr/bin/script .. lessee..

#
Wrote 433152 bytes to build-metro_m4_express/firmware.uf2.
 cp bld script $ exit
exit

Script done on Mon 14 May 2018 04:52:15 UTC
Adafruit CircuitPython 3.0.0-alpha.6-73-gce5eae1 on 2018-05-14; Metro M4 Express with samd51j19
faint summit
#

I have some really basic questions about working with circuitpython on my metro board. Where should I ask them?

raven canopy
#

you can go ahead and ask. word of note, though: it tends to slow down around here on the weekends, but people usually read back through once they come back. if you're question(s) doesn't get answered right away, keep checking back.

faint summit
#

Alright thanks!

#

I just set up my board and I'm wondering how I can import external modules such as matplotlib and the likes>

raven canopy
faint summit
#

I see. So how do I know if a particular library is available?

raven canopy
faint summit
#

Thank you! One last question: I was mostly interested in doing some Fourier analysis and I couldn't find any particular ways of doing this so far. Any possible ideas?

raven canopy
#

someone was working through an FFT issue earlier today. if you scroll up (or use the discord search for "fft"), you should be able to find the discussion.

hearty stratus
#

@marble hornet sorry, was away

#

i have very little free mem available

#

also very little storage

#

next question tho, i have two devices i want to run off I2C. How do I assign a different address to, say, my OLED

hearty stratus
#

nevermind. guess i should have kept trying ๐Ÿ˜ƒ

marble hornet
#

did you get it?

#

@hearty stratus

marble hornet
#

does anyone know if the tx/rx led pins on the m4 need to be there for cir-py to function? or could they be redefined for io ?
thanks for all the help either way!

raven canopy
#

@marble hornet i am confident they are not "required". the only usage i can find is in mphalport.c, and each instance is contained inside #ifdef MICROPY_HW_LED_RX or #ifdef MICROPY_HW_LED_TX. So, if you just don't define either of those in board/[_m4_]/mpconfigport.h you should be fine.
mphalport usage: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/mphalport.c#L35

LED defines: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h#L8

marble hornet
#

@raven canopy thank you. the feather m0 express doesn't have them, is that the only files that needs to be edited ?

#

i have another led / firmware question. do you mind?

raven canopy
#

yeah, if you just omit the definitions in mpconfigport, you'll only need to change the pin assignments. no need to change mphalport.c since it will skip using them.

#

go ahead.

marble hornet
#

okay, two.
1 the neopixel on the express boards are rgb, right? but the circuit playground has rgbw neopixles. i would like to use the rgbw on my board. does that need to be set manually.

2 ive looked in the mpconfigport but to no avail. by my eye at least. the other is when you say change the assignment, could i pass none? or do i need to have a pin there

#

@raven canopy thank you so much

raven canopy
#

@marble hornet 1) from what I'm seeing, the CPX has RGB, not RGBW. To change to RGBW, at minimum you'll need to update the neopixel module to facilitate the extra W info, as well as any functions that call the module. I didn't look too far into, so you may have to do a fair bit of reading.

  1. no need to pass none. just don't define the HW_LED parts, and if you aren't going to use the pins at all, remove their definition from boards/nnn/pins.c. the pins are also #ifdefed in samd51_pins.c.
marble hornet
#

ah, now i get what #ifdef means thank you

raven canopy
#

you're welcome! C land is a mystic place... ๐Ÿ˜„

marble hornet
#

hmm

#

i want to look into the cpx board...

#

thanks for all your help

marble hornet
#

@raven canopy thank you. i hope i get to know C well. the brd file for the cpx has ws2812b pixels on it, maybe it is just the same pinout for the housings ? and so does the m4.

#

eh, ill just use rgb then

raven canopy
#

@marble hornet the best that i understand it is that the ws2812b is only a revision update that dropped the pinout from 6 pins to 4, and some other mechanical, etc improvements. the 'b' is not differentiator of RGB vs RGBW.

marble hornet
#

ah

marble hornet
#

@meager fog do you use a ferite inductor on the m4 express?

#

if you don't mind my asking

stuck elbow
#

afaik it's present but not enabled in the firmware

timber mango
#

@hearty stratus i2c address - jumpers. MCP23008 port expander (and similarly: PCF8574) is a case in point: it has three pins dedicated to setting the chip's individual i2c address. http://adafru.it/593

#

The addresses are sent in the data stream (like everything else). It's not like SPI where you need a Chip Select line for each device on the bus.

#

Generally a class of chip will have a unique i2c base address, and will provide a three-bit variation on that address for the individual instances of use.

#

This allows the user to leverage a much larger address space for devices that are quite different from one another, functionally, to share in the same i2c bus, cooperatively.

#

okay yeah @marble hornet @stuck elbow has it right.
RGBW is there (since you aren't at all restricted to the singleton RGB/RGBW LED on the target board).

#

I just did a quick project yesterday where I turned on the onboard NeoPixel (NPX in my personal parlance) .. in one color, and all the others (on an 8x NPX strip) in the 'opposite' a contrasting color. Just for fun.

#

simple program for Metro M4 Express, leveraging external NeoPixel array connected to D12 of the M4X.

#

(delimiters 'please' and 'thank you' implied but unstated, here)
EDIT answered (see below)

timber mango
#
 $ unzip -t adafruit-circuitpython-bundle-2.2.3-mpy-20180525.zip | egrep \.mpy | wc -l
129
 $ unzip -t adafruit-circuitpython-bundle-3.0.0-alpha.2-mpy-20180525.zip | egrep \.mpy | wc -l
129
 $ unzip -t adafruit-circuitpython-bundle-py-20180525.zip | egrep \.mpy | wc -l
0
 $ 
#
 $ unzip -t adafruit-circuitpython-bundle-3.0.0-alpha.2-mpy-20180525.zip | egrep \.mpy | sed 3q
Archive:  adafruit-circuitpython-bundle-3.0.0-alpha.2-mpy-20180525.zip
    testing: lib/adafruit_am2320.mpy   OK
    testing: lib/adafruit_amg88xx.mpy   OK
 $ 
#

The bundle without versioning (just the date) in its name is to be read as 'bundle-py' to indicate it only has .py and not the (usual, required) .mpy files. It's the source (, Luke).

#

This has baffled me for months.

#

Wendy, my head hurts.โ€ƒโ€ƒโ€ƒโ€ƒThe Shining

opaque patrol
#

"The source will be with you.....always"

marble hornet
#

could i run my schematic by someone?

#

for a atsamd51j board ?

timber mango
#

Same program as above (scroll back) with some edits. NeoPixels on D12 and the internal pin (40) for Metro M4 Express (M4X as I call itt).

ruby atlas
#

just as an FYI, not sure it needs an issue filed - the shipped main.py doesn't work on metro m0 express on beta 3.0.0b0 with the May 25th lib bundle. MemoryError: memory allocation failed, allocating 1016 bytes

#

I'm preserving that main.py for future reference.

timber mango
#

Do you have the md5sum of the troublesome version of main.py handy?

ruby atlas
#

MD5 (/Volumes/CIRCUITPY/main.py) = 0b9668b485f38b82a36ef111775edd9f
2.2.0 main.py

timber mango
#

any idea when it was last edited?

ruby atlas
#

Claims Jan 4th. Dunno if that's right.

timber mango
#

Sounds right, I think. I'll see if I have it here somewhere.

ruby atlas
#

I can pop the file someplace. Probably worth filing an issue. BTW, I used this to update: (cd /Volumes/CIRCUITPY; find lib -name \*.mpy) | while read a; do cp $a /Volumes/CIRCUITPY/$a; done; sleep 3; find /Volumes/CIRCUITPY/ -name ._\* | xargs rm

timber mango
#

(it has an embedded F111 haha)

#

I just read your syntax. Nice. I don't use it that way but I think I could.

ruby atlas
#

(cd /Volumes/CIRCUITPY; find lib -name \*.mpy) | while read a; do cp -v $a /Volumes/CIRCUITPY/$a; done; sleep 3; find /Volumes/CIRCUITPY -name ._\* | xargs rm -v is probably more user friendly.

timber mango
#

I have a scattered use of my human short term memory so an embedded 'read' there would kill me. Still very useful to know on the occasion where things are highly repetitive and some interactive input is desired.

#
 $ (cd ; find . -name \mai*.py) | while read a; do ls -la $a; done
#

This didn't do what I thought it did. I can do this. ;)

ruby atlas
#
(cd /Volumes/CIRCUITPY; find lib -name \*.mpy) | xargs -tn 1 -I {} cp -v {} /Volumes/CIRCUITPY/{};  sleep 3; find /Volumes/CIRCUITPY/ -name ._\* -exec  rm -v {} \;
#

cleaner version

#

there's like a dozen ways to do this ๐Ÿ˜ƒ

timber mango
#

booyah. I don't have a replacement for the actual utterance I use for this. ;)

#

I had zero clue that read could be used in this way. find has always baffled me

#

so anyway I can't find a copy of your main.py with such an md5sum.

ruby atlas
#

I'll go post an issue.

timber mango
#

I probably have that exact file but can't lay my hands on it.

ruby atlas
timber mango
#

I want to see what it does. ;)

#

seems to me that as long as it ships with a working main.py it's 'finished bizz' -- when they upgrade they can worry about why it no longer works, separately. ;)

#

I bet dollars to donuts that one of the last things they do is make sure that main.py operates in the current context ('as shipped').

#

The issue helps the advanced newcomer (&c.) to identify and correct the error for their personal use, quickly, and to document its existence.

manic glacierBOT
#

MemoryError: memory allocation failed, allocating 1016 bytes

After using the attached updater to update the existing libs to the May 25th bundle, I get a memory error.

Adafruit CircuitPython 3.0.0-beta.0-22-g754c36bb3 on 2018-05-26; Adafruit Metro M0 Express with samd21g18
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 14, in <module>
  File "adafr...
timber mango
#

The problem is for that newcomer to go down that path where they end up at the issue, read it, and learn what needs doing.

ruby atlas
#

Filing the issue also helps make sure main.py is compatible by the time 3.0.0 RC is out ๐Ÿ˜ƒ

timber mango
#

Well those guys know what they're doing and better yet remember what they did, recently. Youth!

#

I have to not do lots of things like leave the stove ON at two in the morning and LEAVE that room (kitchen) for any reason at all. every time.

#

I've found one too many pots boiled dry that way.

I just wanted a cup of tea. Is that so wrong?

ruby atlas
#

Why not add a temperature probe above the stove that has alerts you if it's left on >30 minutes after a certain time or >1h the rest f the time

timber mango
#

So. There are .WAV files in that version of the firmware, resident in flashROM filesystem.

#

Roy, every automation usually requires human input. ;)

#

โค

digression - skip and avoid the following many lines of digression, led by me.

๐Ÿ”น ๐Ÿ”น ๐Ÿ”น

If you're not all that old yet you'll get to see this first-hand, someday.

#

โคโ€ƒโ€ƒโ€ƒMy brother remembers very little from years back; it's at the point where he's convinced things that happened only to him happened only to me, because I remember their stories and retell them.

He keeps asking if it was him or me that the story happened to.

ruby atlas
#

yep. or it works poorly.

#

i have a lot of automation around the house that only half works.

#

or works half the time

timber mango
#

I'm at about 72 percent on using the Android alarm clock effectively.

ruby atlas
#

(mostly the stuff using zigbee and zwave are buggy, wifi stuff is more reliable)

timber mango
#

Many times it goes off when I'm in the shower or otherwise unavailable to shut it off.

ruby atlas
#

my watch helps me solve the alarm going off in the shower.

#

since i can shut the phone's alarm up with the watch

timber mango
#

๐Ÿ”น ๐Ÿ”น
โคโ€ƒโ€ƒโ€ƒI have all my (several) android alarms set to dead-man's switch off after about 2 minutes.

#

Surprisingly, I rarely miss one the first time it goes off.

#

โคโ€ƒโ€ƒIn the Air Force someone's wrist watch alarm went off while we were at Parade Rest (standing perfectly still and unable to move without a breach of protocol).
โคโ€ƒโ€ƒLike, 1982 or so. ;)
โคโ€ƒโ€ƒI don't think mine ever did that, but at the base theatre, near (but not 'on') the hour, lots of watches would beep during the movie.

#

Mine of course beeped exactly on the hour (and was the only one that did, by a long shot).
โ€ƒโ€ƒI used WWV broadcasts every week to reset it to the correct time.

#

Sorry this isn't the chatroom. it's #circuitpython-dev haha -- my bad!

/digression
๐Ÿ”น ๐Ÿ”น ๐Ÿ”น

ruby atlas
#

:).

meager fog
#

yay it was a quiet day and i finished my arcade wing prototype

#

@ruby lake sekretly its also a porta-synth with a touchscreen interface

ruby atlas
#

Mostly quiet here too, but I did much less awesome work. ๐Ÿ˜ƒ

#

(Also discovered the angel-heart-kitty on the Metro M4 Express)

#

@meager fog how much big a speaker? ๐Ÿ˜ƒ Cool looking wing. Does it pair with the TFT FeatherWing?

manic glacierBOT
ruby atlas
#

Hmmm... I wonder if there's a way to rename the volume name from CIRCUITPY to help make it less confusing when I have... uh.. 6 devices... connected ๐Ÿ˜ƒ

meager fog
#

@ruby atlas its a 'superset' of the TFT featherwing, you can still use any 2.4" featherwing code but now has xtraz

#

@tough flax i added an AT hacking port!

#

its at the bottom, you can externally trigger buttons - a great idea ๐Ÿ˜ƒ

ruby atlas
#

It's become obvious with the bigger strips or arrays that my first step is going to need to be making tuple to byte structure performance good.

spare storm
#

How less efficient with memory is CircuitPython than coding with Arduino? I'm getting mem allocation errors when I'm only half-way done converting my bot's original Arduino code to CP.

ruby atlas
#

Pack probably significantly. Have you tried putting some code into libraries and using mpy-cross?

#

That can reduce the startup overhead. Are your memory errors during runtime, or during compiling?

spare storm
#

I was actually thinking about that. Got them during compiling to the CPE+CRICKIT

ruby atlas
#

I'd give mpy-cross a whirl. Does your code need much operating memory for variables?

spare storm
#

I have about a dozen static variables just to make coding the servo positions easier. My code is mostly just hundreds of alternating time.sleep and var.angle lines.

ruby atlas
#

You might find it easier to encode that as data and loop over it than to deal with mpy-cross

spare storm
#

Hmm, the problem is the servo movement is timed to audio for mouth, head, eye movement. Each conversation has different timing and movement positions.

ruby atlas
#

I don't know what the args to var.angle look like, but you might find a structure like:

steps = ((2.23, "var.angle args"),
         (1.33, "second step args"),
        )

for wait, var_args in steps:
    time.sleep(wait)
    var.angle(var_args)
#

the above approach should result in much more compact bytecode

#

(doesn't mean it will, but theoretically it would)

#

but it would also let you move the step data out into an mpy to free space if needed.
the tuples can contain more data than just 2 items. it's just an example.

spare storm
#

Basically, it looks like this, where hs and ms are my servos and the variable at the end is the servo angle.

#

if ss.digital_read(RF2):
time.sleep(.59)
hs.angle = hr
time.sleep(.3)
ss.digital_write(SB1, False)
ms.angle = mh
time.sleep(.31)
ms.angle = mc
ss.digital_write(SB1, True)
time.sleep(.15)
ms.angle = mp
time.sleep(.15)
ms.angle = mh
time.sleep(.5)
ms.angle = mc
time.sleep(.1)

#

That's just a small part of one 32sec conversation that takes up about 260 lines... and each bot has 4 conversations stored.

#

I'll try that, though, thanks!

ruby atlas
#

Once you figure out a good way to encode those conversations as data, you'll probably also find them easier to maintain ๐Ÿ˜ƒ

spare storm
#

While I try to figure out how to restructure these and see if that works, is there a way to go back to using Arduino on the Crickit for now? I just tried and I keep getting "avrdude: butterfly_recv(): programmer is not responding" right after CPLAYBOOT mounts while uploading.

tough flax
#

@meager fog perfect! Thatโ€™s exactly what I had in mind!

fading solstice
#

@slender iron @tulip sleet @meager fog I am excited about the Metro M4. I tried to do a Word Clock with a Feather M0 this year and quickly ran out of memory. As a result I converted all my CircuitPython code to Arduino C and then was able to add lots of demo screens. Once I got the Metro M4, I convert the C code back into CircuitPython. I am happy to say, that I still have memory left over. Yeah!. I wished I had the M4 to begin with. Thanks for all your hard work. I look forward to a Feather M4 someday.

slender iron
#

I'm glad its working well for you @fading solstice !

raven canopy
#

kicks self after looking at oddly set register vs expected set register so many times, to FINALLY realize that was causing the problem the whole time ๐Ÿคฆ

manic glacierBOT
#

I don't know if this is by (unfortunate) design or not, but time.monotonic() slows down under pressure.

I run a script to measure RTC accuracy and it slows down the monotonic clock.

This snippet is run on the board through the REPL to give me the moment that the second ticks over:

import time

lt1 = time.localtime()
lt2 = lt1
i = 0
while lt1.tm_sec == lt2.tm_sec:
    lt2 = time.localtime()
    i += 1
m = time.monotonic()
print("%%s:%%.6f:%%d" %% ( str(tuple(lt2)), m...
manic glacierBOT
manic glacierBOT
ruby atlas
#

Google isn't helping me with this one... Are there any circuitpython profiling guides?

tulip sleet
#

profiling the Python code or the C code?

ruby atlas
#

Yes! ๐Ÿ˜ƒ

tulip sleet
#

you can call time.monotonic() and print out elapsed times ๐Ÿ˜ƒ

ruby atlas
#

I have the Jlink gdb setup working as of last night... But didn't go down the path of the Atmel Studio on Windows.

#

heh, yeah, i was afraid of that.

#

led-debugging, print-profiling ๐Ÿ˜ƒ All fun.

idle owl
#

You can also do it with a Saleae, if you're talking about what I think you're talking about.

#

Though I know that doesn't help you right now

ruby atlas
#

Right now I just want to know what to focus on first when fixing performance of Neopixel and/or Dotstar tuple-to-binary conversion.

#

If it's even a problem.

#

(I'm sure it is)

tulip sleet
#

I sped up the dotstar library a few days ago

#

for fill()

ruby atlas
#

I was looking at the code yesterday, so I probably saw that. But I'll check again.

tulip sleet
#

I haven't had a chance to do the same with NeoPixel yet.

ruby atlas
#

Neopixel also has the C helper.

#

But yeah, there's lots of optimizations we can do to the python code, even before we start adding more helpers in C.

tulip sleet
#

The C helper exists mostly just to get the timing right. Yes, I think there are things that could be done to the Python code to speed it up, such as pre-fetching indices, not generating garbage, etc. The enumerate to range change made a big difference.

idle owl
#

Any idea how to use the optional interrupt pin on the JoyWing Featherwing? I assume it's an interrupt for the built-in seesaw, and therefore uses the seesaw lib. There are two instances of int in there, one of which is a commented out section. The guide says you can use it so you're not polling the buttons constantly, but I have no idea how to use it, as I've only ever used an interrupt pin on the LIS3DH.

#

There's no example code that uses the interrupt pin for CircuitPython.

tulip sleet
#

not sure that pin will help with CPy, since it's just an indication that some button has been pushed. We'd still have to poll for that pin, since we don't have interrupts.

idle owl
#

Hmm. Ok.

#

Would it get me away from having to use const though?

tulip sleet
#

in that example buttons = ss.digital_read_bulk(button_mask) sets a bitmask. If there are no buttons pressed buttons will be zero, so that's a quick check for any activity.

idle owl
#

The code I'm actually using has a bunch of functions in it (I stripped it from the Joy Featherwing library I wrote, not using it with a Feather, so I can't simply use that helper lib I wrote) that cleans up the core of the code, but it still has the const stuff in the helper functions.

tulip sleet
#

you mean like the BUTTON_RIGHT = const(6) consts?

idle owl
#

Yeah.

#

But it's the same thing just rearranged into helper functions.

tulip sleet
#

why don't you want the consts?

idle owl
#

To make the code seem less like a driver, I guess.

tulip sleet
#

would you rather get back a tuple of pressed buttons?

idle owl
#

Not for any technical reason

tulip sleet
#

you still have to identify all the buttons, and know which bit in the bitmask corresponds to which button

idle owl
#

If this code is as simple as it's going to get for what it does, then I'm fine with it. It seemed like it was somehow more complicated than it should be. But I don't understand the board well enough to know that's true or not.

#

Ah

#

Ok I'll stick with the altered version of the helper lib I wrote.

#

It at least makes the code bit simpler.

#

Actually I just realised the FeatherWing library works as is.

#

So as long as I don't run into memory issues, my code will be super simple looking.

#

@tulip sleet Thanks for the help. I would have spent useless time on that trying to figure it out.

#

I assumed because we used int on LIS3DH that it would work the same way. It does not.

ruby atlas
#

After some testing yesterday, moving the majority of neopixel.py _setitem() to C speeds it up ~5x. (on top of the speed gain from using range() instead of enumerate() in fill(). I haven't even optimized that any - lots of arg passing in the test implementation. (I pushed my prototype code to my forks for now)

raven canopy
#

i'm starting to think that there is some undocumented errata on SAMD51 TC capture on pin... or my comprehension is that much less than i admit even to myself. ๐Ÿ˜„

idle owl
#

@raven canopy There's always undocumented errata. ๐Ÿ˜„

ruby atlas
#

I wonder if any project (or book, etc.) ever converges on 0% undocumented errata.

earnest willow
#

Its a feature, not a bug

raven canopy
#

all valid points! ๐Ÿ˜„

stuck elbow
#

@ruby atlas "The Art of Computer Programming" gets close

earnest willow
#

@ruby atlas y I know one book that fits: A Million Random Digits with 100,000 Normal Deviates

ruby atlas
#

hah

manic glacierBOT
raven canopy
#

@slender iron you got a moment for a M4 question?

slender iron
#

sure

raven canopy
#

i'm seeing weirdness wrt setting a TC up for capture on pin. Working with pin D11 (PA19), which is mapped to TC3, WO1. When setting CAPTEN1, CAPOEN1, and INTENSET.MC1 i am immediately getting INTFLAG.MC0. If i then enable INTENSET.MC0, i get stuck in a loop with nothing coming in on the pin.

I can't find any errata on the subject, and am currently looking at the "IOSET" remarks. Do we deal with that at all?

slender iron
#

I haven't played around with capture at all

#

why are you using the approach of measuring a single period?

raven canopy
#

missed clarification on my part: IOSET config is with the PINMUX....

#

why single period? less overhead is the biggest reason, i guess. I could easily pivot to a buffered array. but it's proven quite accurate as a single read.

slender iron
#

I was thinking you'd use the event to increment the counter and then use ticks to know how long it too to count a set number of cycles

#

then you have one interrupt after the count is reached

#

it'd only be bad for very low frequency signals

raven canopy
#

like i said before, TC capture already does that in my understanding. it dumps the count period out.

#

yeah, Dan and i discussed that. it definitely doesn't like 1Hz...

slender iron
#

the count is driven by the GCLK

#

I'm suggesting driving it by the input signal/event

marble hornet
#

hey all! happy car discount day.... i mean memorial day.

slender iron
#

why would we need to measure 1hz? power will be 120 and the light sensor is in khz

marble hornet
#

is openocd used to upload to the atsamd51?

#

if you don't mind my interjection

slender iron
#

we use JLink. not sure if openocd supports it yet

marble hornet
#

what program ?

slender iron
#

jlink comes with software too

marble hornet
#

i have an edu model that ive used with adalink. but you can upload without another program form segger?

slender iron
#

you should be able to use the jlink software with the edu model

#

@raven canopy I'm happy to voice chat about this if you like

raven canopy
#

use case for 1Hz is definitely small (i'm not too concerned with it). 8KHz is where my current tests start and runs above 1MHz.

And no real need to chat, just yet. I'll probably just abandon the direct pin capture on TC, and use the EIC/EVSYS same as M0. That's already written, so it's not that time consuming. ๐Ÿ˜„

marble hornet
#

thank you @slender iron

#

am i looking for "J-Link Software and Documentation Pack" ?

slender iron
#

@raven canopy EIC to cpu interrupt? that will have the same frequency limitations

raven canopy
#

was just curious if the IOSET config may be causing the weird stuff i'm seeing. the datasheet mentions it once, and doesn't explain it very well. :go_figure:

slender iron
#

I don't know what IOSET is

raven canopy
#

sweet. i'm not alone! ๐Ÿ˜†

marble hornet
#

does anyone have experience installing gdbserver on mac ? i'm running high sierra 10.13.4 OR any other way of uploading firmware to a factory fresh atsamd51

#

any help is MUCH appreciated

manic glacierBOT
idle owl
#

@slender iron Do we want to add consider-using-enumerate to the pylintrc disable? (it suggests consider using enumerate for iteration instead of len and range)

slender iron
#

either way is fine with me

#

@marble hornet I use it on mac and just installed it off of their site

manic glacierBOT
#

What do you think the problem is? I don't think its a matter of monotonic being incorrect but rather how quickly the loop runs. The slower each iteration runs, the coarser the time it takes to find the seconds boundary.

Monotonic is driven by an internal interrupt based on the SysTick timer. The only way I'd expect it to lose time is if interrupts are disabled for more than a millisecond.

marble hornet
#

@slender iron Where did you find the link? The file I found was. Gz.

slender iron
#

Jlink software and doc package -> click for downloads. then it shows a list of OS versions

#

k, I'm off. night all. talk with you all tomorrow

raven canopy
#

๐Ÿ‘‹

slender iron
#

<@&356864093652516868> Don't forget the meeting is tomorrow here on Discord. 11am Pacific / 2 pm Eastern

idle owl
#

night @slender iron

marble hornet
#

Sleep well @slender iron

idle owl
#

@ruby atlas So the question is about range(len(value)). As it stands, pylint complains about it saying "Consider using enumerate instead of iterating with range and len". I can add it to our pylintrc disable command and disable the check if we think that it should be allowed

ruby atlas
#

i personally think we should allow range(...) over enumerate() due to the large performance difference.

idle owl
#

I think it's a valid way to do things and I think it can be more readable at times which is a consideration for learn guide code.

ruby atlas
#

but i guess it's context dependent - if it's not a tight loop or there's a lot of time in time.sleep() after such a loop, it may not matter.

idle owl
#

I think if people are running into speed issues, they can research it and learn about enumerate from that angle instead of being forced to consider it every time.

ruby atlas
#

do we have an optimizing CP code page?

idle owl
#

Not yet, though it's been discussed

#

Ok I added it to the disable. Thanks for the input ๐Ÿ˜ƒ

ruby atlas
#

It's not like it's hard to revert that if others disagree ๐Ÿ˜ƒ

#

(yay version control!)

hearty stratus
#

can anyone explain to me what 'frambuf' module does ?

#

im using an OLED with a trinket m0 but even without it, i dont seem to need to import it for it to work

#

the guide says to get it but not sure why.

cunning crypt
#

@hearty stratus I've done some poking around in the CP repo, and it looks like Framebuf may have been re-implemented. @slender iron would know for certain.

hearty stratus
#

i see

#

happen to know how to update an OLED any faster?

#

or is it always just painfully slow?

#

i have a pressure sensor and when put the readout in a while loop it's very speedy in console. as soon as i display the results on OLED its only ~1sec per loop

cunning crypt
#

I've never used an OLED, so I'm not familiar.

hearty stratus
#

no worries ๐Ÿ˜ƒ somebody else might know

stuck elbow
#

do you know if it's the update that is slow, or the drawing of the text on it?

#

also, which board are you using?

manic glacierBOT
manic glacierBOT
#

The thing is, monotonic should always have elapsed one second or more, never (much) less. I'm using monotonic to measure the time it takes for one second to elapse on the RTC.

I have now run the same test on a Metro M4 Express, and it doesn't show the same problem.
This is with no sleeping in the loop: +700 loop iterations and ~1.0 second elapsed on monotonic:

+0.005894 secs / 0.000025 days = +234.605899 secs/day (+2715.35 ppm) : 29 May 2018 00:00:02 (56083.937 - 56082.935 = 1.001) ...
tulip sleet
#

@ruby atlas @idle owl I think pylint is off-base or thinks that for loops usually use the value. enumerate() instead of range() only makes sense if you're actually fetching the values:

for i, v in enumerate(l):
    print(i,v)

instead of

for i in range(len(l)):
    print(i,l[i])

But if you're not using the value, it's a total waste of time:

for i, _ in enumerate(l):      # pointlessly fetching the values
    l[i] = i*2   # or something like that
#

@hearty stratus framebuf is turned on in the Express builds (separate SPI flash chip), but not small builds like Trinket M0. Writing text is slow without framebuf because it's writing the character bitmaps out a pixel at a time with Python code.

granite vapor
#

Hey everyone, quick question. Is the module '''ntptime''' supposed to work in CircuitPython? Importing the module in v3 crashes my ESP8266 feather and the module isn't functional in v2 because CircuitPython doesn't support utime. Thanks!

manic glacierBOT
fading solstice
#

@prime flower did you pick up the issue #622 for sgp30?

manic glacierBOT
prime flower
#

@fading solstice working on it rn, testing on hardware either later today (unlikely, I just got back to HQ this morning) or tomorrow AM.

#

..speaking of which I'm going to request a SPG30 rn

tulip sleet
#

@granite vapor not explicitly supported. You could try import time as utime in v2 but it may not provide the functionality you want. When you say "crash" do you mean an error (visible in REPL) or hard crash?

manic glacierBOT
#

The script might be a bit convoluted since it has evolved over time without getting a cleanup.
Basically what it does is:

  • Set the RTC to the same time as the Raspberry Pi
  • Wait for the RTC to tick a new second, report/print the struct_time tuple, the monotic value and the number of iterations
  • Print the diff between the clock on the Pi and the board, print the diff between the current monotonic and the previous one

There is some dump code in here that I've used when only checking t...

granite vapor
#

@tulip sleet On a freshly-flashed ESP8266 feather with the latest beta of circuitpython, the python statement import ntptime causes a bunch of gibberish to be printed to the REPL and then a restart occurs. The interesting thing in V2 is that ntptime.time() successfully pulls the time from the server, but the settime() function generates the ImportError.

manic glacierBOT
manic glacierBOT
tulip sleet
manic glacierBOT
#

Adafruit CircuitPython 3.0.0-beta.0 on 2018-05-23; Adafruit CircuitPlayground Express with samd21g18

Using the most recent 3.0 comparable libs.

Tried running the Adafruit Sound Meter demo which resulted in the following error:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
File "main.py", line 68,...

cunning crypt
#

@slender iron ~30 minutes to weekly meeting, right?

slender iron
#

yup!

cunning crypt
#

Excellent.

timber mango
#

And on that note .. ๐ŸŽต

manic glacierBOT
wraith tiger
#

By the way, does the raw repl from micropython exist in circuit python?

manic glacierBOT
cunning crypt
#

If it does, it should be called a raw-pl

slender iron
#

@wraith tiger yeah, we haven't removed it

#

we don't use it often though

wraith tiger
#

I was wondering if there something like bitio could work with circuitpython. Bitio depends on raw repl.

#

IT would need a new name, I guess. Circio?

slender iron
#

I don't know what it is

wraith tiger
#

That kinda sounds like some anciaent Roman.

fluid helm
#

Yay! It's circuitpython meetup time!

#

nearly

wraith tiger
#

Bitio works with the microbit.

#

It create a library wrapper for micropython functions.

fluid helm
#

That should work @wraith tiger could be something that could be looked into

wraith tiger
#

IT allows micropython code to run on the computer, but passes off the microbit specific function call to the microbit via usb serial to the raw repl.

fluid helm
#

Hey @slender iron !

#

nope!

#

i have a working mic

#

for once

wraith tiger
#

I'm text only today.

slender iron
#

<@&356864093652516868> meeting in two minutes!

fluid helm
#

My mechanical keyboard normally annoys people

prime flower
#

@fluid helm you can in settings make it push-to-talk so the mic isn't constantly on

ruby atlas
#

Sorry, I won't make today's meeting.

wraith tiger
#

Yeah, the desk sounds were the main culprit.

prime flower
#

settings -> voice and video -> push-to-talk

idle owl
#

@prime flower Then we forget to push.

#

@ruby atlas Thanks for letting us know!

prime flower
#

blinka-powered usb-hid discord button?

fluid helm
#

my inbuilt mic has broke

#

so i got a n external one

#

so working now

cunning crypt
#

I have given great monologues, heard by nobody because I wasn't pressing the button.

fluid helm
#

i always forget to push too

manic glacierBOT
#

Hello!

On the most recent version of CircuitPython (3.0 beta), the statement import ntptime crashes a freshly-flashed Adafruit ESP8266 feather. A bunch of gibberish gets printed to the REPL and then the device restarts.

On a related note, the V2 ntptime module doesn't work either. ntptime.time() correctly pulls the time from the time server, but ntptime.settime() does not properly set the rtc module, failing at an ImportError (no module named utime in CircuitPython).
...

prime flower
#

(prob not going to catch this meeting, have another one that conflicts, but I'll try to come on. if not - next week forssure)

plucky flint
#

hugs to all

prime flower
#

๐Ÿค—

idle owl
#

@plucky flint Thanks!

plucky flint
#

-> dad taxi stuff ;-)

idle owl
#

@plucky flint I hope you're suitably dad-unfashionable while taxiing ๐Ÿ˜‰

plucky flint
#

sandals... 'nuff said

#

ciao ciao

fluid helm
#

It's pretty hot in the UK right now

#

well part of it anyway

raven canopy
#

Sorry I'm late. Day job meetings are not as fun...

cunning crypt
#

Are they not meeting your requirements for enjoyment?

idle owl
#

Dylan

#

๐Ÿ˜Š

cunning crypt
#

Hug Report: Customary group hug to all. Keep up the good work. Haven't really been keeping track lately, though

errant grail
#

Group hug to the 3.0 team. Continuing to test older projects with the beta version and liking what I see.
Hug for Tony Dโ€™s historical CPy work on the OLED wing and UART code, and to the folks who improved busio. Thanks!

stuck elbow
#

I can't unmute :(

#

Thanks to Scott and Dan for helping me with gamepad

wraith tiger
#

Yay for Perl.

errant grail
#

@raven canopy Yes, a great guide!

timber mango
#

To @tulip sleet for stepping in and providing more pertinent information to someone where I was more off on a peripheral aspect of what they were trying to do. I don't remember the specifics, just that I was glad Dan was there and more on target. ;)

wraith tiger
#

General kudos to all.

raven canopy
#

@oDavid, @brentr, @kattni, and @Mike Barela for reviews, insight, and moderation on the Atmel Studio guide. Group-hug-orama for continuous support here and on the forums!

timber mango
cunning crypt
#

Status update: Last week I was in Seattle, and met up with @slender iron - Much tech was talked, and I now own a Game Boy. I'm also planning on (eventually) making my DigiBadges CP-powered, but that's far-future stuff.

#

That game store was awesome

errant grail
#

A week of โ€œFun with MIDI Synthesizersโ€ trying to figure out exactly what my MIDI controller keyboard was sending โ€“ and why. Had to dive more deeply into the MIDI protocol than ever before. Created a sniffer with CPy that used a custom MIDI interface Wing PCB to feed the UART pins on a Feather M0 Express. Implementing the MIDI protocol stack in CPy with verbose descriptions was a memory hog, but eventually was able to get the sniffer to fit on a Trinket M0. CPy was sufficiently responsive to a 31.25K baud data stream and didnโ€™t drop a byte -- once I figured out what I was doing. Sniffer code is here: https://github.com/CedarGroveStudios/MIDI_FeatherWing
My Trinket-sized modular stackable interface PCBs should arrive later this week. The plan is to use the โ€œRoverโ€ boards to build some musical synthesizer projects, upgrade the StringCar to manage LiPo battery power, and significantly reduce the StringCar controller footprint. Hoping that Adafruit gets the Hot Air Rework Station back in stock this week so that I wonโ€™t have to place an order with that faceless Amazon monster. ๐Ÿ˜‰

idle owl
#

Impressive

stuck elbow
#

I fixed most issues with ยตGame in CP 3.0 (pull request in review). The last problem still left is the new memory requirement of AudioIO, which makes the existing games not run anymore due to MemoryError. Next, I will try to optimize the ยตGame firmware a bit in terms of free memory and speed โ€” remove any unused modules and options, play with linker settings, make SPI transfers non-blocking, etc. The ยตGame Turbo (with SAMD51) is now cancelled so I will have more time for software. I also tested the CircuitPython Badge at the Hackaday Belgrade conference, and I'm very happy with how it works โ€” both the visibility of the display and the power consumption of the whole thing (lasted 3 days on 3ร—AAA alkaline batteries).

#

In part โ€” basically I can't make it any better than Lady Ada will :)

fluid helm
idle owl
#

That's great, @fluid helm!

fluid helm
#

Will do!

timber mango
#

โคโ€ƒโ€ƒPulled into the rabbit hole of writing firmware for the new Crickit (CPX variant) board.
โ€ƒโ€ƒHave an operational Forth interpreter for the Crickit.
โ€ƒโ€ƒBase is ItsyBitsyM0 Arduino; CPX, Trinket M0 and ItsyBitsyM0 can all be used as a base for this board.
โ€ƒโ€ƒThis is of course off-label use of a Crickit; it bypasses the need for a bolt-on CPX for certain low-demand applications.
โ€ƒโ€ƒAlso built the canonical firmware for Crickit, and loaded it without difficulty.
โ€ƒโ€ƒNOTE: The 3-terminal NeoPixel connector on the Crickit does not require any new software -- it is a passthrough connection and does not operate via i2c. That was in the Guide but is easy to miss.
โ€ƒโ€ƒCircuitPython use of Crickit seems easy and intuitive - I expect a short learning curve for newcomers, once the basic concepts are understood.

wraith tiger
#

Nothing to report yet as far as progress, hopefully more next week.
I'm thinking that I may mess with a python vim plugin as an intermediate step, attempting to interact with the microbit via uflash and microFS (and maybe bitio) before messing with the thonny code.

errant grail
#

@timber mango I'm impressed with your rabbit hole travels.

raven canopy
#

Atmel Studio guide is published. Ran a couple more iterations of trying to use the "Project from Makefile"; still hitting toolchain hiccups. Won't be giving it too much attention.

High Frequency PulseIn: SAMD51 TC capture direct from pin isn't going well. Might just use the same method as SAMD21 (events trigger the TC interrupt). After that, I'll tighten up the documentation and push a PR to get it reviewed by professionals: ๐Ÿ˜„ I still need to research porting to other chipsets, and/or stub them.

ESP8266 GPIO12 .configure: should be a straight forward fix. Just need to carve out some time.

timber mango
#

YAFFA-ARM - Yet Another Forth for Arduino. My port of it in this tree (URL provided points to a local copy of the upstream source):
https://github.com/wa1tnr/ainsuForth-gen-exp/tree/master/0-Distribution.d
Runs unmodified on Crickit via the programmer's USB port!
To use: connect as with the REPL and type the ENTER key once. A >> prompt appears. Then (optionally) type words to get a list of the forth vocabulary this software knows about.

raven canopy
#

Yeah, doesn't fit this case that I saw though... I'll look again.

idle owl
stuck elbow
#

I'd like to talk about the AudioIO buffer, if possible. Would it make sense for me to send a pull request that lets it use a pre-allocated buffer?

errant grail
#

Q: any plans to improve text handling for the OLED wing? (and TFT wings?)

fluid helm
#

I have a topic discussion, what are the next steps to get CircuitPython more exposure in the classroom. Are there plans to have classroom dedicated resources for teachers?

stuck elbow
#

it's a 512 byte buffer allocated on .play

#

I will file an issue

cunning crypt
#

Alright everyone, I've got some things that need doing. I'm going to hop out and get working on them. Enjoy!

idle owl
#

Thanks @cunning crypt!

errant grail
#

... and slow.

#

Excellent. Thanks!

raven canopy
#

Haha. I was about to type ":sniff: D :sniff: MA"...

fluid helm
#

Cool, thanks for the answer ๐Ÿ™‚

raven canopy
#

@fluid helm I have had the same question before. One reason we created the #classroom channel as a discussion resource.

fluid helm
#

oh I missed that

#

thanks!

timber mango
#

rotary encoders are huge and I'd like to see them become as common as potentiometers

wraith tiger
#

pound sign a.k.a. hash a.k.a. hashtag a.k.a. octothorpe...

errant grail
#

An I2C rotary encoder breakout would be useful.

fluid helm
#

I'm working on my first learn guide. a micro:bit EduBlocks light up house with neopixel rings

idle owl
#

Brilliant!

fluid helm
#

Also microbit magazine

#

hopefully out this week

#

has micropython stuff there

raven canopy
#

Thanks everyone! Fantabulous day, to you all! ๐Ÿ‘‹

fluid helm
#

Ha

#

Yep, you mentioned it to me

errant grail
#

Great meeting today. Thanks all! Time to get back to fretting MIDI sniffer -- OLED display details.

fluid helm
#

I better go too and sort CircuitPlayground stuff out for tomorrow, thanks guys ๐Ÿ˜„

stuck elbow
#

thanks, bye

raven canopy
#

Good luck, and have fun @fluid helm!

#

Alright. I'm off too. Gotta pay more bills... ๐Ÿ˜„

timber mango
#

I learned a lot about how target board designers select port pins to offer to the end-user by trying to port the Crickit over to Arduino. The comparative study between the D21 variants Adafruit makes, was instructive.

fluid helm
#

What time is it in the US? @slender iron

timber mango
#

14:51 NYC he's Seattle area so he's 11:51 a.m. PDT

idle owl
#

Nearly 3pm on the East Coast

fluid helm
#

Nearly 8pm here, and it's still boiling

idle owl
#

It's been inordinately warm here as well.

timber mango
#

30ยฐC here 86ยฐF .. TD (dew point) 18ยฐC 65ยฐF near New York City (Northwest Connecticut 73W 41N)

#

I didn't take much mathematics in high school .. and later in life most of what I'm interested requires a much higher level understanding of math than I have.

fluid helm
#

anyone help on this?

#

dunno if this is pythn related

timber mango
#

They may not know about our Discord.

#

I tend to just help them discover the answer, interactively; the odds of matching a person who knows the specific problem with the asker are low at any given moment (so forums can help there, if you have time and patience to wait for a reply).

#

A lot of times the asker wanted a much simpler answer than the answerer has supposed. ;)

wraith tiger
timber mango
#

I'd prefer a storyboard I can scan with my eyes in about 3 minutes. ;) Haha

wraith tiger
#

@fluid helm implemented bitio in EduBlocks.

fluid helm
#

Indeed I have

wraith tiger
#

3:05 pm here on the east coast (NJ).

#

The thermometer I have outside the window says 96F, but the sun in shining on it so it's reading higher than the air temp.

manic glacierBOT
#

this page is a little barebones :)
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/circuitpython-code

@kattni please copy over the side2side elements and pix from
https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart

into the crickit BUT KEEP THE SPECIAL UF2! no new screenshots are needed, we'll have the same pix/animations, just a different UF2.

timber mango
timber mango
#

>> 1 13 pinMode 1 13 pinWrite 500 delay 0 13 pinWrite

Sets up D13 as OUTPUT, writes a logic 1 to that pin, delays 500 ms, and writes logic 0 to the pin.
In one line, it sets up a port pin, and toggles it on, briefly, in OUTPUT mode. This will flash an attached LED to that port pin.

#

Generally if you connect an LED thru a 1k resistor to SERVO1 of the Crickit, and try to blink an LED on D13, it will blink (SERVO1 is mapped to D13 on at least two Adafruit M0 target boards, including the ItsyBitsyM0).

#

Same utterance, in YAFFA-ARM, when compiled against ItsyBitsyM0 (D37 is the onboard LED):

1 37 pinMode 1 37 pinWrite 500 delay 0 37 pinWrite

#

Now (using pin 37) you don't need an LED on SERVO1 -- you can access the internal (yellow) LED directly!

#

'bad' target boards in Arduino IDE won't allow an USB upload without entering the blinking mode of the bootloader; whereas 'good' ones will allow a regular upload via Arduino IDE (which is calling bossac at the right moment).

#

CPX was the first 'good' one I found; then Trinket M0, then ItsyBitsyM0. I think 'Feather' (all tried variants) failed -- I don't remember.

umbral dagger
#

One thing on my list is to look into separating circuitpython runtime from the flash/usb infrastructure. Then put a Scheme runtime in.

timber mango
#

w00t.

#

I would definitely like to try it when you get it going, if you end up doing so.

umbral dagger
#

Same thing could be done with a Forth runtime

#

Itโ€™s on my list... itโ€™s a long list.

stuck elbow
#

I stopped making lists

#

just work on whatever seems fun at the moment

timber mango
#

I have like zero follow-through on anything anymore. It's why I dislike stopping halfway, due to exhaustion, hunger, social needs.

#

I tend to Ahab it to the bitter end, then go to bed.

#

It wouldn't let me cite Melville. ;)

#

'Moby Richard' doesn't have the same ring to it.

slender iron
timber mango
#

Notes with time codes are available here << first time I have used this facility -- great! @slender iron

idle owl
#

Now we have to make sure people aren't merging failing code.

slender iron
#

we can actually set the merge button to require it I think

#

its a pretty big stick though

idle owl
#

Hmm. Perhaps. But it would otherwise mean me doing this every couple of days to keep up. And we also have people who aren't using PRs. So it wouldn't fail for them, it would fail for the next person. Can it be overridden by anyone if it's required? As in, can certain people still merge on fail. Then we'd sort of have both options.

slender iron
#

we could turn off pushing directly (which is a good idea I think) and nag people who fail but merge

idle owl
#

Ok. I think that's a good start.

slender iron
#

want me to turn off pushing directly?

hearty stratus
#

@tulip sleet RE: framebuf. ah, thank you!

#

is there a tutorial on using framebuf?

idle owl
#

@slender iron Yes please.

slender iron
#

ok, master now requires PR and 1 approval

#

the lower level of protection only prevents force push

#

send an email to creative eng about the change to give people a heads up and a reason why we're doing it

idle owl
#

Ok thank you

tulip sleet
idle owl
#

@slender iron I'm not sure I know what preventing only force push means. People can still commit directly? Or no

#

I want to make sure my email is accurate.

slender iron
#

no because we require a review

idle owl
#

ok

#

Got it

slender iron
#

๐Ÿ‘

hearty stratus
#

@tulip sleet oh no ๐Ÿ˜ฆ my project kinda needs that too

#

i was able to import fine on trinket m0 but never used it

ruby atlas
#

Really late but hug reports and status report for me (My day unexpectedly got really busy):

  • Hug to Kattni for helping ensure I had all the hardware I need to tackle the LED animation. Without her help, I wouldn't have had the right bits to be able to GDB some crashes last night!
    Status Report:
  • I managed to wire up a good range of Neopixels and Dotstars, and upgrade all the firmware to 3.0 on a wide range of boards. During that I only noticed one stock main.py that failed to start after lib updates.
  • Once I had some larger strips or matrices working, I got FastLed working with it's canned demo on one strip to see what performance could be like... Then started down the benchmarking path. It became apparent right away that two main things make Neopixel and Dotstars slow. The first is the relatively complex function to set a pixel, which was easy to speed up at least 5x with a C helper. I expect I can make things much faster later on. The other area that could use some help is the brightness reduction code. Since neopixels and dotstars are too bright by default, it's going to be a common use case. I expect to have an alpha of helper function(s) for encoding RGB[w] to bytearray elements ready in the next week or two, which can be used to accelerate _set_item. I feel like this is a post-3.0RC item.
idle owl
#

@tulip sleet Travis failed on your PR but I don't see your files in the list, it's all old files. Can we trigger a rebuild? Or should I merge over the failed checks.

manic glacierBOT
#

Both Neopixel and Dotstar take a lot of cycles to update pixels. There's two different things going on that slow down both. The first is that converting from Int or RGB[W] to the bytearray is complex code that makes updating pixels slow. The penalty for more pixels is O(N) (as one would expect).

The second issue is that when brightness<1, extra work is done during .show() - the bytearray is copied and every pixel value recomputed. This probably also causes unnecessary garbage collect...

tulip sleet
#

@idle owl I think I can restart the job

idle owl
#

That would be good if you can

#

Beautiful! Thank you.

manic glacierBOT
#

I have done some benchmarking to understand the penalty of using brightness < 1 is significant, especially with larger strips or matrices (the penalty is noticeable even with a single pixel).

When testing 30, 60 and 72 pixel devices, the speedup from using a simple CircuitPython C helper to update the bytearray members was about 5x. Speeding up .fill() could be even more significant, and a helper to do brightness conversions could be equally significantly faster, especially with a preal...

tulip sleet
#

I clicked on "details" in the PR status for travis. That brought me to the travis page where there was a "Restart Job" button on the right side.

idle owl
#

I looked, hmm

#

Maybe it only shows up if you authored the commit.

#

Checked another PR that's failing and I don't have a button.

tulip sleet
#

what's that other one?

idle owl
#

There's another one on the learn repo that has an issue.

#

Mike's PR.

tulip sleet
#

might be privs. I'll see if I see the button.

idle owl
#

Ok keen thanks

idle owl
#

No

tulip sleet
#

ok, that's some privileges thing. lemme see if I can turn it on for you

idle owl
tulip sleet
#

In the "More Options" dropdown do you have a "Trigger Build"?

idle owl
#

No, it says "Requests"

tulip sleet
#

k, I think Scott has to add you to something. I can't find any management interface.

idle owl
#

Ok

slender iron
#

its all based on github permissions

manic glacierBOT
idle owl
#

@ruby atlas Please reference the issues you files on DotStar and NeoPixel in the CircuitPython issue you filed, if you haven't already. Thank you

ruby atlas
#

@idle owl github seems to have linked them. Checking.

idle owl
#

Oh ok. That works then.

#

I was looking at the email.

ruby atlas
#

all 3 reference each other ๐Ÿ˜ƒ

#

yay automagic linking

idle owl
#

Excellent thank you

manic glacierBOT
#

I think I know what I want to do for speeding up NeoPixel and DotStar _setitem() - a pixelbuf class that takes over for (most of) the python bytearray management... specifically handling byte ordering and bpp=3/4 (RGB vs RGBW) itself. It would also probably handle .brightness and do the bytearray brightness calculations itself ... or keep two bytearrays around (optional because of memory) - one with brightness applied and one with original values, updated during setitem. A helper should...

kindred sable
#

I've googled around a bit and haven't found it yet so I'm hoping someone here can help. I've got a Circuit Python Express and somehow I lost all the files on it. I hadn't modified the factory example program yet but I wanted to explore it. Where can I get a copy of that factory example?

slender iron
kindred sable
#

Ah, of course. Thanks @tannewt!

manic glacierBOT
#

Since audioio has been reworked in 3.0, it now allocates two buffers of 512 bytes each when .play() is called on a file: https://github.com/adafruit/circuitpython/blob/master/shared-module/audioio/WaveFile.c#L102-L112

That is problematic for large programs that already use most of memory, because they can fail pretty much randomly at any moment due to memory fragmentation.

In 2.x, the buffers were allocated once, when the AudioInOut object was created:
https://github.com/adafruit/c...

manic glacierBOT
#

Hmm, actually it's allocated when WaveFile is created, I thought it was in .play() because I create it just before calling .play(). I think the difference from the old code is that previously the buffer was GC-ed when I deleted the old AudioInOut object and created a new one to play a new sound, but with WaveFile, the old object somehow stays around, and i get a MemoryError when I try to create a new one.

raven canopy
#

@slender iron Follow up on your suggestion for SAMD51's Frequency Meter for measuring frequency in. It only applies to measuring clock frequency:

Overview

The Frequency Meter (FREQM) can be used to accurately measure the frequency of a clock by comparing it to a known reference clock.

Unless I'm misunderstanding what you were referring to, or usage. ๐Ÿ˜„

slender iron
#

@raven canopy yeah, its weird it needs it piped into the GCLK first