#circuitpython-dev

1 messages · Page 133 of 1

idle owl
#

@tulip sleet Yeah I was thinking the same thing but wondering if we should try to have it done for this release or not.

#

Right, it wasn't really big enough for that to be an issue yet.

tulip sleet
#

do you have more stuff you want to add, like IR?

#

it might be a q for Scott and Limor

idle owl
#

IR is going to be a serious learning curve for me, and it's lower priority. The only other thing to consider was the sound meter.

#

That's it though.

#

That would be every feature having something in express which I guess is what I pictured.

#

I thought there was an outstanding issue but it's for lis3dh not express

tulip sleet
#

I would ask them as well as me. I wasn't home for JP's mem problems; is that resolved enough not to have it frozen?

idle owl
#

Not sure, he's out for a bit, but he'll be back. And Scott rewrote it to not fail on memory error, so it seems to mostly work even with constant memory errors.

#

Of course I'd ask them as well, but you deal most with the freezing bit, so I started with you.

tulip sleet
#

if we can get away without freezing it, then it can be deferred. maybe 2.2 is a little early

idle owl
#

Yeah I'm still up in the air about it myself. It would be nice to avoid memory issues but there are still changes being made.

tulip sleet
#

@idle owl I did some copy-editing on the first couple of pages of that guide. Just typos and font styles. And I made the warning about not resetting or unplugging more obvious.

idle owl
#

Thanks

#

@tulip sleet Looks good!

tulip sleet
#

The screen section needs to say how you exit screen: ctrl-A \ on Linux, ctrl-A ctrl-\ on Mac (right?)

idle owl
#

Oh I type :exit

#

But I think you're right there too

#

not working for me but I think I ran into this last time where it didn't like me then either.

#

I know crtl+A, :exit works for me.

tulip sleet
#

ctrl-A :quit on linux. Oy, silly differences.

#

This is a really great guide. I'm looking forward to pointing people to it.

idle owl
#

Thank you! I'm excited about it

timber lion
#

there are two versions of screen actually, a gnu one and another one

#

BSD i think

#

each has a different exit sequence

#

it's why mac is different from linux

#

and very annoying

umbral dagger
#

I’ve been using C-a k y on Linux

opaque patrol
#

Does anyone have a link to the instructions to load CircuitPython on a feather m0 adalogger using bossa?

tidal kiln
#

@opaque patrol i think it's pretty much just:

bossac -e -w -v -R FIRMWARE.bin

and replace FIRMWARE with appropriate file name

idle owl
#

Ok I've been going in circles for an hour. I'm trying to get this OLED SPI breakout working with CP and after working through a number of errors, I've come repeatedly to one that I can't seem to get around.

lofty topaz
#

16bit 1.5?

#

got two for teensy eyes.

#

testing one now on testbed with arduino

idle owl
#

It's the SSD1306 1.3"

lofty topaz
#

Ah, you can hook that up a number of ways I see. You choose I2C. ok. So what kind of errors?

#

Are you level shifting?

idle owl
#

SPI. And I'm getting 'SPIDevice' object has no attribute 'write'. The driver for this device uses another library that uses another library. There's a level shifter built in.

lofty topaz
#

ok, code issue. I see.

#

so who says there should be a write attribute?

#

haven't looked at any code yet.

idle owl
#

This library calls adafruit_bus_device.SPIDevice I believe. I can find write in all three libraries

lofty topaz
#

try - void fastSPIwrite(uint8_t c);

idle owl
#

That isn't CircuitPython....

lofty topaz
#

I know, but...

#

sometimes... reuse

#

its in the name

tulip sleet
#

it should be writeinto, maybe

idle owl
#

Counting down the days until I upgrade my laptop. Oi... crashed again.

tulip sleet
#

are you testing the library or just trying to use the display? The I2C impl might work better.

idle owl
#

I'm testing the library

#

And I'm not convinced it isn't a bug.

tulip sleet
#

there's no writeinto never mind

idle owl
#

Error: Traceback (most recent call last): File "code.py", line 11, in <module> File "adafruit_ssd1306.py", line 183, in __init__ File "adafruit_ssd1306.py", line 46, in __init__ File "adafruit_ssd1306.py", line 72, in init_display File "adafruit_ssd1306.py", line 189, in write_cmd File "adafruit_ssd1306.py", line 189, in write_cmd AttributeError: 'SPIDevice' object has no attribute 'write'

#

I2C is probably easier, yeah, but this lib is waiting on SPI testing.

lofty topaz
#

I think I see a "writeto(...)"

idle owl
lofty topaz
#

Right, I2C is part of busio which is imported. have you tried 'writeto'?

idle owl
#

In what? The device library? It's also in the other 2 libraries and I don't have those locally

tulip sleet
#

I think SPIDevice might be just wrong. It's missing any actual read or write methods of any name.

idle owl
#

Oi! Vindication!

lofty topaz
idle owl
#

I'm not using I2C.

#

That's why SPI might be missing something. It's not in SPI

lofty topaz
#

oh heck, I was in the example. so sorry

tulip sleet
#

@idle owl did you test lis3dh with spi or just i2c?

idle owl
#

@tulip sleet I guess just i2c. I didn't think to check both. Or even consider that both were an option. I went with the whatever the example would have been, and then tested shake.

lofty topaz
#

My bad, found something in bitbangio tho

idle owl
#

RTD has write for SPI.

#

But that doesn't mean it's in the lib.

#

Although Sphinx would have had a fit if it caught it, so I'm not sure this makes sense.

tulip sleet
#

ok, I see what's going on. __enter__ (invoked by with) returns the busio.SPI object, which you can read and write on.

idle owl
#

Ok

tulip sleet
#
    spi.write(blah)
#

the spi is a busio.SPI, not a SPIDevice`.

idle owl
#

I tried setting it up like that but because some of it's handled in the device lib, it doesn't seem to work right. Maybe it's my code.

#
import board
import busio
import digitalio
import adafruit_ssd1306

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)

dc = digitalio.DigitalInOut(board.D9)
res = digitalio.DigitalInOut(board.D10)
cs = digitalio.DigitalInOut(board.D11)

oled = adafruit_ssd1306.SSD1306_SPI(128, 64, spi, dc, res, cs)

oled.fill(1)
oled.show()```
#

There's nothing to it though.

#

Fails "write" on the first oled line

tulip sleet
#
    oledspi.fill(1)
    oledspi.show()
#

try that

idle owl
#

It's not getting there though.

#

It's failing on the oled = adafruit_etc line according to traceback.

#

I tried that though, no change in error

tulip sleet
#

I will stare at the code a minute...

idle owl
#

Ok

#

I will get water

lofty topaz
#

doesn't this SPI need to be locked first?

tulip sleet
#
    def write_cmd(self, cmd):
        self.dc.value = 0
        with self.spi_device:
            self.spi_device.write(bytearray([cmd]))

    def write_framebuf(self):
        self.dc.value = 1
        with self.spi_device:
            self.spi.write(self.buffer)
idle owl
#

Yeah

tulip sleet
#

change that code to:

    def write_cmd(self, cmd):
        self.dc.value = 0
        with self.spi_device as spi:
            spi.write(bytearray([cmd]))

    def write_framebuf(self):
        self.dc.value = 1
        with self.spi_device as spi:
            spi.write(self.buffer)
idle owl
#

Oh I need to download the driver then.

tulip sleet
#

@lofty topaz the locking is done by the SPIDevice when you do with. with calls __enter__ invisibly.

idle owl
#

Oh I have it from downloading it for the M4

#

Oh no that's in the one I've been working on. Oi. ok.

tulip sleet
#

I had never looked at this in detail before. The I2CDevice and SPIDevice work quite differently. I2CDevice returns self; SPIDevice returns the busio.SPI object. Hmmm.... ALso the example code in SPIDevice is wrong, I think.

idle owl
#

OK.... ok. It's no longer giving me that error

#

Instead I have AttributeError: 'SSD1306_SPI' object has no attribute 'dc' which I thought it was a parameter?

#

So I defined it in my code, but if I just put the pin number in the param it gives issues with Pin object, and if I replace dc with digitalio.DigitalInOut(board.D9) I get P07 or something in use

tulip sleet
#

its a pin, not a pin number. I think it means direction

idle owl
#

That line in my code.

tulip sleet
#

oh, i see what you mean

idle owl
#

Yeah.

#

It sets direction, but the pin doesn't have direction, digitalio does

tulip sleet
#

are you testing this on a feather?

idle owl
#

Yeah

tulip sleet
#

so paste your current test code

idle owl
#
import board
import busio
import digitalio
import adafruit_ssd1306

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)

dc = digitalio.DigitalInOut(board.D9)
res = digitalio.DigitalInOut(board.D10)
cs = digitalio.DigitalInOut(board.D11)

oled = adafruit_ssd1306.SSD1306_SPI(128, 64, spi, dc, res, cs)

with oled as oledspi:
    oled.fill(1)
    oled.show()```
#

wait... or is it failing in the changes you made?

#
  File "code.py", line 12, in <module>
  File "adafruit_ssd1306.py", line 183, in __init__
  File "adafruit_ssd1306.py", line 46, in __init__
  File "adafruit_ssd1306.py", line 72, in init_display
  File "adafruit_ssd1306.py", line 186, in write_cmd
AttributeError: 'SSD1306_SPI' object has no attribute 'dc'```
#

error ^^

tulip sleet
#

look in the edited version of SPIDevice.py. What does write_cmd look like? paste it here

idle owl
#

I replaced it with your code

#
    def write_cmd(self, cmd):
        """Send a command to the SPI device"""
        self.d_or_c.value = 0
        with self.spi_device:
            self.spi_device.write(bytearray([cmd]))

    def write_framebuf(self):
        """write to the frame buffer via SPI"""
        self.d_or_c.value = 1
        with self.spi_device:
            self.spi_device.write(self.buffer)```
#

that's what it was

tulip sleet
#

I don't see the self.d_or_c.. I'm not looking in the PR. Hold one.

idle owl
#

I'm using the lib from the PR. Copied the file out of the other repo.

#

Holding.

tulip sleet
#

replace self.dc.value in my replacements with self.d_or_c.value. I was looking at the old code, sorry.

#

in both def's

idle owl
#

Ooh new error!

#
  File "code.py", line 14, in <module>
AttributeError: 'SSD1306_SPI' object has no attribute '__exit__'```
#

I got it!!

#

I took out the with you had me add to test earlier!

#

You figured it out!

#

Aahhhah! Yes!!!

tulip sleet
#

it displays!?

idle owl
#

Yes!!!

tulip sleet
#

OK! Well, that was painful. I didn't really know these libraries. I'm a little weirded out by the non-consistency between the I2C and SPI versions.

idle owl
#

I was going in circles with that! Thank you so much!!

#

And that's why we test code, kids.

tulip sleet
#

I need to file an issue about the bad example. YW!

idle owl
#

Ok, I need to edit the SPI code in the lib

lofty topaz
#

...and I need to mind my own business. Didn't mean to get in the way.

idle owl
#

No worries. You never know when you can help. Thank you for trying. I appreciate it!

lofty topaz
#

I shouldn't bounce between channels so much and get confused.

tulip sleet
#

@lofty topaz don't worry - this was really confusing - there was a bug in an example and there was a bug in the library under test. Neither @idle owl nor I understood the corect use of the SPIBusDevice lib up front

lofty topaz
#

@tulip sleet Yeah, plus I had just returned from celebrating my daughters 22nd birthday. Helpful frame of mind but not so analytical. 🍸
Nice hack tho.... ><>

sacred socket
#

I just installed CircuitPython on a Huzzah esp8266. I've connecte to it using Putty. I followed the Adafruit tutorial by Tony DiCola. It is not showing up as a mass storage device. Are there additions steps to install the UF2 files/ability to the Huzzah?

idle owl
#

The ESP chips don't support UF2

sacred socket
#

Thanks. I was thinking something like that would be the answer.

idle owl
#

It's something with the hardware not supporting USB like that. Can't be resolved with software.

sacred socket
#

What would be re recommended method to save code to the Huzzah? FIYI I haven't tried or researched it yet.

#

FYI...

idle owl
#

ampy maybe? I'm not familiar enough with working with the ESP chips. There's a few other people who have done it a bunch.

sacred socket
#

I'll look into that. Thanks again.

raven canopy
sacred socket
ruby lake
#

for some reason the macbook thinks there isn't enough space on FEATHERBOOT to install a new uf2

slender iron
#

@ruby lake try renaming it to current.uf2 to cause it to replace it

stuck elbow
#

hmm, d_or_c is a really confusing name

#

the pin is labeled "dc" on all the modules

#

(yes, I know technically it's d/c)

tulip sleet
#

I had to look up that it’s “data/command “

stuck elbow
#

and sometimes it's also marked as A0

#

or some equally useless marking

#

I think that if we want to follow Python's style of using whole words, it should be data_or_command

#

what I'm trying to say is that d_or_c is not really better than dc in terms of clarity

#

then it would also make sense to use chip_select for cs too

#

and perhaps also "master_in_slave_out" for miso

raven canopy
#

data_cmd seems a happy medium...

stuck elbow
#

only if you are a native speaker

tulip sleet
#

miso et al seem like standard terms, cs is kinda that, but I agree data_or_command or data_or_cmd would be a lot clearer, since it's certainly not universal on SPI devices. Happy to entertain a PR.

stuck elbow
#

dc is quite standard in the niche of serially-controlled displays

#

there is also the question of being consistent with the drivers for other platforms, like arduino etc.

#

they all use dc

#

nevermind, found it, wrong python

#

I wonder if there is some way to subscribe to changes from all the circuitpython-related repositories somehow

timber mango
#

Hello!
Ive just received and plugged in my trinket M0 & Metro express boards to try CircuitPython...
I'm under windows10, I've installed the adafruid drivers 2.0.0, and the trinket M0 is seen as a drive when plugged in.
But when I'm plugging in the Metro Express, It is not seen as a drive, even though it does seem to run the demo python file, since the RGB led is showing some kind of rainbow colors...
I've managed to connect Putty on the newly created COM8, and some numbers are scrolling... but I can't stop the script execution with CTRL-C as for the trinket M0 demo script... :s
I'm looking for any help or suggestion to be able to see the Metro express as a drive and be able to modify the CircuitPython script... thanks! 😃

#

ok, just found that: "Windows 10
Did you install the Adafruit Windows Drivers package by mistake? You don't need to install this package on Windows 10 for most Adafruit boards. The old version (v1.5) can interfere with recognizing your device. Go to Settings -> Apps and uninstall all the "Adafruit" driver programs."

#

my mistake... 😦

raven canopy
#

question: are #elif & #else recognized in the CPy backend? Hoping to use it like:

#ifdef SAMD21
    foo = bar;
#elif SAMD51
    foo = bar2;
#else
    foo = no_bar;
#endif ```
tulip sleet
#

@raven canopy you mean in Python code? Nope, though you could run the .py through cpp yourself. I'm not sure I've seen anyone do this in Python code.

#

@timber mango are you all set now?

raven canopy
#

@tulip sleet not in Python. In C...working on the unique ID thing.

tulip sleet
#

In C, yes, we use it ALL the time. But there are also board-specific files where you might want to isolate these routines. Are you doing this on the master branch?

raven canopy
#

yeah. I thought about using each ports common_hal, but since we're targeting both SAMD & NRF (and ESP uses machine), I'm starting in shared-bindings. if that is the wrong approach, I can go back to the drawing board and figure out how to impl in the ports/boards.

#

and just thought about recursion to MPy... that's a reason to go the ports/boards route.

tulip sleet
#

shared-bindings is common code; we don't conditionalize by arch there. So use common-hal, but with identical function names across the ports. See atmel-samd/samd21_peripherals.c and samd51_peripherals.c for an example of the same function name with different impls. These files are compiled as appropriate for each arch. The routines in them are called from a common-hal/ routine.

raven canopy
#

copy that. thanks for the vector correction! 😄

idle owl
#

@tulip sleet I just posted a travis-fixing commit to ssd1306, so can you give it a final look and merge it?

tulip sleet
#

@is it worth testing the SPI changes quickly? I have an SSD1306 but I'd have to unsolder the I2C jumpers. Is yours still set up for SPI?

idle owl
#

Oh yeah totally worth it

#

it's not still wired up

#

but that can be fixed

timber mango
#

@idle owl @tulip sleet heya Q, for SPI displays, y'all renamed dc to d_or_c?

idle owl
#

No, it's renamed even further now.

#

But yes in the interim we had, when linting things.

timber mango
#

lol ok whats the name now?

idle owl
#

Or whoever linted it had anyway

tulip sleet
idle owl
#

dc_pin - but this change isn't committed yet. So it's d_or_c right now I believe.

tulip sleet
#

and @stuck elbow documented what "dc" means in a docstring comment (per my request)

timber mango
#

ooh ok yah dc_pin is good

#

thx, just checking - d_or_c is not /technically/ correct

#

dc_pin is best! 😃

tulip sleet
#

yeah, it bothered him; great - we want clearer libraries, and he added a lot of doc as well

timber mango
#

np some of these pin names are unclear but i can help since i label the pins on th eboard - just @ me

#

i have a few minutes to kill, should i put 2.2 on a CPX and test doubletap?

idle owl
#

@timber mango Yes please!

#

@tulip sleet Tested successfully.

#

I'll merge it then

#

New release done as well, so that's sorted.

timber mango
#

i do want to take a look at framebuf and perhaps change it to be more gfx-like at some point

#

maybe its very close to done :/

idle owl
#

@timber mango Did you get my emails earlier this week about the guide? It's basically done except for those two questions.

#

Yay cpx.double_tap works for me with 2.2 and the most recent bundle!

manic glacierBOT
lucid arch
#

Hi all, I've literally started exploring and reading about circuit playground express just now and was going through the adafruit learning page. There's an example to try but I'm getting this error:
No I2C device at address: 40
Anybody have any idea what's the problem? Ta

idle owl
#

Yes, in fact, I believe I do. Can you link the code you're looking at?

lucid arch
#

This is the code:
import adafruit_si7021
import busio
import board

i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
print("Temperature:", sensor.temperature)
print("Humidity:", sensor.relative_humidity)

idle owl
#

I think the issue is in the line where you setup the i2c instance of whatever you're using. So instead of just (i2c), for the Circuit Playground Express you need (i2c, address=0x19)

lucid arch
#

It was just demonstrating how to and why to install latest libraries and etc

idle owl
#

So where you have sensor

#

Add the address part of what I just posted.

lucid arch
#

ah. I see

idle owl
#

For that to work overall, you need that sensor attached, so while it's walking you through how to install libraries, it won't fully work on your board unless you also have that sensor.

opaque patrol
#

@lucid arch I did the exact same thing when I started with that example, maybe it should be changed to indicate it is demonstrating an error more clearly

idle owl
#

@opaque patrol You are correct, and there is currently a guide that's going to replace a lot of those generalised getting started pages.

#

It's not quite finished but that's the plan.

lucid arch
#

Ok, that makes more sense now. Is there an onboard address i can use, since 19 is not found either

idle owl
#

That should have worked. I'm wondering if the issue is that the example won't work without the sensor breakout board.

opaque patrol
#

@idle owl speaking of guides....I talked to Scott earlier in the week and he said to get with you about helping with guides....

idle owl
#

So it's looking for something on that address and it's not finding anything because there's nothing attached.

#

@opaque patrol Oh nice! Yeah, I can get that sorted.

lucid arch
#

yeah. I'm assuming you dont use the i2c to read the temperature sensor?

idle owl
#

Not the onboard temp sensor, no

#

I don't think anyway.

#

The examples further on in that guide will cover a lot of it.

#

That example is simply showing how to create an error by not having a module installed, and then installing the library you need to resolve the error.

lucid arch
#

ok

#

got it

#

makes sense.

#

cool, i'm moving on with the next pages then

#

just one last question. I should just override the code.py everytime with my code and save and that should be it, for uploading to the board?

idle owl
#

Thank you for the feedback! I'm adding a couple of sentences to the upcoming guide to make it clearer what's going on. The example is different in the new guide, but still we want it to be as clear as possible.

#

Yeah that is a way to do it, or you can edit it every time. Whichever way you want to do it. Just be sure to save it somewhere if you want to keep it.

lucid arch
#

cool .Thanks, you've been really helpful. this forum is 😃

idle owl
#

That's great to hear! That's one of the biggest reasons we're here!

lucid arch
#

i've been exploring the world of flora lately before i came across the CPX and so i'm more used to the arduino ide. I quickly went through a few examples there and was having a hard time getting the sensors working.

#

i tried the colour example, where the colour sensor senses colour and flashes the neopixels of that colour but that did not work as it should

#

similarly same result for the light sensor

#

are those examples massively out of date? or..

idle owl
#

Wait for Arduino?

#

Or the CircuitPython examples

lucid arch
#

circuitpython examples via the arduino ide

idle owl
#

I have no idea then. I've never worked with Arduino, so I haven't gone through them, nor would I be able to tell by looking.

lucid arch
#

ok. no worries. thanks, i guess i'll keep going through the circuit python examples for now and see where they lead.

idle owl
#

Ok, sounds like a plan!

#

Someone else would know better than me, I'm sure. So hopefully someone catches your question.

lucid arch
#

cool. ta

opaque patrol
#

I am looking at the color_sense example now....It basically uses the buttons to flash colors and detect the amount of light reflected...I might try to convert this to CP

lucid arch
#

thanks BravoDelta. I basically kept getting medium values, even though i put the board next to stark green felt paper or red paper.

idle owl
#

@opaque patrol Yeah it's not really a color sensor, the examples in MakeCode use the LED next to it to flash and then you use that data. Sounds similar. I know there was a plan to add that in CircuitPython, but as far as I know, no one has done anything with it.

opaque patrol
#

@idle owl Do you know off the top of your head what the range (or resolution) of the light sensor on the cpx?

idle owl
#

Nope.

opaque patrol
#

here is what I have so far to sense color....

#
from adafruit_circuitplayground.express import cpx
import time
from simpleio import map_range


LIGHT_SETTLE_MS = 0.1 # 100 ms
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
CLEAR = (0, 0, 0)

def sense_color(verbose_out = False):
    cpx.pixels.fill(CLEAR) # clear pixels so they don't interfere
    time.sleep(.5)
    # Save the current pixel brightness so it can later be restored.  Then bump
    # the brightness to max to make sure the LED is as bright as possible for
    # the color readings.
    old_brightness = cpx.pixels.brightness
    cpx.pixels.brightness = 1.0
    
    # Set pixel 1 (next to the light sensor) to full red, green, blue
    # color and grab a light sensor reading.  Make sure to wait a bit
    # after changing pixel colors to let the light sensor change
    # resistance!
    cpx.pixels[1] = RED
    time.sleep(LIGHT_SETTLE_MS)
    raw_red = cpx.light
    cpx.pixels[1] = CLEAR
    time.sleep(.01)
    if verbose_out:
        print("raw red = {}".format(raw_red))
    
    cpx.pixels[1] = GREEN
    time.sleep(LIGHT_SETTLE_MS)
    raw_green = cpx.light
    cpx.pixels[1] = CLEAR
    time.sleep(.01)
    if verbose_out:
        print("raw green = {}".format(raw_green))

    cpx.pixels[1] = BLUE
    time.sleep(LIGHT_SETTLE_MS)
    raw_blue = cpx.light
    cpx.pixels[1] = CLEAR
    time.sleep(.01)
    if verbose_out:
        print("raw blue = {}".format(raw_blue))

    # Turn off the pixel and restore brightness, we're done with readings.
    cpx.pixels.brightness = old_brightness

    # Now scale down each of the raw readings to be within 0 to 255.  
    red = map_range(raw_red, 0, 255, 0, 330)
    green = map_range(raw_green, 0, 255, 0, 330)
    blue = map_range(raw_blue, 0, 255, 0, 330)

    return int(red), int(green), int(blue)
#
try:
    cpx.pixels.brightness = .2
    verbose = False

    while True:
        if cpx.button_a or cpx.button_b:
            verbose = cpx.button_b
            time.sleep(.05) # debounce
            if verbose:
                print("button pressed")
            while cpx.button_a or cpx.button_b:
                time.sleep(.01)
            r, g, b = sense_color(verbose)
            
            print("({}, {}, {})".format(r, g, b))
            cpx.pixels.fill((r, g, b))


except:
    cpx.pixels.fill(CLEAR)
#

actually works pretty good

idle owl
#

Nice!!

lucid arch
#

i tried your code and i get a memory error:
Traceback (most recent call last):
File "code.py", line 1, in <module>
MemoryError:

idle owl
#

So we're super tight on memory with these boards. If you have too much on your board already, you can run into that with beefy code.

#

Do you have the most updated version of CircuitPython on your board?

lucid arch
#

yep

idle owl
#

And the updated libraries?

lucid arch
#

yeah.

#

the first one is the u2f file, right?

idle owl
#

Yep

lucid arch
#

and the second unzips to a lib folder

#

so its all good.

idle owl
#

Ok

#

Not sure then. It's early working code, so we'll have to test it more to see what's up

lucid arch
#

ah i tried the keyboard exmaple just now and i get another memory error:
Traceback (most recent call last):
File "code.py", line 7, in <module>
File "/lib/adafruit_hid/keyboard.py", line 34, in <module>
MemoryError: memory allocation failed, allocating 896 bytes

idle owl
#

Hmm. Did you save a bunch of files to the board or anything? Or you're still working with just one code.py

#

Also if you put three backticks (the one in the top left corner of your keyboard) on both sides of your code, it will make it a codeblockOne backtick on either side and you get inline code

lucid arch
idle owl
#

So when you're posting code or serial errors, it's good to use the backticks for readability.

opaque patrol
#

@lucid arch @idle owl I am using version 2.2.0

#

and updated libraries

idle owl
#

Hmm.

lucid arch
#

backticks : got it.

half sedge
#

@idle owl When you say the lattest, are you talking about 2.2.rc1 or is there now a definitive 2.2.0?

opaque patrol
#

cpx had an issue for a time with lis3dh causing memory errors

lucid arch
#

i got this: adafruit-circuitpython-bundle-py-20171216.zip

idle owl
#

I actually meant 2.1.0 since that's the latest stable. But, to answer the question, no it's still rc1.

opaque patrol
#

rc1

idle owl
#

@opaque patrol Not any more.

#

It prefers frozen modules over local copies now to eliminate that.

opaque patrol
#

I can change it to not use cpx

idle owl
#

@lucid arch That's good, the most updated libraries are best to have. There's a couple of new features that need a newer version of CircuitPython, but they're not in any examples yet.

#

@opaque patrol That shouldn't be it. But you can give it a try.

#

@lucid arch is getting memory errors on other things too.

lucid arch
#

yeah, keyboard module.

opaque patrol
#

@lucid arch Were you using the bundle from 20171216 when you got the memory error?

lucid arch
#

am defo still working on code.py and with the same lib folder. so it cant be a space issue.

#

i've had the same bundle since an hour, which is when first installed my cpx latest.

idle owl
#

@opaque patrol The cpx class is designed to use the frozen modules now instead of the local copies which was what was causing the memory errors with lis3dh.

lucid arch
#

havnt changed the lib.

idle owl
#

Have you physically reset the board?

#

I'm not sure it will help but it's an easy step to try. Friendly eject it and then press the reset button.

#

Then reconnect to serial and see what you get

lucid arch
#

pressed the reset button? yeah, a bunch of times.

idle owl
#

Oh ok

lucid arch
#

ok, let me try that.

idle owl
#

If you've already reset, then I doubt it will help.

opaque patrol
#

I am actually using the lib bundle from the 12th. cpx is version 0.9.1 according to versions.txt

idle owl
#

We might need to fully erase the board and start again. Something got unhappy.

#

That's the newest, @opaque patrol

#

iirc.

#

Let me check.

opaque patrol
#

Could try flashing 2.2.0 rc1, it is super easy to flash the circuit playground express

lucid arch
#

still the same issue. keyboard mem error 😦

idle owl
#

Oh there's a 1.0 release, but it only adds another thing to the API, no bug fixes.

lucid arch
#

@opaque patrol : flash the bundle? how.

idle owl
lucid arch
#

coool

idle owl
#

We're going to erase the board completely, so back up everything you want

lucid arch
#

on i

#

t

idle owl
#

Then I'm going to link you the release candidate of CircuitPython

#

Download this and flash it instead of 2.1 (this shouldn't matter, but we would love to have some more testing of this version)

opaque patrol
#

Testing it now 😃

idle owl
#

Thanks!

lucid arch
#

which lib to install?

#

the 2.1.0 one or the other py one?

idle owl
#

oh

#

the 2.1.0

lucid arch
#

they have different sizes

idle owl
#

Should say 2.x

#

but we created the lib bundle stuff before we released 2.2rc1

#

Here:

#

That. If you didn't already get that same one.

lucid arch
#

works

#

😃

#

the keyboard example works

#

@opaque patrol your code about the colour sensor works as well 😃

idle owl
#

Yay!

lucid arch
#

so the board did get unhappy ... hmm, a bit temperamental, isnt it?

idle owl
#

It can happen. They're not always tempermental, but when they are, sometimes it takes a full flash to fix it.

#

Could have been a memory leak in something and then whatever it was couldn't clear, something like that.

#

The other thing is you don't want to reset without ejecting

#

and if you do, files can become corrupted if anything was trying to write at the time

#

often this corrupts the entire board

#

but it can affect one file, and then that file can just cause memory issues.

#

So that also could have been it. Never know. For what it's worth, though, it seems really difficult to actually break anything. Even if it's not showing up at all, as long as you can get to the bootloader, you can reflash it with the steps I sent, and get everything happy again.

lucid arch
#

cool

#

pretty cool

#

ok. its been joy talking to you guys

#

am off . will continue exploring the cpx more tomorrow.

#

is the cpx meant to be wearable, like the flora is?

#

or is it just a tiny board for exploring lights and sensors?

#

i love that theres so much in the cp as compared to the flora. it means you can start doing small stuff and seeing things really quick, like a rad sort of thing.

idle owl
#

It can work as a wearable! There's a bunch of projects where it is.

#

But it's specifically meant to be a perfect intro to programming and electronics.

#

So many options to learn different concepts.

lucid arch
#

i see

#

cool

#

awesome.

idle owl
#

😃

lucid arch
#

well, thanks and good night.

idle owl
#

You're welcome and you have a lovely night as well!

idle owl
#

Blergh, travis failed on that PR I just did, except I didn't change anything but the one line in travis.yaml so I'm a bit confused.

opaque patrol
#

travis is just upset that you took them out of it

idle owl
#

Apparently.

#

But it means it wasn't linted completely to begin with or they literally just added this check. Which on research says they did that in September.

#

This:python def _read_register(self, reg, count=1): self.buf[0] = _COMMAND_BIT | reg if count == 2: self.buf[0] |= _WORD_BIT with self.i2c_device as i2c: i2c.write(self.buf, end=1, stop=False) i2c.readinto(self.buf, start=1) if count == 1: return self.buf[1] elif count == 2: return (self.buf[1], self.buf[2])Says:Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)

#

I don't understand what it means.

#

Found this:

#

```A new Python checker was added to warn about inconsistent-return-statements. A function or a method

  • has inconsistent return statements if it returns both explicit and implicit values :
  • .. code-block:: python
  • def mix_implicit_explicit_returns(arg):
  •    if arg < 10:
    
  •        return True
    
  •    elif arg < 20:
    
  •        return
    
  • According to PEP8_, if any return statement returns an expression,
  • any return statements where no value is returned should explicitly state this as return None,
  • and an explicit return statement should be present at the end of the function (if reachable).
  • Thus, the previous function should be written:
  • .. code-block:: python
  • def mix_implicit_explicit_returns(arg):
  •    if arg < 10:
    
  •        return True
    
  •    elif arg < 20:
    
  •        return None```
    
#

But I don't see how that's what's happening, so...

#

I'm lost to fix it.

opaque patrol
#

It thinks you are returning an expression in the second because of the parens

idle owl
#

Oh

#

so remove the parens?

#

In the last return?

opaque patrol
#

What does the calling class expect? The second is returning a tuple (right?)

idle owl
#

I think so... and I have no idea. I didn't do anything else with this.

opaque patrol
#

This is beyond my knowledge of python...I think you could put parens on the first return but I am not sure what any side effects might be by doing that

idle owl
#

Neither do I.

#

Ah! PyCharm says the second parens are redundant.

tulip sleet
#

Suppose count == 3, then there's no return statement that's operative

idle owl
#

I don't understand

#

Like I said, all I did was update that same travis.yaml issue

#

And then the build failed on the actual driver file.

tulip sleet
#
        if count == 1:
            return self.buf[1]
        elif count == 2:
            return (self.buf[1], self.buf[2])

suppose count is not 1 or 2, if there's no further statements, then the code just falls off the end. I don't know why pylint didn't catch this before with travis; that's a different q

#

but i think that's what's wrong with the code

opaque patrol
#

Good catch,

tulip sleet
#

bye - sorry - on our way out

idle owl
#

Later!

#

Hmm ok... I'm going to close the PR and delete the branch, then clone it locally and try to deal with it because I don't know how to do multiple changes on a GitHub created branch with an active PR in place.

opaque patrol
#

I do believe you could change the first to return (self.buf[1],) but I might be wrong

idle owl
#

PyCharm disagrees, whatever linter it's using says those are redundant.

#

Wants me to remove the parens from the last one instead. But I don't think that's the problem.

#

Need to clone it, brb

opaque patrol
#

I think Dan was right about the error, it needs and else statement

#
  • an
idle owl
#

Any idea how that's supposed to look?

#

What?.... pylint locally doesn't catch it.

#

Ok now I'm super confused.

opaque patrol
#

It has if count == 1 elif count == 2, what if count < 1 or > 2? Probably unlikely but the linter just sees that you have an if, elif and no else.

#

can't type tonight....what *if count.... keep forgetting there is an edit mode

idle owl
#

there is another one with no else as well

#

"what is" worked as well, so I read it right

opaque patrol
#

the example has no else either so I am not sure

idle owl
#

yeah. hmm.

#

I don't think this is something I can do, heh.

#

So it gets to wait.

#

And that's weird that travis ci fails, but pylint passes. They're usually in unison.

raven canopy
#

you could try setting a variable in the if..., then return the variable at the end.

def _read_register(self, reg, count=1):
        self.buf[0] = _COMMAND_BIT | reg
        if count == 2:
            self.buf[0] |= _WORD_BIT
        with self.i2c_device as i2c:
            i2c.write(self.buf, end=1, stop=False)
            i2c.readinto(self.buf, start=1)
        if count == 1:
            buff_read = self.buf[1]
        elif count == 2:
            buff_read =  (self.buf[1], self.buf[2])

       return buff_read
#

might have to eval buff_read before the return...

opaque patrol
#

or just use return None

raven canopy
#

yeah

#
if not buff_read:
    return None
else:
    return buff_read

note: structure illustration...i'm losing all my syntax from all the lang switching I'm doing lately. 😄

idle owl
#

I'm not even sure where that would go.

raven canopy
#

at the end, when returning the buffer read.

opaque patrol
#
    def _read_register(self, reg, count=1):
        self.buf[0] = _COMMAND_BIT | reg
        if count == 2:
            self.buf[0] |= _WORD_BIT
        with self.i2c_device as i2c:
            i2c.write(self.buf, end=1, stop=False)
            i2c.readinto(self.buf, start=1)
        if count == 1:
            return self.buf[1]
        elif count == 2:
            return (self.buf[1], self.buf[2])
       return None  # this could actually be un-indented one as well
#

Won't let me edit twice

#
    def _read_register(self, reg, count=1):
        self.buf[0] = _COMMAND_BIT | reg
        if count == 2:
            self.buf[0] |= _WORD_BIT
        with self.i2c_device as i2c:
            i2c.write(self.buf, end=1, stop=False)
            i2c.readinto(self.buf, start=1)
        if count == 1:
            return self.buf[1]
        elif count == 2:
            return (self.buf[1], self.buf[2])
        else:
                return None
#

You get the idea....

idle owl
#

R:183, 8: Unnecessary "else" after "return" (no-else-return)

#

Is the new error.

#

Ooh it works the first way

#

Let's commit and push and see how travis ci likes it! pylint is happy.

#

I forked it so I can break it all I want 😄

#

Hmm should test it first. I'll need to get that sensor going first.

opaque patrol
#

the beauty of source control, easy rollback of changes

idle owl
#

Truth, but I can't get travis ci to check it specifically without creating a PR, so I'll test it first and then do the PR.

raven canopy
#

gee-wiz question: is it intentional to return an expression if [1], and a tuple if [2]? From the pydocs:
A single expression without a trailing comma doesn’t create a tuple, but rather yields the value of that expression

idle owl
#

I have zero clue on that one.

#

I removed parens on the second one

#

I think it might still be a tuple though

raven canopy
#

yeah. from what I'm reading, the parens won't make a difference.

idle owl
#

ok

#

hmm.

#

comma after the first one? or that's not right either.

raven canopy
#

so if you put a comma after a single item, the return will be a singleton (1 deep tuple)

idle owl
#

I remember that from testing code a while back, yeah

split ocean
#

@slender iron thanks, this code is working well!

idle owl
#

@raven canopy @opaque patrol The update works!

raven canopy
#

sweet! how did it end up?

idle owl
#

Need to do the PR to find out if travis passes, but I tested it with the sensor and that works

raven canopy
#

they should rename travis to zoul. "Are you the gatekeeper?" 😄

idle owl
#

I don't even know how you'd change that count anyway. or why. So I'm not sure how to even see if that part is working or failing. Does the example code even use it? No idea.

#

Now we wait for a bit.

#

For travis ci.

#

Hey! It passed!

#

Thanks for the help!

slender iron
#

@split ocean 👍

pastel panther
idle owl
#

Nm, evidently it should work 😃

pastel panther
#

@idle owl I have a bom for the second version

#

@idle owl Did you order some?

idle owl
#

@pastel panther @solar whale did and is sending me one. Turns out he already has those so it wasn't an issue.

pastel panther
idle owl
#

Oh nice! Thanks

pastel panther
#

The only thing of note is the switch since the footprint is made to fit that one, but any switch that can bridge the appropriate pads will work

#

It needs to short one of the pairs of pads on the 'short' side of the square

#

err rectangle

#

brb

solar whale
#

I’ll try to test the tactile switch tomorrow and let you know if it works.

idle owl
#

Ok

#

Oh @solar whale Do you have mk2? I was looking at the wrong one I think.

#

Would have messed that up even more looking at the wrong one. Oops. Good thing you're on it.

pastel panther
#

I just un-shared the mki from OSHpark

idle owl
#

Explains why I couldn't find it!

#

I was confused.

pastel panther
#

hah

idle owl
#

Ok, a lot of things make a lot more sense. I was looking at the wrong one. Needs a reet button with 4 feet instead of 2 now, it seems.

pastel panther
#

It only really needs two

idle owl
#

Oh nice!

solar whale
#

Yes , I am sending mkii. Reset pin is different. So @pastel panther the tactile switch wold go between two pins on”short” side?

pastel panther
#

There are two pairs of feet that are essentially shorted together

idle owl
#

I see

pastel panther
#

Yes; If you follow the trace from the last pin in the nearby row, it goes to the two closest pads

idle owl
#

Ah yes it does

pastel panther
#

meaning they're already connected so you need to short two pads on either of the short sides

#

If you're really itching for the 'right' button you can always steal one from a metro; it's the same switch

idle owl
#

6mm x 3mm though it looks like, so any that size would work as long as the feet matched the pads?

pastel panther
#

ya

#

As long as it's a normally open momentary

idle owl
#

Ok yeah

solar whale
#

Ok, I’ll see if it works and if not re-evaluate. I did not want to place a order for just the switches.

pastel panther
#

I think even one of those normal breadboard compatible tactile switches would work

#

You'd just need to bend the leads flat

idle owl
#

Right

solar whale
#

Good night all!

pastel panther
#

night @solar whale

robust coral
#

Funny brainless CPX CircuitPython toy. Accelerometer direction tells the Servo to swing hard the other way. Direction indicated by NeoPixel color. I didn’t expect it to look so freaky.

pastel panther
#

lol

#

If you shorten the cable it might be a little bit more predictable, then again maybe that's not the point

robust coral
#

Haha or lengthen the arm.

pastel panther
#

Having a point is overrated

robust coral
#

Really whip it around!

#

The point was just to entertain/inspire a 6yr old for an hour. Mission accomplished!

idle owl
#

Nice!

robust coral
#

It feels like the kind of quickie thing Circuit Python is perfect for, so I thought I’d share.

idle owl
#

Thank you!

idle owl
#

Thanks!

raven canopy
#

ahhh. my old friend, debugging. this is the fun part, right? 😐

idle owl
#

Yeah already have it. Do I just need to test it on 2.1?

slender iron
#

I tested it on both 2.1 and 2.2

idle owl
#

Ok, I tested it on 2.1, no errors. Was it failing using the class in general? Or did it fail specifically using lis3dh for something

slender iron
#

the init fails

idle owl
#

As in do I need specific code, or is it a general thing.

#

Ok

idle owl
#

Excellent, tested on both.

slender iron
#

wanna approve?

idle owl
#

Already on it

#

Merged.

slender iron
#

thanks @idle owl! I'll release it

idle owl
#

Great! Thanks for catching that and getting it resolved!

timber mango
slender iron
#

yup, np

idle owl
#

@slender iron I went through and updated the lint all the libraries issue with what's pending, what's done and what's remaining. I'm not sure the difference between "PRs needing review" and "Pending PRs" but I didn't make that change so I didn't alter it. Everything that has an outstanding PR that I found went into "Pending PRs" and I tested some more today too.

#

And I did releases on a few that had been finished and merged, but no release was done.

slender iron
#

thanks @idle owl !

timber mango
timber mango
#

Anyone up for a robotic remote haircut? 😉 It's weird to have something in your hand that makes the screen image do the same thing your hand is doing, when it's entirely rotational, rather than mouse movements on an x-y grid.

timber mango
#

@tulip sleet : yes, thanks!

raven canopy
#

<@&356864093652516868> anyone dealt with this error when compiling (background: adding a parameter to microcontroller.cpu):
In function '_sbrk_r': sbrkr.c:(.text._sbrk_r+0xc): undefined reference to '_sbrk'

umbral dagger
#

That's a linker error... looks like it's missing a library

raven canopy
#

well, I found a syscall that handles '_sbrk', but it is in a dir different that the location given for the compile error. hmm.

umbral dagger
#

And it built fine before your change?

raven canopy
#

yeah. even built during changes.... back to regressing to maybe narrow this down.

#

narrowed it down to my property getter. now to try and understand why...😵

fading solstice
#

@idle owl There is no difference between the Pending Review and Pending RPs. You can move RGB_Display into the Pending PRs section and delete Pending Review. Sorry.

indigo hazel
#

I am running into an issue with my new Circuit Playground Express where when I add the latest bundle, I get an error in the serial terminal. Can someone help me out?

tidal kiln
#

@indigo hazel what is the error?

indigo hazel
#

@tidal kiln ValueError: No I2C device at address: 440

#

address: 40*

tidal kiln
#

how large is your code? if it's not too large, paste it here.

indigo hazel
#

import adafruit_si7021
import busio
import board

i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
print("Temperature:", sensor.temperature)
print("Humidity:", sensor.relative_humidity)

tidal kiln
#

how do you have the SI7021 attached to the CPX?

indigo hazel
#

Oops, I am following the online guide, and ran into this error. Now I see that I do not have that hardware, hence the error.😶

tidal kiln
#

yep. that's it. which guide are you following?

indigo hazel
tidal kiln
#

hmmm. i think that could be updated a little to make it more explicit that the example is for an additional hardware item .

indigo hazel
#

yes, a little confusing when starting out for the first time.

tidal kiln
#

and even more so when you have a CPX that does have a lot of sensors already on it

raven canopy
#

i was just going to suggest that. NOTE: this example will not work properly without an external SI7021 sensor connected to the CPX. This is just an illustration of how to import libraries.

#

that really is the hard part about writing guides focusing on early users. you wan't to keep it fun, simple, and light-hearted (which ladyada does SO well), without getting too technical and littered with if...s, notes, and such.

thanks @indigo hazel for bringing the issue up. as has been echoed time and again, this is what makes open source work.

indigo hazel
#

No problem.

tidal kiln
#

i sent in a suggestion to have that looked at

tulip sleet
#

@tidal kiln a user in the forums was similarly confused. I think we might use Adafruit_CircuitPyton_HID as the example instead, since it requires no external hardware. I'll revise that section.

tidal kiln
#

thanks @tulip sleet

#

might be good to have both, a generic nothing additional required example, but then also one that does show how one would get and install the library to go with whatever new gadget they bought (more or less like the existing one)

tulip sleet
#

@tidal kiln @idle owl realized HID is not a good example, because it's one of the libraries included in lib for Trinket and Gemma M0. I like your phrasing and will add it for now.

manic glacierBOT
idle owl
#

@tulip sleet @tidal kiln The example that's replacing that one uses simpleio and blinky, so the example for installing libraries will work once it's done. It's much more clearly explained.

tidal kiln
#

@indigo hazel ladyada just updated the guide pages, take a look and let us know how it goes. hopefully it helps out better now.

meager fog
#

@idle owl i think i did a fair job re-orging that page, dunno if there's anything you want to grab!

idle owl
#

@meager fog All of the libraries page has been integrated into the Welcome guide already, do I need to go through it and compare it again?

meager fog
#

nah

#

ok well, it didnt take me long 😃

idle owl
#

Ah I could update the images.

meager fog
#

nah, ill get to revewing the guide maybe later today, still getting thru emails

idle owl
#

The libs page is split between the libs page in the Welcome guide and the Troubleshooting page in all the other guides

meager fog
#

im doing cpx text now

idle owl
#

Nice! np

meager fog
#

so instead of set_click...whats the current cpx lis3dh api? 😃

idle owl
#

That was updated, it skips it if you're running 2.1.0

meager fog
#

im on 2.2-rc`

#

i was using

#

Set up the accelerometer to detect tapping ('click')

TAP_THRESHOLD = 20 # Accelerometer tap threshold.
cpx._lis3dh.set_click(1, TAP_THRESHOLD) # detect single tap only

idle owl
#

Oh

#

cpx.double_tap

meager fog
#

not single? 😃

idle owl
#

Yeah that was what I was saying I Could explain if needed

meager fog
#

yah

idle owl
#

Turns out you can't have a double click event without two single click events, it's a hardware/software thing, it's not possible. A double click event is two single click events, so if you wanted to have double click do one thing and single do another, you would have conflicting responses, so if one was red LEDs and double was blue, you'd get red or purple.

#

So after a huge discussion about it, we decided to include only double_click

meager fog
#

yah

idle owl
#

You can do both with LIS3DH, it's based on setting single or double, but you can't do both

meager fog
#

yah i remember this from the arduino driver

idle owl
#

Double is harder to have accidental clicks as well

meager fog
#

so how do i detect a single click then?

idle owl
#

so we decided double made the most sense.

#

You'd have to set it up using lis3dh, not cpx class...

meager fog
#

ok

idle owl
#

In this line: lis3dh.set_tap(2, 18, time_limit=4, time_latency=17, time_window=110)

#

You would set 2 to 1

#

and it detects single instead

#

Having both in cpx wouldn't have worked and would have had that huge caveat of both being present with double

meager fog
#

AttributeError: 'Express' object has no attribute 'lis3dh'

#

is it still _lis3dh?

idle owl
#

so Scott redesigned LIS3DH to only detect single OR double based on what that line is. The line that reads the tap returns "true" instead of single/double, and what that event is translated to is based on what you set in set_tap

meager fog
#

kk

idle owl
#

Yeah because the idea was that double_tap would have worked instead of needing _lis3dh being public.

#

We didn't know you'd want to stick for sure with single tapping instead of double_tap working.

meager fog
#

i think, its a little confusing still 😃

idle owl
#

Basically, express only has double_tap capabilities built in.

meager fog
#

why not have it either single or double?

#

cpx.detect_taps = 1 or 2

#

then cpx.tapped

#

?

idle owl
#

I'm not sure, it was a design decision, but I think it could be done.

#

Issue is if you try to do both I guess

#

That was what we were trying to avoid was the huge caveat, but I guess since the driver was redesigned it might be different.

#

I can look into it tonight if you'd like

meager fog
#

k i can also try both, double-tapping is just really hard to time

#

so i usually just have single-tap detection! i can also try changing i tup

#

see if i can get both working. do i need to mpy the library to fit, still?

idle owl
#

It tested pretty well, I had other people do it too. The idea being that if random people could pick it up and get near 100% response from the board, it was the right idea.

#

Yeah

#

It's an easy change to get it to single.

meager fog
#

k let me try it, see what i can get!

idle owl
#

Getting it to double is a variable.

#

Ok!

#

I'll take a look at it later if needed, and I can test it for you later as well if you'd like

#

You can check the data sheet for what the rest of those numbers are for, it took tweaking them solidly to get it to where it worked consistently.

meager fog
#

looks like you cannot use with mpy?

idle owl
#

How so?

meager fog
#

just memory alloc

idle owl
#

hmm... I didn't run into that. Except when other things got wonky

#

lemme grab mine

meager fog
#

huh! thats odd, on 2.2?

idle owl
#

Yeah

#

Post your .mpy?

meager fog
#

i didnt make an mpy

#

im saying you need to make one for it to fit 😃

idle owl
#

oi yes ok.

meager fog
#

k np ill do that!

idle owl
#

I'm back on the right page. Yes it needs mpy

meager fog
idle owl
#

Yeah that's the idea, but it always returns a single around the doubles on circuitpython

#

interrupts aren't implemented

#

the way we have it now, it returns true when a click event happens, and then tells you whether it was single or double based on what you set it to be in the set_tap

meager fog
#

yah

idle owl
#

It's nearly dinner time here so I'm going to head off for a bit. I'll be back later. Ping me if you have any other questions though, I'll have my phone.

meager fog
#

l8r!

#

ok i think i got something ok

#

ill do a PR

solar whale
#

@idle owl @pastel panther I don't htink the tactile switch will work very well on the metrowing. At least, not with my soldering skills. I think I'll just tack on two wires and use a pushbutton until I can get some of the correct switches.

meager fog
#

@idle owl pr is sent, small change but i think will be good. its really annoying to time the double tap 😄

half sedge
#

What is supposed to be the library bundle release matching the 2.2.0rc1 firmware release?

#

By the way, I changed my nick name from Instinctive to DavidGlaude. That is best because it is my name. 😃

#

And another question, is there a plan to release the big demo code from Tony for the Circuit Playground Express.

solar whale
#

@half sedge the latest 2.x Bundle should be what you want - in this case it is silt lableed as 2.1.0-20171217.

half sedge
#

Thanks @solar whale

meager fog
#

2x matches all 2x

solar whale
#

@half sedge New Bundles are now released daily if one of the libraries has been updated, so check back often!

#

The only difference (I think) betwen the 2.x and 3.x bundles is the version of mpy-cross used to build them.

half sedge
#

Like to be in the bundle one day?

#

If it work (and I was planning to test), that would be great an there are some issue to be updated.

meager fog
#

it looks like its in-progresss, @fading solstice has been working really hard with us to clean up our existing drivers, so there is no ETA 😃

half sedge
#

in-progress is better than the nothing I had on my side...

pastel panther
meager fog
#

hey that looks like a custom board

#

nice work 😄

errant grail
#

@pastel panther Is that a Roman numeral pin numbering system? gus

pastel panther
#

@meager fog Thanks, it is indeed! It's my bitsy-ish m4 express board. It's got QSPI on the top and a spare 'normal' SPI underneith for ease of porting; Once I get CP working on it I'm going to try getting QSPI going

#

@errant grail Yes, on one side. I had to use a X for a 10 for space issues and then ran with it. I moved things around so the 10 would fit but I'm digging the roman numerals

errant grail
#

Very cool

#

and creative

pastel panther
#

@errant grail I'm working on my '11 livewell board now also. I should have the board layed out by the end of the week

#

I saw someone using safety pins to program a ESP8266 via the castillated pins so I might try that with this rev of the motor board as to not squander valueable mm^2

errant grail
#

@pastel panther I'm looking forward to seeing that design. Haven't played much with castillated pins yet. Have you done that with other projects?

pastel panther
#

@errant grail nope! I'll be following OSHPark's guidelines and hoping for the best. For the first version I'll probably have some pads for redundancy

errant grail
#

... that would be a good way to make a smaller StringCar PCB and still use a stock Trinket M0 and 8833 motor controller. Thanks for the idea!

#

@pastel panther I'm working on PCBs for StringCarGen2CPy and one for a secret retro-inspired project. Should have them done tonight if the prototypes work as designed.

pastel panther
#

@errant grail cool, I'd love to check them out when you're done

errant grail
#

They're pretty simple, but could lead the way to a custom M0-based board similar to the SMD aTtiny85 controller I made a year ago.

#

@pastel panther Okay, mebbee an M4-based board..

raven canopy
#

@pastel panther nice work on the bitsy-m4 board.

pastel panther
#

The SAMD21E can be had in a 32 pin format which is pretty small

#

@errant grail I'm happy to share my m4 board as a starting point once I've squashed any bugs

#

Thanks @raven canopy!

errant grail
#

@pastel panther I'll take you up on that offer! Especially since it has Roman numerals. M-IV.

pastel panther
slender iron
#

<@&356864093652516868> We're on for our normal meeting tomorrow at 11am Pacific / 2pm Eastern here on Discord. The following few weeks will be weird due to the holidays and I'll post later what the plan is. (We'll discuss it tomorrow.)

cunning crypt
#

What, you don't want to have a meeting on Christmas?

#

Or on new years?

slender iron
#

Rather not 😃

cunning crypt
#

Man, no fun at all!

slender iron
#

I was thinking we should do one the week in between

cunning crypt
#

There is no Monday between Christmas and New Years? Or do you mean sometime Tuesday the 26th to Sunday the 31st?

slender iron
#

Yeah, some other day is what I'm thinking

cunning crypt
#

Friday might be a good one. Might not, though.

slender iron
#

my girlfriend has friday off so I should probably avoid it

cunning crypt
#

I expect Tuesday wouldn't be a grand idea - people traveling and all

slender iron
#

yeah, I figure we can discuss it during the meeting

cunning crypt
#

I'll be working, which is why I'm putting my thoughts down.

#

A weekend day might be able to grab a bunch of people, but then again - it's a weekend day.

#

Odds are I wouldn't be able to come anyway though.

#

Stupid work and holidays and stuff.

slender iron
#

yeah, which day would be best for you?

#

(anyone else who can't make the meeting please post as well)

cunning crypt
#

Monday, Tuesday, and Friday are the days I'd be able to make it, unless it was done later.

slender iron
#

later is an option as well

#

just don't forget time zone

pastel panther
#

I'll be off work after the 22nd so I can likely attend for once whenever it is, unless there is an impromptu fishing trip

cunning crypt
#

After 5pm Eastern I'd be able to do Wednesday/Thursday. Saturday's right out for me.

slender iron
#

kk

cunning crypt
#

Unless you want to hold it absurdly late (>10pm Eastern) or stupid early (<9am Eastern)

slender iron
#

kk, good to know since I'm 3 hours behind

cunning crypt
#

Yeah, I'm keeping that in mind. I don't think a 7pm would be too bad for you, but 6am would be... not the best.

slender iron
#

yeah, 6am won't happen with me 😃

idle owl
#

@meager fog I'm looking at the PR now

umbral dagger
#

@slender iron I see that I'm a CP helper. I'll start showing up for the meetings, that time will typically work well. Alas, tomorrow I will be watching Star Wars then.

lofty topaz
#

@umbral dagger Congrats. Enjoy SW.

keen urchin
#

Just received my circuit playground express, but I'm having trouble getting circuit python on it. I'm on a Macbook Pro running Mac OS High Sierra version 10.13.2 . When I first plug it in it shows up as CPLAYBOOT. I followed the guide and downloaded the latest version of circuitpython. adafruit-circuitpython-circuitplayground_express-2.1.0.uf2 I drag it over and drop it in CPLAYBOOT. It ejects and then remounts as a camera I own that is not plugged in "Nikon D3400". I went ahead and tried to load the adafruit library as suggested in the guide, but then I get an error message "The operation can’t be completed because one or more required items can’t be found. (Error code -43)". I've tried other files just to see if something would work, but the same error message pops up. I have even used the erase file to completely erase everything flash_erase_express.ino.circuitplay.uf2 still no luck. The process repeats itself. I have also downloaded all files again, but I run into the same problem. Does anyone have any ideas? #circuitpython-dev #help-with-projects

tulip sleet
#

@keen urchin so you don't see CIRCUITPY in a finder window, but only "Nikon D3400"?

pastel panther
#

hey @slender iron; I'm I correct in thinking that the dotstar for the trinket m0 is not supported yet in 3.0?

slender iron
#

it should be since we have SPI support now

pastel panther
#

so it should work? It looks like it's still commented out in the trinket_m0 mpconfigboard.h

slender iron
#

yeah, I think so

#

just may not be enabled

pastel panther
#

kk; I put a dotstart on my board so I'll throw that into the file for my board

#

If it works I'll re-enable the one for the trinket m0

slender iron
#

thanks!

pastel panther
#

I got uf2 loaded and working so I know the hardware is good

#

I was honestly surprised

slender iron
#

👍 nice work!

pastel panther
#

Thanks! I have no idea if the flash works but I guess we'll see in a few

limber tulip
#

@atletika5#4704 FWIW I just went through getting my first Circuit Playground Express running circuit python on my MacBook Pro on Saturday, with High Sierra, and it worked fine. Hopefully @tulip sleet advice will help.

fading solstice
stuck elbow
#

the meeting is in 45 minutes, right?

idle owl
#

Yes

stuck elbow
#

thanks

slender iron
#

@umbral dagger you don't have to join the meeting regularly though you are welcome. Enjoy Star Wars!

stuck elbow
#

tap tap tap tappity tap

idle owl
#

@cunning crypt Weekly if you're around

cunning crypt
#

At work!

idle owl
#

Ok!

manic glacierBOT
slender iron
tidal kiln
#

NEXT = ??
NEXT NEXT = Jan. 8th
and normal after that

stuck elbow
slender iron
#

<@&356864093652516868> Next meeting is: Thursday December 28th, 6pm Eastern / 3pm Pacific. If you can't make it thats OK! Enjoy the holidays.

timber mango
#

hiya - couldn't make the weekly, was busy with some other meetings, thanks everyone 😃

slender iron
#

@meager fog no worries!

errant grail
#

Thanks! Happy Holidays!

raven canopy
#

Happy Holidays errbody!

idle owl
#
while True:
    cpx.detect_taps = 2
    if cpx.tapped:
        cpx.pixels.fill((0, 0, 30))
        cpx.play_tone(292, 0.1)
        print("doubletap")
    else:
        cpx.pixels.fill((0, 0, 0))
    cpx.detect_taps = 1
    if cpx.tapped:
        cpx.pixels.fill((30, 0, 0))
        cpx.play_tone(262, 0.1)
        print("singletap")
    else:
        cpx.pixels.fill((0, 0, 0))```
#
while True:
    lis3dh.set_tap(2, 80, time_limit=4, time_latency=17, time_window=110)
    last_tap = False
    tap = lis3dh.tapped
    if tap and not last_tap:
        print("tapped!")
        pixels.fill((30, 0, 0))
    else:
        pixels.fill((0, 0, 0))
    last_tap = tap
    lis3dh.set_tap(1, 80, time_limit=4, time_latency=17, time_window=110)
    last_tap = False
    tap = lis3dh.tapped
    if tap and not last_tap:
        print("tapped!")
        pixels.fill((0, 0, 30))
    else:
        pixels.fill((0, 0, 0))
    last_tap = tap```
#
    @detect_taps.setter
    def detect_taps(self, value):
        self._detect_taps = value
        try:
            self._lis3dh.set_tap(value, 80, time_limit=4, time_latency=17, time_window=110)
        except AttributeError:
            pass
        self._last_tap = False```
solar whale
#

Gotta run - talk to everyone later.

idle owl
tidal kiln
#

i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)

raven canopy
#

RE: Google SoC - definitely an OS who's who list of participants for last year. Python participated, as well as BeagleBone, so there is some relevance for CPy. Thought for discussion: if Adafruit/CPy were to apply to participate, would a discussion be needed/desired with the MPy guys? I may be closer related to the student side in GSoC, so I'm not advocating either way.

stuck elbow
#

@raven canopy I asked Damien last year about gsoc, but by the time we got to it it was already too late to apply - but the conclusion was that he doesn't mind doing it if someone will do all the paperwork for it

tidal kiln
idle owl
#
cpx.detect_taps = 2
while True:
    if cpx.tapped:
        print("tapped")
stuck elbow
#

I have to run

tulip sleet
#

bye

idle owl
#

later!

slender iron
#

@tulip sleet and @idle owl I'm back

idle owl
#

Have a lovely lunch?

slender iron
#

yup! now I'm full

#

wanna chat?

idle owl
#

Sure

#

I'm going to finish this loudly wrapped chocolate first

slender iron
#

haha

slender iron
#

@tidal kiln what are you up to?

tidal kiln
#

playing with accelo on cpx

slender iron
#

what are you going for? sounds like I missed some conversation about it when I was at lunch

opaque patrol
#

Has anyone worked on converting the Circuit Playground Accelerometer Mouse Example to CircuitPython yet?

tidal kiln
#

at this point i'm just testing it's behavior

slender iron
#

got a link @opaque patrol ?

#

kk

tidal kiln
#

but yah, dan, kattni, and i had a big follow on discussion w.r.t tap detect

opaque patrol
#

Its in the Arduino Example list when you install Circuit Playground, give me a minute and I will see if I can find it on github

tidal kiln
opaque patrol
slender iron
#

thanks!

opaque patrol
#

@slender iron I already created a color_sense version in circuit python, thought i would tackle some more

slender iron
#

great!

slender iron
#

<@&356864093652516868> Here is the recording from the meeting today: https://youtu.be/vp5_u3oV9Ro We'll do our next meeting for those who are available on Thursday December 28th at 3pm Pacific / 6pm Eastern here on Discord. Have a great holidays and new year!

Join here for the chat all week: http://adafru.it/discord The weekly happens normally at 2pm ET/11am PT on Mondays. Check the #circuitpython channel for noti...

▶ Play video
slender iron
tidal kiln
#

@idle owl been any further discussion on tap?

idle owl
#

Yes.

#

We're chatting now, you want to chat?

#

vid

tidal kiln
#

don't need to if you think you're getting it done. don't need to get too many cooks.

idle owl
#

Ah ok. np

#

Yeah we have it sorted

tidal kiln
#

cool.

opaque patrol
idle owl
#

@opaque patrol Have a few minutes for a chat?

opaque patrol
#

@idle owl sure

idle owl
#

@opaque patrol I'm looking at your color sense code. This looks great! I changed the last bit to this: ```python
cpx.pixels.brightness = .2
verbose = False

while True:
if cpx.button_a or cpx.button_b:
verbose = cpx.button_b
time.sleep(.05) # debounce
if verbose:
print("button pressed")
while cpx.button_a or cpx.button_b:
time.sleep(.01)
r, g, b = sense_color(verbose)
print("({}, {}, {})".format(r, g, b))
cpx.pixels.fill((r, g, b))
else:
cpx.pixels.fill(CLEAR)

opaque patrol
#

@idle owl I think that will clear the pixels immediately after setting the color. What I can do is store the color variables and just update them on the button press

idle owl
#

Oh it does do that! I couldn't get it to work the other way though. I wonder what I was doing wrong?

opaque patrol
#

not sure, I am playing with it now and trying to see if I can add gamma correction to get a little closer to the color

idle owl
#

Oh! It's working for me now the way you had it. I see!

opaque patrol
#

I have the clear in the except block to clear if you hit ctrl-c, I plan to change that to clear on KeyboardInterrupt and another except block for other exceptions

idle owl
#

Ah ok

opaque patrol
#

If an exception is thrown with the current code, it will hide the error message

idle owl
#

Got ya. Yeah that could be frustrating 😃

opaque patrol
#
except KeyboardInterrupt:
    cpx.pixels.fill(CLEAR)
except Exception as e:
    print("Exception", str(e))
#

like this

idle owl
#

oh ok yeah

opaque patrol
#

you may need to adjust the brightness, with it set at .2, colors with all values below roughly 55 will not appear to work

idle owl
#

Right, I've run into that multiple times before I remember I can't set it to (0, 0, 10) with brightness set super low.

idle owl
#

@tulip sleet I'm testing AMG88XX. I'm getting an error - TypeError: 'float' object not iterable on the first print line:```python
import time
import busio
import board
import adafruit_amg88xx

i2c_bus = busio.I2C(board.SCL, board.SDA)
amg = adafruit_amg88xx.AMG88XX(i2c_bus)

while True:
for row in amg.pixels:
#pad to 1 decimal place
print(['{0:.1f}'.format(temp) for temp in row])
print("")
print("\n")
time.sleep(1)

tidal kiln
#

@idle owl what library is that?

idle owl
#

Thermal camera

#

amg88xx

tidal kiln
idle owl
#

Yeah I'm working off the PR version

tidal kiln
#

try this in repl, what does it show?

import busio
import board
import adafruit_amg88xx

i2c_bus = busio.I2C(board.SCL, board.SDA)
amg = adafruit_amg88xx.AMG88XX(i2c_bus)
amg.pixels
idle owl
#

[[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], 24.5, 23.0, 22.0, 22.75, 22.75, 22.5, 22.75, 23.0, 22.25, 22.5, 22.5, 22.25, 22.75, 22.75, 23.5, 23.25, 22.25, 22.25, 22.25, 22.25, 23.25, 23.5, 24.5, 23.25, 22.5, 21.75, 22.5, 22.25, 22.75, 24.0, 25.0, 23.75, 21.5, 22.25, 22.25, 22.5, 23.25, 23.75, 24.25, 24.25, 21.75, 21.25, 22.25, 22.25, 22.5, 22.75, 23.25, 22.75, 22.0, 22.0, 21.75, 21.75, 22.75, 22.75, 23.0, 23.0, 22.25, 21.75, 22.25, 21.75, 22.75, 23.0, 23.5, 24.75]

tidal kiln
#

yeah, the buffer is initialized to 0's and then appended to

idle owl
#

Ok.. so something is wrong with the code then? It's not appending properly?

tidal kiln
#

yah. think so.

idle owl
#
>>>```
#

but it's still giving me the error in the code

tidal kiln
#

yep. it's just a list, not a list of lists.

#

based on the code comment, looks like that was the intent. just need to add a little more code....

#

try this:

    @property
    def pixels(self):
        """Temperature of each pixel across the sensor in Celsius.
           Temperatures are stored in a two dimensional list where the first index is the row and
           the second is the column. The first row is on the side closest to the writing on the
           sensor."""
        retbuf = []
        buf = bytearray(3)

        with self.i2c_device as i2c:
            for row in range(0, _PIXEL_ARRAY_HEIGHT):
                rowbuf = []
                for col in range(0, _PIXEL_ARRAY_WIDTH):
                    i = row * _PIXEL_ARRAY_HEIGHT + col
                    buf[0] = _PIXEL_OFFSET + (i << 1)
                    i2c.write(buf, end=1, stop=False)
                    i2c.readinto(buf, start=1)

                    raw = (buf[2] << 8) | buf[1]
                    converted = _signed_12bit_to_float(raw) * _PIXEL_TEMP_CONVERSION
                    rowbuf.append(converted)
                retbuf.append(rowbuf)

    return retbuf
idle owl
#

Ah! Yah!

tidal kiln
#

works?

idle owl
#

Yep!

#

My hands are apparently so cold, I had to grab someone else to make sure it was actually working 😄

tidal kiln
#

see the issue?

idle owl
#

I... don't

tidal kiln
#

who wrote the original?

idle owl
#

Looks like Dean Miller

tidal kiln
#

i'm mean that PR version

idle owl
#

Scott

tidal kiln
#

need to talk to him about it, cause he's doing some changes and not sure what his intent was

idle owl
#

Ok

tidal kiln
#

but looks like Scott wants to make that more like a 2D array (which makes sense):
[ [value value value ... ], [value value value ...], etc...]
like row,col

idle owl
#

Yeah

tidal kiln
#

but not sure why he needed to init it to all zeros, and he can probably come up with a more clever way of creating the retbuf list

#

mine was just a simple fix / hack

#

and then you were getting that error because this:

    for row in amg.pixels:

was returning a float, instead of a list of floats

idle owl
#

Oh ok

tidal kiln
#

and then you were trying to iterate on that float:

        print(['{0:.1f}'.format(temp) for temp in row])
idle owl
#

Do you want to review as well? Otherwise I can do line by line and relay what we talked about.

tidal kiln
#

you can do it

idle owl
#

Ok

tidal kiln
#

guess it's kind of a question back to scott, cause i'm not sure what he's was trying to do.

idle owl
#

Yeah I'm going to request changes and let him respond

tidal kiln
#

since he pre-allocated the buffer, maybe he intended to directly index things instead of using .append? dunno.

#

like retbuf[row][col] = converted or something

idle owl
#

I'm going to tag you in fyi since you helped.

tidal kiln
#

k

#

interesting...

>>> buf = [[0]*4]*4
>>> buf[1][3] = 'foo'
>>> buf
[[0, 0, 0, 'foo'], [0, 0, 0, 'foo'], [0, 0, 0, 'foo'], [0, 0, 0, 'foo']]
>>> 
#

updates all of them.

idle owl
#

hmm

stuck elbow
#

yes, the * operator doesn't make copies

#

it repeats a reference to the same object

#

you want:

buf = [[0] * 4 for _ in range(4)]
#

what you did is the same as:

x = [0] * 4
buf = [x, x, x, x]
tidal kiln
#

thanks @stuck elbow , now if i can just remember that!

timber mango
#

hi all, has anyone had a problem where code.py has become corrupted and is unreadable? I've tried deleting it, but that doesn't work. Even tried reflashing the circuitplayground, the file is still there after, and still can't be deleted or edited

idle owl
timber mango
#

perfect, thanks!

#

yay, back to coding, thanks kattni

idle owl
#

Yeah for sure!

umbral dagger
#

@timber mango You can also end up in a situation where the CICUITPY drive is read only. The flash erare & reinstall circuit python works to fix that as well.

#

@timber mango Loading an arduino sketch and then reinstalling circuit python seems to work in many cases as well.

timber mango
#

Keep in mind the SPI flashROM is a separate chip and is often ignored by the SAMD21G18A microcontroller. That's why its contents persist even after loading an Arduino sketch, 'on top of' a CircuitPython .UF2 boot file -- the Arduino sketch completely ignores the SPI flashROM chip, unless you specifically tell it not to ignore it, in some way.

umbral dagger
#

Right... i was thinking of non-external flash boards.

timber mango
#

I'm still pleased and surprised every single time I find that my files have remained present on the SPI flashROM of an Express target board, after a major operation (such as loading a different .UF2).
It hasn't sunk in yet, that my files are going to be there, unless something unplanned has happened.

manic glacierBOT
stuck elbow
#

@timber mango I think it's a good practice to be prepared for them to be gone, though

manic glacierBOT
#
[adafruit/circuitpython] New branch created: test\_2\.x
manic glacierBOT
pastel panther
#

@slender iron I was finally able to compile 3.0 for my m4 board, however when I load it my dotstar turns purple and I have no MSC or CDC; since it's not flashing after the purple, I'm assuming it's the bootloader and not CP that is setting it?

slender iron
#

@pastel panther yeah, that sounds suspect

#

I'm not sure why it'd be purple. I think that might be an arduino thing

pastel panther
#

Someone might call it pink?

slender iron
#

¯_(ツ)_/¯

pastel panther
#

I should look at uf2-samd for a decoder ring?

slender iron
#

I'd expect it to be red or green if actually in the bootloader

pastel panther
#

calling gdb with firmware.elf doesn't seem to do what I want. Is there something I can do to get source lines showing? gdb is saying No symbol table is loaded

slender iron
#

make sure you build it with DEBUG=1

#

so make DEBUG=1 BOARD=<your board name>

pastel panther
#

right

#

ah, this is more informative: HardFault_Handler () at supervisor/port.c:264

#

backtrace is only so useful; @slender iron The '51 datasheet mentions a Embedded Trace Buffer which I assume is different from the Micro Trace Buffer so the MTB setup in your GDB tutorial won't apply here?

slender iron
#

nah, I haven't been able to get it going

#

try breaking at main() and see if it gets that far

idle owl
#

@slender iron With AMG88XX, I'm now getting IndexError: list index out of range with the example. Traceback (most recent call last): File "code.py", line 10, in <module> File "adafruit_amg88xx.py", line 164, in pixels File "adafruit_amg88xx.py", line 164, in pixels IndexError: list index out of range

slender iron
#

😦

#

my row/col must be backwards

idle owl
#

what do I need to change to test that

slender iron
#

it looks right to me still

#

did you get the absolute latest?

manic glacierBOT
slender iron
#

I amended the commit twice

idle owl
#

I can try again

pastel panther
#

@slender iron yea, it's getting to main; I'll have to play around with it after work. On a positive note, it would seem that maybe (maybe?) the dotstar changes I wrote worked?

idle owl
#

But I am pretty sure I did

slender iron
#

@pastel panther maybe, it might be whats crashing 😃

#

@idle owl whats the pre-allocation line for you?

pastel panther
#

@slender iron that's where the smart money is ;P

idle owl
#

Yeah same. I had the latest.

#

I'm not sure what line you mean

pastel panther
#

thanks for the help 👋

slender iron
#

should retbuf = [[0]*_PIXEL_ARRAY_WIDTH for _ in range(_PIXEL_ARRAY_HEIGHT)]

#

np @pastel panther good work!

idle owl
#

retbuf = [[[0]*_PIXEL_ARRAY_WIDTH] for _ in range (_PIXEL_ARRAY_HEIGHT)]

#

extra brackets in mine

slender iron
#

yeah, I fixed that 😃

idle owl
#

oi ok, I seriously just refreshed, copied and pasted

#

trying again.

slender iron
#

yeah, I was sneaky and amended. you just were super fast

idle owl
#

KEEP UP

#

😉

#

Ok I see the fix now. Testing

#

There it is!

#

Nice work 😃

slender iron
#

👍

idle owl
#

I went through and found all the circuitpython-travis-build typos left and fixed them. There's a PR in for one of them that I didn't catch until after I merged it, so I went and found all the rest, fixed and committed them.

slender iron
#

thank you!

idle owl
slender iron
#

merged

idle owl
#

Released

#

26 done, 20 left to test/PR. 😃

slender iron
#

😃

manic glacierBOT
idle owl
#

@slender iron adafruit_irremote isn't autogenerating the zip/mpy files, and isn't autobundling, is that intentional?

slender iron
#

nope

#

will look now

idle owl
#

Ok

idle owl
#

Oi, see? Same exact thing that it caught the other day. That must have been added in the update.

slender iron
#

it must skip the deploy when the build fails

idle owl
#

Ah ok

#

JP's code stopped working. I just redid it to not use CPX at all, and it's working again.

slender iron
#

define stopped working

idle owl
#

Every time you press a button on the remote: Memory allocation failure: 512 bytes and it would pick up 3 pulses only, fail to decode, and repeat because you wrote it into the code to continue after a memory allocation failure.

#

I had it happen before he did but assumed it was me.

slender iron
#

right

idle owl
#

He messaged last night and said it wasn't working anymore.

#

Same issue for him

slender iron
#

did he send you the updated version?

idle owl
#

Unless you posted another version, yes

#

You had "here is the latest version that I got working" or something like that?

#

That's what I was using. From a gist.

slender iron
#

right, I imagine he changed it though

idle owl
#

He didn't imply that he did

slender iron
#

or did you just use it with 2.2?

idle owl
#

Nope

#

2.1 because that's what he was using

slender iron
#

there had to be a reason it stopped working

#

it worked most of the time for me

idle owl
#

Express class update?

#

That's the ony thing I can think of that changed.

slender iron
#

yeah, perhaps

idle owl
#

I mean it's back and works great without using cpx

#

Which is what I altered before you posted a better option with the memory allocation exception

slender iron
#

ya, with less code loaded

idle owl
#

He's ok with running it without cpx afaik

slender iron
#

kk, thanks for helping him out!

idle owl
#

I specifically loaded it all fresh - that's how I noticed the lib wasn't in the bundle

#

so double bonus discovery there.

slender iron
#

it not being in the bundle could be a different problem

idle owl
#

Ah ok

#

I'll have to mention that to him, since at the moment the only way to get the .mpy version of it is to make it yourself.

slender iron
#

are you gonna try fixing the irremote build or should I?

idle owl
#

oh, I can try, but I'll need help. I fixed that issue in another lib the other day but I doubt it's exactly the same issue.

slender iron
#

I'll take a look

idle owl
#

ok

slender iron
#

I haven't seen that issue so it'll be a good thought process

idle owl
#

I had a lot of help on the lib I fixed before. If you search for inconsistent-return-statements in discord you'll find the convo if you want to see it

slender iron
#

looks like it was just confused by the infinite loop in r ead_pulses

idle owl
#

ah

idle owl
#

Merged. Want me to try another release?

slender iron
#

yes please

idle owl
#

(for the record, I tested it first)