#circuitpython-dev

1 messages Β· Page 226 of 1

craggy harbor
#

πŸ˜‚πŸ˜‚πŸ˜‚

tidal kiln
#

but i think just not connecting them is easiest

craggy harbor
#

Easier than time travel yes πŸ˜„

#

But would they interfere if I just don’t press them?

tidal kiln
#

or, yah, just don't press them

solar whale
#

@slender iron its working -- slowly -- loaded 3 fonts ...

slender iron
#

ya, its got lots of room for speed-ups

#

any help is appreciated πŸ˜‰

solar whale
#

OK -- now that I have it running -- I'll play ... thanks

slender iron
#

thank you!

solar whale
#

is that from master or a local build?

slender iron
#

local

#

there should be optimizations that can be done in the python libs

#

will push my code once its pieced back together

solar whale
#

ok -- is there a font you recomend for testing?

slender iron
#

not really. I just picked random ones

solar whale
#

ok me too -- that was cherry ...

pastel panther
#

@solar whale did you get Limor's request/socket updates working? I'm trying the cheerlights demo and getting an empty buffer after a socket read

solar whale
#

let me check I -- did the countviewer -- may not have tried cheerlights but I thogut I did -- just a sec

#

@pastel panther works for me

pastel panther
#

I don't have an rtspin wired up so maybe that's the issue?

solar whale
#

yes -- you need that

pastel panther
#

well there ya go; I'll have to fix it tonight as it's all bundled up in a case atm and I'm away from my bench

solar whale
#

you could try dropping the baud rate way down

#

like 9600

pastel panther
#

in other news either I'm doing something wrong or the am2320 driver needs some work

#

hmm

solar whale
#

on what board

pastel panther
#

ooh, lowering the baud rate at least got something back

solar whale
#

the am2320 is odd becasue of its wakeup -- I2C scan may not see it

pastel panther
#

it works ok as long as I don't grab temp + hum too quickly

solar whale
#

with what board?

pastel panther
#

a rev b metro m4

solar whale
#

😬

pastel panther
#

haha

#

I mean, it works, right?

slender iron
solar whale
#

do you have latest libraries?

slender iron
#

it's working towards dynamic display support and 8 bit parallel support

#

gonna go run now since the suns out

#

back later!

solar whale
#

enjoy!

pastel panther
#

@tough sun ya, pretty recent at least. I flashed it with 4.0. alpha whatever is recent the other day and used the libs I downloaded like a month or so ago?

solar whale
#

what errors do you get

pastel panther
#

I forgot, lemme check; if I remember correctly it was on the "wakeup" read/scan

#
>>> print("%f %f"%(sensor.temperature, sensor.relative_humidity))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_am2320.py", line 136, in relative_humidity
  File "adafruit_am2320.py", line 123, in _read_register
  File "adafruit_am2320.py", line 110, in _read_register
  File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 5] Input/output error
>>>
solar whale
#

@pastel panther hmmm -- been awhile since I tried one -- I'll dig it out and see if I can reproduce -- you probpably should file an issue

craggy harbor
#

@tidal kiln okay thank you very much πŸ˜„

pastel panther
#

will do; I was going to poke into it a bit more to see if I could fix it but I suppose I should probably open a ticket in the meanwhile

tidal kiln
#

@craggy harbor np. good luck.

craggy harbor
#

Thanks! πŸ˜ƒ

solar whale
#

@slender iron I dowlnoaded,built and tried your latest rework_displays on my feather m4 -- boots to safe mode 😦

manic glacierBOT
solar whale
#

@pastel panther am2320_simpletest.py (from the lib example) works on my metro_m4_express (newer one) ```import time
import board
import busio
import adafruit_am2320

create the I2C shared bus

i2c = busio.I2C(board.SCL, board.SDA)
am = adafruit_am2320.AM2320(i2c)

while True:
print("Temperature: ", am.temperature)
print("Humidity: ", am.relative_humidity)
time.sleep(2)

pastel panther
#

@solar whale try this:

print("%f %f"%(sensor.temperature, sensor.relative_humidity))
solar whale
#

ok -- just a minute

pastel panther
#

I just did some more tests and it is ok with a .018 delay between reads but not a .017

solar whale
#
>>> 
>>> import am2320
23.799996 31.299996
22.699997 31.099999
22.600000 30.799997
#

make sure you have lates lib -- there were changes made to fix timing -- it does not really read again when you query temp then humid.

pastel panther
#

ok

solar whale
#

@pastel panther sorry -- I was thinking of the DHT11 - am2302 regarding the timing -- not sure about the i2C code -- it is different, but it works on my metro M4

pastel panther
#

@solar whale just updated the lib and still get the error. You tried with no/very small delay between reads?

solar whale
#

I have 2 sec betweeen reads --uses your line to read temp/hum -- you can't poll it taht fast for full reads

pastel panther
#

you mean because of the sleep in _read_register?

#

or is it just 'known' that you have to use the driver with a delay between reads?

solar whale
#

looking for specs

pastel panther
#

yea, I had to hold my computer upside down and balance on one foot to try and understand that datasheet

raven canopy
#

Welcome to AMxx/DHT Funtown! πŸ˜„

solar whale
pastel panther
#

oh hah, I had found an "english" one somewhere

main meteor
#

Yeah "the bus is only allowed to hang a product" is an odd comment in a datasheet.

solar whale
#

for the "one-wire" mode like the dht11 it say 2 seconds betwen reads bit it is not specified for I2C -- still I don't think the sensor can handle real fast sampling.

pastel panther
#

yea, seems like

#

methinks it can go 'fast enough' for my purposes at least

solar whale
#

especially with its funky wakeup

#
measurement is completed, the recording temperature and humidity values, then completed a
communication, the sensor automatically goes to sleep; therefore, as long unread sensors
continuously read the second sensor, in the second reading of the temperature and humidity back to
the latest value (minimum interval of continuous reading 2S)```
#

that is in the I2C section

#

I think 2 Sec is the limit -- your mileage may vary πŸ˜‰

#

but I thought it would just report the old value, not barf....

pastel panther
#

wat

main meteor
#

I had a hardware random number generator like that: if you read it too fast, it just gave the previous "random" number again.

slender iron
#

@solar whale not surprising. I only got it compiling

pastel panther
#

@main meteor seems like a great opportunity for a security bug

main meteor
#

Ya THINK? The US government approved this travesty too!

solar whale
#

I have to go for awhile -- am2320 makes my head hurt πŸ˜‰

pastel panther
#

@tough sun awwwwe yesssss
def request(method, url, data=None, json=None, headers={}, stream=None):

#

@solar whale thanks for the help!

solar whale
#

Glad to help -- good luck!

tulip sleet
#

@slender iron I added an mp_isinstance() in my own branch, which does the subclass checking of mp_instance_cast_to_native_base() and just returns a bool. Convenient for arg validation. Will be in my next PR.

manic glacierBOT
tough flax
#

Great news: I got cp driving the Xbox adaptive controller! I’ll hopefully show it off tonight in show and tell

#

Thanks @tulip sleet and @split ocean

split ocean
#

Fantastic!

tough flax
#

Basically they won’t support composite hid

#

So I stripped the others out on my fork

#

I hear @slender iron Is working on something to fix this

#

Someway to say which profiles are exposed

slender iron
#

I'm not working on usb at the moment

#

I would like to allow dynamic descriptors but its not coming soon

#
  • from me at least
tough flax
#

Gotcha

#

Well we might still wait on a guide until they fix their firmware or we add that πŸ˜ƒ

solar whale
#

@pastel panther FYI -- just ran the am2320 test with no delay on my metro_m4 and it works OK - ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-120-g573c6d60b on 2019-01-11; Adafruit Metro M4 Express with samd51j19

import am2320
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
It does not update every sample but it runs import time
import board
import busio
import adafruit_am2320

create the I2C shared bus

i2c = busio.I2C(board.SCL, board.SDA)
am = adafruit_am2320.AM2320(i2c)

while True:
print("%f %f"%(am.temperature, am.relative_humidity))

raven canopy
#

@slender iron @tulip sleet @pastel panther, and any other datasheet wizards, can i get some clarification on my understanding of this. in SAMD51 TC->CTRLBSET.CMD register description, there is this tidbit:

The commands are executed on the next prescaled
GCLK_TC clock cycle.

I understand that to mean that if a command is set, the result won't be immediately available (like the very next line of code, in an interrupt handler). for detail, to read the COUNT register it has to be sync'd with the READSYNC command, since the the APB and GCLK are asynchronous.

slender iron
#

ya, that's my understanding

pastel panther
#

sounds right

raven canopy
#

k. i was hoping i was wrong. πŸ˜„

pastel panther
#

@solar whale Hmmmmm......

#

@solar whale I'll perhaps scope it to see if there is something wonky going on with my setup

#

Thanks for the test

solar whale
#

@pastel panther how did you get a CP 4.0 build for the revB board?

pastel panther
#

I hacked it together from an old commit

solar whale
#

hmmm -- do you have any other M4s to try it on?

pastel panther
#

ya, will do

manic glacierBOT
exotic pumice
#

have you guys ever had issues with CPOL and SPI polarity?

#

I'll have to try a register dump I guess

#

to make sure cpol is actually cleared

exotic pumice
#

prepare for star flood

tough pier
#

Newbie looking for some help again. I have this code that danh kindly provided and works great for 1 switch. when toggle 1 is turned on I get keycode A like I should, the light turns green and when I flip it off I get CTRL SHIFT A and the [5 ] light goes off. So far so good. As you might imagine, I have a bunch of these toggles. As soon as I add anything else, in this case ifr, everything gets weird and things seem random.

Here is my code:
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_circuitplayground.express import cpx

kbd = Keyboard()

apu = digitalio.DigitalInOut(board.A1)
apu.direction = digitalio.Direction.INPUT
apu.pull = digitalio.Pull.UP
ifr = digitalio.DigitalInOut(board.A5)
ifr.direction = digitalio.Direction.INPUT
ifr.pull = digitalio.Pull.UP

cpx.pixels.brightness = 0.1

while True:
if apu.value:
while apu.value:
pass
kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
cpx.pixels[5] = (0, 0, 0)
if not apu.value:
while not apu.value:
pass
kbd.send(Keycode.A)
cpx.pixels[5] = (0, 200, 0)
if ifr.value:
while ifr.value:
pass
kbd.send(Keycode.L)
cpx.pixels[6] = (0, 0, 0)
if not ifr.value:
while not ifr.value:
pass
kbd.send(Keycode.I)
cpx.pixels[6] = (0, 200, 0)

pastel panther
#

@tough pier is this for an aviation related project?

#

@tough pier I don't think that style of check for toggles will work with more than one, at least as written

#

@tough pier Once the program gets into one of the while <statement>: pass loops, it's going to stay there until <statement> isn't true anymore, which means it's never going to get down to the checks for ifr until it has determined the state of apu and then the state of apu has changed

#

If I had to guess at the behavior, it's probably only seeming like it will only react to the behavior of one toggle at a time and will alternate between which toggle it's responding to

#

to handle more than one toggle, you can't have the while <statement>: pass sections; you'll have to keep track of the state of each toggle and then do something when the current state of the toggle is different from the previous state of the toggle

manic glacierBOT
tough pier
#

@pastel panther yes this is definitely an aviation project...

pastel panther
#

controlling an app on an ipad or something?

tough pier
#

@pastel panther actually using cpx to help real world toggles in my f18 cockpit

pastel panther
#

I assume you don't mean a real, actual f18?

tough pier
#

Sort of. It's an f18 cockpit for my f18 sim

pastel panther
#

That is cool as heck

#

I saw someone do something similar with an airliner a while back

tough pier
#

It is pretty awesome. I see what you mean by the loops. What is the right wY

pastel panther
#

Somehow I assume a single CPX isn't going to cover all the toggles 🀣

#

let me see if I can find a code example

tough pier
#

No, but it'll handle the real important ones

pastel panther
#

I would be more than happy to help you figure out whatever you want to do hardware wise

#

but lets figure out the code first

raven canopy
#

i would use a last_value to compare to. that way it doesn't always send the keycodes.

tough pier
#

That'd be great

#

Keep in mind I'm a newbie... Code examples would be most welcome

pastel panther
#

I know this is a common problem so I'm trying to find something that already exists

raven canopy
#

something like this

apu_last = None
while True:
    if apu.value not apu_last: # we have a new value
        if apu.value:
            kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
            cpx.pixels[5] = (0, 0, 0)
        else:
            kbd.send(Keycode.A) 
            cpx.pixels[5] = (0, 200, 0)
        apu_last = apu.value # set the new last value
pastel panther
#

ya, basically that

#

here I thought I was saving time

raven canopy
#

lol. you were!

pastel panther
#

sure, sure

tough pier
#

so that code section would be repeatable for 7 or 8 switchwes?

pastel panther
#

yes

raven canopy
#

can be. but understand that the more you add into a single loop, the slower the loop cycles.

pastel panther
#

I don't expect that 8 switches would be noticeably slow

#

Ah, I get what you're saying

#

steps aside

raven canopy
#

no, not too slow. but, there are faster ways i imagine. like using sets and fancy stuff. πŸ˜„

tough pier
#

these switches are activated once an hour or so, so i don't image a slow loop would mattter

raven canopy
#

ahh. well, yeah, definitely plenty of cycles for that.

tough pier
#

Ok, I'm going to load that up and see what happens, thanks

pastel panther
#

what sim are you using?

tough pier
#

syntax error...

#

VRS Superbug

#

and p3d

pastel panther
#

you can post the error or code in triple back ticks
```
code/error here
```

#
it will render like this
tough pier
#

while True:
if apu.value not apu_last: # we have a new value
if apu.value:
kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
cpx.pixels[5] = (0, 0, 0)

#

whoops

pastel panther
#

(it's a bit trigger happy)

tough pier
#

yea, ya think

#

How do I copy MU error codes

pastel panther
#

I don't use mu myself; you can't just select and copy?

#

you can also post a screenshot if you can't figure it out

tough pier
#

everything but the error codes

pastel panther
#

hmm, strange

raven canopy
#

are the errors in the editor window, or the serial window?

tough pier
pastel panther
#

change the not to !=

raven canopy
#

ahh.. its the # comment after the first if...:

tough pier
#

got it

raven canopy
#

i can't get that syntax error to go away. but i can't for the life of me understand what Mu doesn't like about it. 🀷

#

oh, guess Mu doesn't like not. good call @pastel panther.

pastel panther
#

python3 doesn't, apparently, at least not in an if:

>>> if True not False:
  File "<stdin>", line 1
    if True not False:
                    ^
SyntaxError: invalid syntax
>>> if True != False:
...     print("hi")
...
hi
>>> if (True not False):
  File "<stdin>", line 1
    if (True not False):
                     ^
SyntaxError: invalid syntax
raven canopy
#

huh. looky there.

exotic pumice
#

I think it's is not maybe

#

or I made that up in my mind

tough pier
#

@raven canopy also code not working

raven canopy
#
>>> if True is not False:
    print("sajattack wins!")

sajattack wins!
#

i totally forgot the is.

exotic pumice
#

yay

raven canopy
#

@tough pier is it giving an error, or just not working?

tough pier
#

just not working

#

my original problem was just trying to send 1 keycode and it has snowballed

raven canopy
#

that's usually how it goes. πŸ˜†

pastel panther
#

you must go deeper to find your way out

tough pier
#

When the switch is off it is in a low voltage state, whn on I'm applying 5v to A1

exotic pumice
#

idk if anyone saw after all the star spam but I'm having a weird issue with CPOL. It's set to 0 (confirmed via an openocd register dump) and yet my logic analyzer is showing active high not active low

raven canopy
#

@tough pier on a CPX?

tough pier
#

yup

raven canopy
#

if so, i wouldn't use 5v input into it. its a 3.3v tolerant device, and 5v might cause it to be very upset.

tough pier
#

I need 5v to make the lighted switch work, when the switch closes it lets the 5 v pass through

pastel panther
#

also the code was using the internal pullups so the switch should be grounding the pin

tough pier
#

ah, ha

raven canopy
#

do you have any resistors? you could put in a voltage divider. it won't last long getting 5v in.

tough pier
#

I have two types of switches one allows voltage to pass these are lighted switches. All the others go to ground

pastel panther
#

@tough pier you're saying you need to control 5v to go to the light?

tough pier
#

I need the 5v output from the cpx to supply voltage to light the led in the switch and that does work fine

pastel panther
#

How are you supplying 5v? I the CPX can only output 3.3v to a pin as far as I recall. It would probably still be enough to light up an LED, just not as brightly

tough pier
#

This is plugged in and powered via usb and VOUT passes whatever the highest voltage is

#

which is 5 v

raven canopy
#

yeah, Vout is 5v.

pastel panther
#

true

tough pier
#

I just may need to figure out how to pull the switch to ground

pastel panther
#

how is it wired now?

tough pier
#

can we talk or do we have to type?

pastel panther
#

we can talk if you can wait a minute

tough pier
#

sure thing, lots of typing to convey this wiring stuff

pastel panther
#

do you have any pictures?

raven canopy
#

i'm off to bed. i'll be looking for signs of success in the morning! πŸ˜„ πŸ’€

pastel panther
#

nite @raven canopy

tough pier
#

night.... taking pics now

#

Off

pastel panther
#

I gotta go afk for a minute, house+rain problems

tough pier
#

On

#

Backside

pastel panther
#

@tough pier ok, I'm back; crisis averted

tough pier
#

hooray... I'm still trying to sort out the right way to do this

#

I may have to go afk for a couple too... just not sure when...

pastel panther
#

I can talk for a minute or two if you're available; we can use the General channel

tough pier
#

ok, how do we do it

pastel panther
#

you have a headset?

tough pier
#

I've got a headset aand its oon

pastel panther
#

you can click on the little gear icon at bottom left, to the right of your screen name

#

then go to voice and video to test that your headset is working

tough pier
#

looks good

pastel panther
#

once you've checked it, just click on the general channel and you should connect

tough pier
#

I did it but didn't see / heart you

pastel panther
#

I just joined

#

just to be clear, it's the 'General' channel under the "voice" section which is below the rest of the channels

tough pier
#

ahhhh

pastel panther
#

@tough pier just hit me with a DM when you're back

pastel panther
#

@tough pier I'm going to have to head to bed before too long

manic glacierBOT
manic glacierBOT
manic glacierBOT
marble hornet
#

TAHNK YOU EVERYONE FOR MAKING CP SO EASY AND WIDLEY COMPATIBLE. IT IS THE BEST EXPERIENCE I HAVE HAD IN ELECTRONICS !

plucky flint
#

@marble hornet amen

umbral dagger
manic glacierBOT
#

Yeah, it is. Should we add a standard way to let people easily add custom C functions and put this in there as an example. Maybe some other nifty examples that don't belong in the core.

The learning curve to add modules and functions is pretty high right now, but having a custom module that's present in self-built CPy could ease that. That gives us an easier path for people to contribute things like FFTs and the like.

Then someday we can get dynamic loading :-)

cold marlin
#

quick question is there a guide for putting circuit python on the HCC that was shown in a previous video ?

marble hornet
#

for the mcp_sram library in the epd how do i check the length of the memory?

manic glacierBOT
pastel panther
#

@cold marlin do you mean the HCC module by Sean Hodgins?

manic glacierBOT
manic glacierBOT
meager fog
#

@umbral dagger its fairly low level so no plans to support neopxl8

#

(if you wanna try, we'd be happy to help!)

umbral dagger
#

@meager fog I'll put it on my list πŸ˜ƒ

cold marlin
#

@pastel panther yes thats the one, i have 10 of them, would love to port them all to circuit python πŸ˜ƒ

manic glacierBOT
pastel panther
#

@cold marlin It's certainly possible but it will probably require a JLink

manic glacierBOT
pastel panther
#

@cold marlin There is a guide that broadly speaking covers how to do it. Let me find it

cold marlin
#

@pastel panther somone has done it, it was featured in an email about 2 weeks ago, just couldnt any guide on how to follow her foot steps πŸ˜ƒ

pastel panther
cold marlin
#

thanks

#

@pastel panther thanks

pastel panther
#

I've done several custom CP boards including one very similar to the HCC, so I can help if you get stuck

cold marlin
#

@pastel panther thanks i will look over the directions tonite

#

Was also curious if anyone ported to STM32 like bluepill, i have a bunch of those sitting around i would love to put to use.

#

Shouldnt be too hard as someone did port micropython to that board

pastel panther
#

Not that I know of but I've heard it said that it wouldn't be that hard

#

right

#

The hard part is in making sure all the peripherals work and the USB support

cold marlin
#

oodles of ioo

#

IO

pastel panther
#

cool

cold marlin
#

I used this one Logisaf ST-Link V2 Mini STM8 STM32 Emulator Downloader Programming Unit

#

@pastel panther for no other reason than the tutorial i followed was calling for it lol.

pastel panther
#

@cold marlin I think that should work, it looks like it speaks SWD, so you should be able to use it in place of the JLink to load the .bin for the bootloader

cold marlin
#

@pastel panther cool, i will get it on my todo fun list, and document them both as i have 4 bluepill and 4 of the vet6 boards (and 4 IL tft's to go with those vet6 boards)

pastel panther
#

Apparently I spoke too soon; it looks like there is a way to upload uf2 using a custom arduino sketch

cold marlin
#

lol

meager fog
#

@solar whale wanna try the new requests?

solar whale
#

@meager fog will try this evening -- I did run some tests from your repo a few days ago worked great -- I will submit new post example PR tonight if you want

marble hornet
#

but is library only ever returns 0

main meteor
#

Hmm, did you write anything to the memory first?

marble hornet
#

Yes

#

@main meteor but it acts the same when it is unplugged as when it is plugged

marble hornet
#

here is what i have hooked up:

#

cs to D0

#

pin2 to miso

#

pin 4 to gnd

#

pin 7 and 8 to 3v3

#

pin6 to sck

#

pin 5 to mosi

#

does that sound correct ?

modest atlas
#

Can someone put me in right direction for some help with some code, I'm using a Circuitplayground Express, need button A to trigger a relay to flash on/off non stop untill button B is triggered , I can get button A to trigger the relay but dont know how to exit that loop when button B is triggered

marble hornet
#

can you post your code?

manic glacierBOT
marble hornet
#

@modest atlas are you putting the value low then using the break command ?

pastel panther
#

@modest atlas One option is to have button b being pressed set a variable that is checked for and break out of the loop when set:

>>> b_pressed = True
>>> while True:
...     print("hi")
...     if b_pressed:
...             break
...     print("didn't break")
...
hi
#

You'll then need to set b_pressed to false once you're out of the loop so it doesn't break out again

#

(or set b_pressed to the button value at the beginning of every loop)

marble hornet
#

do you need to do other things after the relay is high or just wait until b is pressed ?

modest atlas
#

Would like button_A to trigger the relay on and off forever untill button_B is triggered

#

Sorry stepped away from computer to share my code so far

#

And after button_B stops the relays from "flashing" reset and look for button_A again

marble hornet
#
apin = input blah
bpin = input diff blah
relaypin  = output diff diff blah
relaypin.value = 0
while True:
    if pina is pressed:
        turn relay on
    elif pinb is pressed:
        turn relay off
``` is that what you are thinking  ?
#

sorry for delay

manic glacierBOT
modest atlas
#

Yes but would like pina to flash on and off

marble hornet
#

as

#

ah!

#

gimma a mo

meager fog
#

@solar whale yah if you want to try to add POST example back, you should be able to use the plain adafruit io API now!

lusty bough
#

Hi, I am having some trouble with circuitpython globals

#

I have a function that tries to update the values, but when I print them up, they are not updated

#

figured it out

broken blaze
#

my trinket M0 seems to run a different program when connected to the computer than when powered with a USB connected power

pastel panther
#

@broken blaze That is certainly strange. Are you using circuitpython? Can you share more details about the programs that are running in the different scenarios?

solar basin
#

@modest atlas

apin = input blah
bpin = input diff blah
relaypin  = output diff diff blah
relaypin.value = 0
flash = False
while True:
    if apin is pressed:
        flash = True
    elif bpin is pressed:
        flash = False
    if flash:
        # toggle relaypin
    # maybe some time.sleep(...) here?
#

@broken blaze my brothers name is Matthew Warren lol

broken blaze
#

it's pretty close to the original sample code that came included on the board. just runs through the color wheel on the LED.

#

πŸ˜ƒ there are a few of us out there

pastel panther
#

@solar basin That's about right but in the if flash block you'd need to check time.monotonic for elapsed time to know if it's time to toggle; sleeps will interfere with the button checks

broken blaze
#

when it's on a USB for power it jumps through some colors and then does some quick white blinks

#

status light shows solid green in either case

solar basin
#

@pastel panther that works too

modest atlas
#

Trying this now

solar basin
#

I was mostly pointing out that time might be a concern without taking away the adventure of figuring it out πŸ˜›

pastel panther
#

@broken blaze Unfortunately I have to run but Making sure you're on a recent version of CP is a good idea, and posting the code here in a backtick block will help others identify any potential causes of the strange behavior.

You can post code in a block like this:
```
code here
```
will get rendered like

code here
#

we really need a bot to post the code block example

modest atlas
#
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel

button_A = DigitalInOut(board.BUTTON_A)
button_A.direction = Direction.INPUT
button_A.pull = Pull.DOWN

button_B= DigitalInOut(board.BUTTON_B)
button_B.direction = Direction.INPUT
button_B.pull = Pull.DOWN

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

def flash(count, wait):
    for i in range(count):
        pixels.fill((255, 0, 0))
        pixels.show()
        time.sleep(wait)
        pixels.fill((0, 0, 255))
        pixels.show()
        time.sleep(wait)

def stop():
    pixels.fill((0, 0, 0))
    pixels.show()
    
    
blink = False
while True:
    
    if button_A.value:  # button is pushed
        blink = True
        
    elif button_B.value:
        blink = False
        
    elif blink:
        flash(100, .1)
#

still cant exit the loop with button_B

solar basin
#

@modest atlas the check for button press happens only between calls to flash, so a full run of flash happens then the button is checked for a microsecond and then another full run of flash

#

@modest atlas also, in elif blink I think you want just if there

broken blaze
#

strange. I just cleaned out some unused imports and deleted some of the setup of input/output lines from the sample code I wasn't using. and it fixed the issue

#

maybe the powerbank wan't giving it quite enough voltage to run properly

solar whale
#

@meager fog having a lot of trouble getting the imports to work with the new ESPATcontol examples -- how should it be installed?

modest atlas
#

@solar basin is there away around that

solar whale
#

@meager fog sorry -- I'm completlety confused trying to get teh examples to run -- imports keep failing - do you copy the adafruit_espatcontrol folder to your board or just the individual contents -- iI tried both, but keep getting import errors.

modest atlas
#

Want the flashing of the relay to stop soon as button_B is trighered

solar basin
#

@modest atlas incorporate the blinking code into the while loop... it's a bit more advanced, but that's probably what I'd do

#

You could put checks in the flash function too, but that starts to get a little more messy perhaps.

main meteor
#

I haven't tested this, but here's an attempt to do it with time.monotonic(): ```blink = False
state = False
next = 0
blinkrate = 0.1

while True:
if button_A.value: # button is pushed
blink = True

if button_B.value:
    blink = False
    
if blink:
  now = time.monotonic()
  if now > next:
    next = now + blinkrate
    if state:
      pixels.fill((255, 0, 0))
    else:
      pixels.fill((0, 0, 255))
    pixels.show()
    state = !state```
solar basin
#

@main meteor nice, exactly πŸ˜ƒ

main meteor
#

Might need to add some code to turn the pixels off when button B is pressed if that's desired

modest atlas
#

@main meteor IT IS

meager fog
#

@solar whale what are you getting?

solar whale
#

@meager fog I'm getting it sorted out, but have to add from adafruit espatcontol to many of the imports

#

Do you copy the folder or its contents to your bioard?

#

ok got webclient and cherelights sorted out -- back on track

meager fog
#

yah

#

sorry you do need that now

#

i forgot

#

i had to fix travis

solar whale
#

yup -- just add from adafruit_espatcontol to every import -- working now

modest atlas
#

@main meteor im lost

meager fog
#

@solar whale yay - if you can submit a PR - i forgot to fix tose up

solar whale
#

@meager fog np - I'll do it when I suubmit the post example.

meager fog
#

thanx

main meteor
#

Um, lost how?

solar basin
#

Does the WICED board work with CP?

raven canopy
#

the M0 will work, but no comms with the WICED chip. its basically a Feather M0 when using CP.

solar basin
#

Better off with the Argon then?

raven canopy
#

yeah. jerryn has gotten it to work using the new AT commands stuff.

solar basin
#

Right

#

@meager fog seems to be a bit of a mismatch between these two listings: https://www.adafruit.com/category/945 and https://www.adafruit.com/category/814

#

Confused me, I couldn't find the Prop-Maker in the first list

idle owl
#

@solar basin Email support@adafruit.com to let them know about your trouble finding that FeatherWing. There could be a reason for the difference, but if not, it's good to let them know so it can be fixed.

prime flower
#

@solar basin Argon or a Feather M4 and a ESP32 breakout

#

I've had success with an argon, I know jerryn's adafruit-io-connected-particle was (is?) successfully updating a feed

pastel panther
#

esp8266 breakout also works fwiw

#

I've used one with a metro m4

idle owl
#

@slender iron I'm not sure if the webhook on CircuitPython is working or not because I tried to test it by clicking "Redeliver" on a previous payload delivery, and it's failing to deliver. But it occurred to me that it maybe that you can't redeliver an old payload on a new webhook. So I was going to ask if you cared if I deleted the webhook and recreated it, but now I'm thinking maybe we wait until there's an actual trigger and see if it fails at that point. I'll keep an eye on it for now. If it fails on a new trigger, I want to try recreating the webhook at that point.

slender iron
#

webhook for what? RTD?

idle owl
#

Yes.

slender iron
#

I got a bunch of emails telling me to update them. haven't read the actual email yet though

idle owl
#

The email is RTD said it had to be reconfigured because of GitHub services being deprecated. There are simple instructions which I followed. But I think it needs a real trigger to try to send the payload again.

slender iron
#

k, I don't mind waiting on it then

idle owl
#

I have emails for other projects on RTD as well.

#

Ok.

slender iron
#

I'm focussed on display atm

idle owl
#

That's fine, I wasn't expecting you to do anything with this except give me the ok to do something with it. But now I want to wait, so that's where we're at.

slender iron
#

yup, happy to have you handle it πŸ˜ƒ

#

thanks!

solar basin
#

@slender iron any breakthroughs in displayio yet?

#

@idle owl will do

slender iron
#

@solar basin yup! lots of progress

#

you can connect up a display from circuitpython now

solar basin
#

Nice!

slender iron
#

want a build to play with now?

pastel panther
#

@slender iron when you mention connecting up a display from CP, is that a CP equivalent of what you're doing for example in the hallowing board.c? As in I'll still have to feed it the init sequence using send?

slender iron
#

the init sequence is passed into the display constructor

#

should be able to subclass it to encapsulate it though

pastel panther
#

is that on your fork or has it made it to master?

slender iron
#

my fork

#

still fixing bugs

pastel panther
#

πŸ‘€

slender iron
#

I can push if you want to try now

#

its close

pastel panther
#

I have some other stuff to take care of, just curious

slender iron
#

kk, hoping to PR tonight or tomorrow

pastel panther
#

coolio, I'll keep an eye out

slender iron
#

cool cool

#

will need help creating the drivers for the displays

#

will certainly have bugs to run down too

pastel panther
#

just found rework_displays πŸ‘€

slender iron
#

thats the one!

#

its pretty fresh

#

fixed up nrf and using board.SPI

solar basin
#

@slender iron I would love a build πŸ˜„

slender iron
#

for feather m4?

solar basin
#

Yes sir

slender iron
#

🀞 it builds

#

heh

solar basin
#

lol

slender iron
#

just pushed the latest

#

the gist I posted earlier should work as a test

#

I'm off for the night. looks like I have more build issues to run down tomorrow

raven canopy
#

πŸ‘‹

solar basin
#

Night @cosmic fractal

slender iron
#

night, thanks for the testing

tulip sleet
#

@idle owl @slender iron I don't understand what RTD is complaining about. I checked all the webhooks several weeks ago when I was doing travis.

#

A small number were wrong, but most of them were right and being delivered.

#

looks ok to me

#

... ok, I'm seeing incorrect URL's for at least some. I'll fix what I can

raven canopy
#

i was going to mention that based on that screen shot, but i have zero understanding on the "admin" side of RTD & GH. πŸ˜„

tulip sleet
#

@raven canopy turns out I just found one or two bad URL's. Most are fine but are still listed.

manic glacierBOT
manic glacierBOT
gilded cradle
#

Is there currently a way to read bitmap images from the file system and have access to the image data itself on non-Hallowing devices such as the Feather M4? I figured out displayio is not available on that board.

slender iron
gilded cradle
#

Thanks @slender iron

#

In the example, it uses displayio. Will it work without that?

#

I think I get it now. I'll have to write my own bitmap equivalent.

pastel panther
#

@gilded cradle I might have something that can help; I wrote something a while back to read in BMPs and return the binary format that at least some adafruit_rgb_display displays can use

#

it's a total hack and maybe buggy but it generally works.

gilded cradle
#

That's what I need

pastel panther
gilded cradle
#

I'm working on the display driver for the RA8875 and needed a good stream to test fast drawing

#

Perfect. Looks like it works for 16 bit bmps then

pastel panther
#

ya, I think so. It's been a while

gilded cradle
#

Yeah, just at a glance, that what it appears

#

Which is what I needed

#

Thanks so much

pastel panther
#

I was running in on the micro itself but with some work it could probably be ported to run in normal python

#

np; hopefully before too long displayio will have this and more

gilded cradle
#

what about CP?

pastel panther
#

pardon? I was running it in CP on my m4 and then writing the binary output to the flash

gilded cradle
#

Oh, ok. I don't need to port it at all then

pastel panther
#

You really shouldn't have to pass in a display but when I tried to factor it out I must have had a bug because the bins started blowing up in size

#

like I said, total hack

gilded cradle
#

I was about to do a total hack myself and write something for the Hallowing that output a raw bitstream to a file, move it to my feather m4, and read that in .

pastel panther
#

sometimes you just gotta do what you gotta do 🀣

gilded cradle
#

Yeah πŸ˜ƒ

pastel panther
#

<insert comment about hacks becoming production code>

gilded cradle
#

Thanks again for your help

pastel panther
#

no problem, glad to help

#

no one should have to stare at countless versions of the same .bmp skewed, upside down, mirrored or otherwise messed up

gilded cradle
#

lol

pastel panther
#

That said, when it finally works it's glorious

gilded cradle
#

True

pastel panther
#

I think as is it's set up for BGR so you may have to tweak the arguments to the color565 call

gilded cradle
#

Ah, ok. Thanks

modest atlas
#

@main meteor good morning! iv seem to get more of the code you helped me with yesterday , but it doesnt seem to understand the state = !state

main meteor
#

Ah, the ! operator is shorthand for "not". In other words, it change "true" to "false" and vice versa.

#

I did goof on that, however: that's the C way to say "not". The correct Python form would be state = not state

solar basin
#

Did that variable get initialized? I was wondering about that yesterday, but I'm still pretty new to Python

main meteor
#

I think I had a state = False to initialize it before the loop. If not, yes, there should be an initialization to a boolean value

solar whale
#

@meager fog FYI - I am getting a lot fewer errors when I connect my ESP32 to an nrf52840 (feather or argon or xenon) then when I use a samd51 (feather_m4 or metro_m4) are you seeing lots of errors/retries with the M4? Just an observation- the errors are mostly when looking for the responses to the AT+CIPSEND commands -- it just times out. It works some times then I get a string of failures and it eventually makes it through. Just curious if you see the same thing.

modest atlas
#

@main meteor That worked!!!

#

Thank you so much @main meteor

main meteor
#

Sorry about that error, I'll often hang out here while half-listening to the endless meetings at work, so I sometimes post incorrect code while trying to be helpful

modest atlas
#

it helped me a ton

#
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel

button_A = DigitalInOut(board.BUTTON_A)
button_A.direction = Direction.INPUT
button_A.pull = Pull.DOWN

button_B = DigitalInOut(board.BUTTON_B)
button_B.direction = Direction.INPUT
button_B.pull = Pull.DOWN

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

blink = False
state = False
next = 0
rate = .1

while True:
    
    if button_A.value:  # button is pushed
        blink = True
        
    elif button_B.value:
        blink = False
        pixels.fill((0, 0, 0))
        pixels.show()
        
    if blink:
        now = time.monotonic()
        if now > next:
            next = now + rate
            if state:
                pixels.fill((255, 0, 0))
                
            else:
                pixels.fill((0, 0, 255))
            pixels.show()
            state = not state```
idle owl
#

@tulip sleet It says that the old configuration will continue to work until 31 January 2019, so successful deliveries currently do not necessarily mean it's configured properly for the changeover. That said, it also may mean it's fine and there's something else making RTD think it's not configured properly.

tulip sleet
#

I'm going to disconnect, and it should continue to work.

idle owl
#

Ok.

tulip sleet
#

Pretty confusing. And they are listing all the "broken" projects at the top of every page, which means you have to scroll down to see anything.

idle owl
#

I think they're supposed to be linked somehow, but I'm not sure what that means with the new config.

tulip sleet
#

I think that's a "GitHub Services" link, which is what's being discontinued. But we have the webhooks all set up as well, so they are probably just reporting all the existing projects that fall under "Connected Services", and not noticing there's a webhook in use (which isn't set on their side anyway).

idle owl
#

Could be, yeah.

tulip sleet
#

no, that's not it, I'm going to connect it back

#

😦

half pendant
#

I have a student in my class whose Metro Express just stop working in the middle of a project. The on light comes on, but not the #40 Neo light. Also, the computer cannot see it. Help please!

tidal kiln
#

@half pendant have you tried getting into bootloader mode?

half pendant
#

you mean pushing the reset button twice?

tidal kiln
#

yep. and then getting the METROBOOT folder

half pendant
#

nothing happens when I do that. Still no light except the ON light.

tidal kiln
#

are other boards available?

half pendant
#

Yes, I have several that work just fine.

tidal kiln
#

what was the last thing done to this board before it stopped working?

half pendant
#

As a class I had the students create the breadboard layout to using the A1 pin to read photocell through a 10K resistor. I'm not sure exactly what the student did, but at some point the board stop working...

tidal kiln
#

hmmm. maybe electrical.

#

use one of the other boards that works and try getting that into bootloader

#

use the same computer / USB port / USB cable, etc.

#

idea is to narrow it down to the board vs. something else

half pendant
#

will that erase any data on the board?

tidal kiln
#

no

half pendant
#

okay it successfully put my board into bootloader mood

slender iron
#

@half pendant what version of metro is it? m4? m0?

half pendant
#

mo

tidal kiln
#

try bootloader again with the problematic board, just to verify

half pendant
#

Just tried it with the same USB port and cable.... still nothing on the bad board.

tidal kiln
#

do you have a multimeter?

half pendant
#

unfortunately not

slender iron
#

any chips hot to the touch?

half pendant
#

not that I can tell.

#

but the problem occurred an hour ago

tidal kiln
#

"on light" = the little green one that's labeled ON?

half pendant
#

yes

#

no NeoPixel

#

please tell me there is hope

#

teacher budgets are very small

tidal kiln
#

was power only via USB port?

half pendant
#

yes

#

i tested it later from my 9V battery via the DC Jack but that was after it was not working

#

the computer connected is a old Windows 7 with only Mu open

#

the computer connected WAS an old Windows.....

tidal kiln
#

for the photocell project, you had them setup the photocell and 10k resistor as a voltage divider going into A1?

half pendant
#

yes. they also had a LED with a 220 ohms resistor on the other side of the breadboard hooked up to the Metro through a digital pin

tidal kiln
#

did the students do the wiring?

half pendant
#

yes, so I'm not sure exactly what they did

tidal kiln
#

😦

#

there are many ways it could get zapped

#

esp. with 5V available - the core runs at 3.3V

solar whale
#

@slender iron I just tried you latest rework_displays, but there is not bard.DISPLAY -- ?? ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-1709-g96e2c717f on 2019-01-18; Adafruit Feather M4 Express with samd51j19

import pyportal
fade up
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyportal.py", line 30, in <module>
AttributeError: 'module' object has no attribute 'DISPLAY'

half pendant
#

oh! I do see now that they pinned the photocell directly into the RST pin instead of 3.3V . Would that do it?

slender iron
#

@solar whale you dynamically hook it up now

solar whale
#

it builds

slender iron
solar whale
#

just saw that -- trying it now

slender iron
#

board.DISPLAY will only be for boards with a built in display

tidal kiln
#

@half pendant not ideal. was the reset button ever pressed when that was connected also?

solar whale
#

good - I ran into an issue that D9 was claimed after reboot on the old version

slender iron
#

ya, think pin claiming is more complicated because displays live until you call displayio.release_displays()

solar whale
#

cute little red box in upper left of screen -- is that wyhat I should see?

#

other stuff flashed by quickly

#

@slender iron oh wait -- there was a blinka there when I rebooted but not when I ran the code???

slender iron
#

πŸ˜ƒ

#

red box is the code

#

blinka is after your code finishes

#

(where we can put error messages and other stuff)

#

thats why the lifetime of display objects is weird

half pendant
#

Carter,

#

you were so helpful. Thank you. The board is now working.

solar whale
#

OK - but I don't see the blinka until I do a Control-D --- not when the code ends

half pendant
#

I moved the pin from the RST on the Metro back to the 3.3V and then put it in bootloader mode. It works fine now.

#

Thank you!

tidal kiln
#

oh. it was still connected? yah - it was probably just holding the board in a reset state.

#

awesome. glad that's all it was. πŸ˜…

half pendant
#

glad to know what to do in the future if that happens again.

tidal kiln
#

i was scared 5V had gotten applied somewhere it shouldn't have

#

or some other sparky

slender iron
#

yay! glad you sorted it out @tidal kiln and @half pendant

meager fog
#

@solar whale i have some esp32 news

solar whale
#

??

slender iron
#

@solar whale hrm, may need some more tweaking

meager fog
#

@solar whale good news - i got the 'arduino' SPI slave wifi code to work on the ESP32 with the arduino C library

#

which means much faster, more stable, less memory manipulations

solar whale
#

@slender iron I have no idea what your code example is doing πŸ˜‰

meager fog
#

cause its all over synchronous SPI instead of async AT command nonsense

#

bad news - i wont be doing much more work on the UART AT interface

#

cause i want to port the SPI code to python and use that

#

so its sorta in statis - i think its in a good spot, but i dont think we'll get mqtt or any lower level socket stuff working well without a lot of care and feeding. so requests may be it

#

and...the argon doesnt seem to have enough pins connected to use SPI :/

solar whale
#

@meager fog thats too bad but at least the current AT works great on the argon...

meager fog
#

its still there for you and others to hack on! just wont be getting a lot of attn from me πŸ˜ƒ

solar whale
#

no problem -- thanks for getting it going!

#

do you have the same issue i am seeing with the M4's -- lots of errors?

#

the nrfs run so much better

#

possibly somthing in the samd51 uart that is different

#

Looking forward to the alpha release of the SPI version -- good luck!

#

@slender iron just to clarify -- when I run your test code, the screen flashes white then I see the red box and it says sleeping and the code exits with red box on screen. When I reboot (control-D) I see blinka!

slender iron
#

ya, could be a bug, does the red box come back?

solar whale
#

I see blinka between the whit flash and the red box -- no after reboot -- just blinka -- the code is not running -- I just run it once manually -- not in code.py

idle owl
#

@half pendant We have an educators role on this server, if you'd like to be added. It doesn't create any obligations or expectations, it's simply there to make it easier for educators to find each other if they want to discuss education related things etc. Your username would be highlighted in yellow and you'll show up in the "educators" list on the right side of Discord. Let me know if you'd like to be added. It's absolutely fine if you'd rather not as well. πŸ˜ƒ

solar whale
#

@slender iron is there something that describes the displayio API -- or just an overview of whats going on... only if its at your fingertips ... don't spend time explaing it now.

slender iron
#

@solar whale it'll be in readthedocs. in shared-bindings now

#

gotta add more today

solar basin
#

@slender iron @solar whale when I tested it I got (and still get) the desired outcome. Red box while running blinka when done

solar whale
#

hmm - @solar basin what CP build did you use?

solar basin
#

@slender iron I still get weirdness on x = 0. Was trying to compare the init code you sent to what's in adafruit_rgb_display

#

@solar whale the one he posted yesterday evening

slender iron
#

ya, I see that too. been trying to ignore the small issues for now

solar whale
#

ah -- I'll try that

solar basin
#

@slender iron makes sense, if I figure anything out I'll let you know

slender iron
#

that would be awesome!

#

help on the python lib side would be welcome too

solar basin
#

There are next to no differences in doing a diff (the rgb lib version doesn't have sizes which I'm confused by) but I pulled up the datasheet on adafruit.com and checking the actual values now

slender iron
#

it could be due to the way we're sending column set

#

and row set

solar basin
#

ah makes sense

slender iron
#

its correct on hallowing (st7735r iirc) but not ili9341

solar basin
#

okay

solar whale
#

weird -- same result with that .uf2 -- red box until I reboot.

stuck elbow
#

yeah, ili9341 takes 16-bit coordinates

#

st7735 takes 8 bit ones

solar whale
#

if I run it as code.py then I see blinka -- is that what you are doing?

slender iron
#

@solar whale the display has memory so its possible what you see was sent before the reload/reset

solar whale
#

just trying to understand how you are running it -- I copied your code to display.py and put it on the baord -at REPL I import display --flashes blinka then red box -- get blinka on reboot. If I rename it to code.py -- I see red box then blinka stays after it ends

solar basin
#

@slender iron on the note about the display having memory, I have this 240x320 (portrait) image that I've been rendering with the rgb_display lib (I saved the image in the binary format that the screen expect and read it directly from sd to screen) which I know to be in RGB format, but once the initialization code ran that you sent, it turned blue. So I think you had previously been initializing the screen in RGB but the color conversion code is swapping them, maybe?

solar whale
#

@solar basin @slender iron are you running ths test code from REPL or code.py (main.py)??

solar basin
slender iron
#

@solar whale code.py. with repl you won't see blinka until you exit the repl

solar whale
#

OK -- then it works as planned !!!

solar basin
#

aha! lol

slender iron
#

@solar basin ya, there are color issues atm

#

I was trying to sort it out with the blinka colors which are hardcoded but I couldn't understand it

solar basin
#

@slender iron makes sense

slender iron
tulip sleet
#

@slender iron ah i see I need to && the echo and figure out some other way of saving the state

#

groan

slender iron
#

maybe switch it to python?

#

I'll fix the build since I broke it

tulip sleet
#

i have a couple of ideas; rather not switch to python right now

slender iron
#

kk, whatever works is fine with me

tulip sleet
#

maybe i'll change my mind if it gets too frustrating

slender iron
#

πŸ˜ƒ

manic glacierBOT
marble hornet
#

hey, i;m trying to understand some of the nvm module (started going through c stuff)

#

#ifndef SHARED_BINDINGS_NVM_H

#

this is in inti.h

#

i'm curious what SHARED_BINDINGS_NVM_H turns into as it is being compiled

#

the file is in shared binding/nvm and it is an h file

#

i'm curious about it's purpose from where is it including stuff?

slender iron
#

@marble hornet that line is used to make sure the file contents are only included once

#

In the C and C++ programming languages, an #include guard, sometimes called a macro guard or header guard, is a particular construct used to avoid the problem of double inclusion when dealing with the include directive.
C preprocessor processes directives of the form #includ...

prime flower
#

hey all - I'm getting a Purple LED on an ItsyBitsy m0 and it won't show up as BOOT or CIRCUITPY, is it bricked?

#

(never got a purple LED before on it..)

manic glacierBOT
#

This makes displays much more accessible by allowing them to be dynamically created. They have unusual lifetimes because they live through reloads so they can display error messages. To release them you must call displayio.release_displays().

This PR also splits the display bus mechanics from the display commands and adds 8 bit parallel bus support for faster pixel transmission.

gilded cradle
#

@prime flower it's possible, though I don't think so. I thought I had bricked an ItsyBitsy M4 before, but I just needed to reflash the bootloader. IIRC, the light flashed for a moment when plugged in and then went out. I just looked through the circuitpython source and see a purple light represents VALUE_ERROR, though I'm not sure exactly what that means.

marble hornet
#

@slender iron Of itself?

slender iron
#

explain what you mean

marble hornet
#

What does the shared_bindings_nvm_h. Part refer to?

#

Like a file, or ?

slender iron
#

SHARED_BINDINGS_NVM_H is a macro that we only check whether its defined or not

tulip sleet
#

@prime flower the led is set to purple when the bootloader is about to jump to the application, but double-clicking is purple too?

#

#400040

pastel panther
#

how would one nuke their submodules from orbit? Mine don't like the state they're in and git submodule update --recursive complains about a missing commit in tinyusb and status still shows some deltas for the other submodules

tulip sleet
#

git sync; git submodule update --init --recursive ?

pastel panther
#

sync insn't a git commit?

#

pull?

tulip sleet
#

no, it just makes sure the URL in .gitmodules matches what's in the directory

#

it's not git fetch or git pull

pastel panther
#
 ~/micro/circuitpython$ git sync
git: 'sync' is not a git command. See 'git --help'.

tulip sleet
#

git submodule sync

#

sri

pastel panther
#

that looks promising

#

seems good, thanks @tulip sleet

tulip sleet
#

i have an alias that does all that

pastel panther
#

good call

#

I know this question has come up again; is there a "FAQ" bot that we can make spit out answers?

tulip sleet
#

I think someone made something like that once; one of the young users

manic glacierBOT
#

This does seem to fix "breaking the break the build" checking. There are errors in the first subjob from mp_map_t issues; I didn't attempt to fix those. The other subjobs are ok.

I originally tried:

  - some_long_command ; S=$? ; echo $S > status ; exit $S

but that causes the job to exit immediately due to the exit. You have to run the exit as as subshell:

  - make -C mpy-cross -j2 ; S=$? ; echo $S > status ; (exit $S)
prime flower
#

@tulip sleet yeah

#

double clicking is purple too

tulip sleet
#

was this working before - did you just try to update the bootloader?

#

you can connect a j-link to it and dump the bootloader section and compare it with a good one. Not sure it's worth it if this was spontaneous

manic glacierBOT
manic glacierBOT
#

This makes sense for a host of reasons - for sure everything Sommersoft said. Including updating that page as part of the process for adding a library to the bundle would save us SO much work in keeping up that page. As well, having docs setup for the bundle is an excellent idea, as we could eventually move instructions for contributing to documentation included in the bundle in addition to the guide.

I think there is the possibility for a loss of cohesion in terms of the project as a whol...

prime flower
#

@tulip sleet this occured when I tried to burn the bootloader

tulip sleet
#

so the bootloader may be half burned, or something. Also make sure you were using the right .bin. you can dump flash and compare it with what you expect.

mild rain
#

Is it possible to use Visual Studio Code with CircuitPython and the Adafruit Circuit Playground Express? I've not been able to get the serial monitor to show inside VS Code and saving the file doesn't seem to cause playground express to reload.

prime flower
#

@tulip sleet yeah i have a feeling you're right

solar basin
#

There's a post you can try

#

I use VS Code, but haven't bothered with setting up the serial monitor yet, for now I just use Mu for that as silly as it sounds lol

manic glacierBOT
pastel panther
#

I use VS Code as well but I'm using screen for serial stuff. I should probably get off my butt and use a built in one

#

old habits die hard I suppose

manic glacierBOT
manic glacierBOT
manic glacierBOT
gilded cradle
#

Is there currently a way to set an interrupt and define an interrupt handler in CP like there is in C?

pastel panther
#

@gilded cradle not in CP

tulip sleet
gilded cradle
#

Ok, thanks

pastel panther
#

it's a topic of much discussion

gilded cradle
#

Thanks, I'll stop pursuing it then.

umbral dagger
#

Anyone have insight on this: ```>:make V=2 BOARD=feather_m4_express clean
rm -rf build-feather_m4_express

:make V=2 BOARD=feather_m4_express
make: *** No rule to make target 'lib/tinyusb/src/portable/microchip/samd51/dcd_samd51.c', needed by 'build-feather_m4_express/genhdr/qstr.i.last'. Stop.```

#

I just synced up for the first time since 4.0 alpha 3

#

The Makefile & tinyusb filenames are out of alignment

tulip sleet
#

git submodule sync; git submodule update --init --recursive

umbral dagger
#

did a forced submodule sync & recursive update

#

ah.. not with --init

#

@tulip sleet same

tulip sleet
#

if your merge from upstream was not a fast-forward, the checkouts you need in the submodules might be out of sync. That happened to someone else a few dyas ago.

umbral dagger
#

That's possible..

tulip sleet
#

i cloned their repo and some submodule was stuck at an older commit. It had been remerged and so wasn't up to date, because the revert to an older commit was accepted as the "right" commit.

umbral dagger
#

That's what git submodule reports for tinyusb (which is related to the problem I'm seeing at the moment)

tulip sleet
slender iron
#

yup on it

tulip sleet
#

but I thought you fixed that??

slender iron
#

coverage builds different than non-coverage πŸ™„

pastel panther
#

@umbral dagger

 ~/micro/circuitpython$ git submodule status lib/tinyusb
 5804e56e3c2ab4480bf72d94d997f769a645af47 lib/tinyusb (legacy-736-g5804e56e)
tulip sleet
#

@umbral dagger I had to look at another clone and carefully compare the commits, then check out the right one.

pastel panther
#

i just did a fresh clone and got the same hash

umbral dagger
#

I did a fresh clone and moved my changes over... rebuilding now

pastel panther
#

I've been seeing this message for a while now when building, but it doesn't seem to keep the build from finishing successfully; is this expected?

../../shared-bindings/usb_hid/__init__.h:33:23: warning: size of 'common_hal_usb_hid_devices' differ from the size of original declaration [-Wlto-type-mismatch]
 extern mp_obj_tuple_t common_hal_usb_hid_devices;
                       ^
../../shared-module/usb_hid/__init__.c:129:16: note: 'common_hal_usb_hid_devices' was previously declared here
 mp_obj_tuple_t common_hal_usb_hid_devices = {
tulip sleet
#

@pastel panther that was fixed in gcc 7.3.1, so if you're using an older version, you can upgrade

pastel panther
#

ah, good call, thanks.

tulip sleet
pastel panther
#

I think I used brew; it's been a while

#

looks like I'm on 6.3.1

tulip sleet
#

I think brew will get you 7.3.1 if you upgrade

wary matrix
#

With the HID Gamepad library, is there any way to specify the number of buttons that will be used?

#

It by default shows 16 buttons and 4 axis.

tulip sleet
#

@wary matrix no, it's fixed by the HID descriptor that describes the gamepad. But you can always use fewer, just not more. Do you need more?

wary matrix
#

No, I am only using five buttons. It is also showing up as two HID devices, one that is responding to my input, and another that I have found no way to change.

tulip sleet
#

the board supplies a keyboard, mouse, gamepad, and "consumer control". The last is things like volume control and play/pause buttons. These are fixed for now. In the long run we are thinking about how to allow user-specified HID devices in boot.py, but that's a ways off

wary matrix
#

Okay, it is not a problem in any way, I just thought it was strange. Thank you!

tulip sleet
#

it's like a whiz-bang mouse/keyboard/gamepad/multimiedia keys all in one. yw!

pastel panther
#

hmm, brew doesn't think my arm gcc is out of date

tulip sleet
#

@pastel panther are you using brew cask?

pastel panther
#

yea

#

the gcc-arm-embedded cask

tulip sleet
#

do you have to do brew cask update or something like that?

pastel panther
#

that's what I tried and it's saying it doesn't need to be upgraded

#

the frustrating thing is this:

 ~/cptest/ports/atmel-samd$ brew search gcc-arm-embedded
No formula or cask found for "gcc-arm-embedded".
Closed pull requests:
Delete gcc-arm-embedded.rb (https://github.com/Homebrew/homebrew-cask/pull/56802)
Update gcc-arm-embedded to 8-2018-q4-major (https://github.com/Homebrew/homebrew-cask/pull/56480)
Update gcc-arm-embedded to 7-2018-q2-update (https://github.com/Homebrew/homebrew-cask/pull/49268)
<truncated>
#

like my cask definition is out of date

tulip sleet
#

7-2018-q2 is what you want.

#

but do you need to update the local cache of aavailable casks? I don't use mac so don't really know

pastel panther
#

I assumed a brew update would do that but I suppose not

tulip sleet
#

i thought you had to do

$ brew cask update
#

periodcially

pastel panther
#

apparently that's not a cask command

#

brew cask fetch shows it downloading the old files

tulip sleet
#

suppose you say brew cask upgrade gcc-arm-embedded

#

you can do brew cask outdated

pastel panther
#
 ~/cptest/ports/atmel-samd$ brew cask upgrade gcc-arm-embedded
==> No Casks to upgrade
solar basin
#

This ILI9341 init sequence is kind of cryptic. I feel like I don't have the right datasheet

tulip sleet
#

@solar basin I think maybe we were discussing this and someone said there are undocumented init commands. The drivers are the ground truth.

#

@pastel panther I wish I could tell you more. kattni or tannewt use Mac regularly, but they are offline now.

umbral dagger
#

@tulip sleet Thanks for the help earlier!

tulip sleet
#

did it work?

umbral dagger
#

I got a fresh/up-to-date clone

tulip sleet
#

submodules are not the greatest

umbral dagger
#

But, yes, that fixed the problem.

tulip sleet
#

"this piecrust is burnt; I'll throw it out and get a new one"

#

instead of scraping the burnt parts off πŸ˜ƒ

umbral dagger
#

Sometimes it gets too burnt for that and the whole thing tastes smokey

tulip sleet
#

or it just crumbles

#

i'm getting punchy

pastel panther
#

Garsh darn this insufferable program! I'm done with you brew!

tulip sleet
#

@pastel panther a gentle reminder there are kiddies here

pastel panther
#

(sorry)

tulip sleet
#

part of the reason I do dev on ubuntu

pastel panther
#

Normally it automagically works. I wonder if I've hacked some config somewhere that I've since forgotten about

tulip sleet
#

i am trying it on my test macbook

#

@slender iron @idle owl ^^also note

pastel panther
#

Well, that answers that

gilded cradle
#

That's unfortunate. Glad I was able to make use of it before it was gone.

pastel panther
#

Guess I'll just uninstall the cask and install the new version from source

tulip sleet
grim sparrow
#

Hi folks - I'm messing around with an ESP8266 with a 2.4" TFT touchscreen featherwing; I'm reading lots of conflicting information about which library to use for high level graphics (especially text). GFX? BitmapFont? Framebuf? Where should I be looking for current best practice and examples?

solar basin
#

@grim sparrow in CircuitPython?

slender iron
#

@grim sparrow we're removing support for esp8266 with circuitpython 4.0 so you'll want to use framebuf in micropython

grim sparrow
#

@slender iron Ok; so what about examples of use of Framebuf? The packaged example (or, at least, the ones I've seen) show how to create and draw on the buffer, but don't show how to hook the buffer up to the display.

slender iron
#

I'm not aware of any

grim sparrow
#

I presume it can be done? I mean, from looking at the code, it's not immediately obvious that it can be, other than by converting framebuf contents into individual pixel draw commands (which would be prohibitively slow)

slender iron
#

Β―_(ツ)_/Β―

stuck elbow
#

@grim sparrow the 2.4" tft has too big resolution to really fit a framebuffer for it into the memory

#

of course you can send the contents of a framebuf to it, just send the underlying buffer, after setting the window with appropriate commands

meager fog
#

@inner surge hello!

rigid storm
#

Hello guys, I bought the Blue&White LCD + Keypad kit for RPi

#

I am not able to set it up

#

No text within the lcd

#

Here is my code which is the given example in the usage guide:

#

import time
import board
import busio
import adafruit_character_lcd.character_lcd_i2c as character_lcd

Modify this if you have a different sized Character LCD

lcd_columns = 16
lcd_rows = 2

Initialise I2C bus.

i2c = busio.I2C(board.SCL, board.SDA)

Initialise the lcd class

lcd = character_lcd.Character_LCD_I2C(i2c, lcd_columns, lcd_rows)

Turn backlight on

lcd.backlight = True

Print a two line message

lcd.message = "Hello\nCircuitPython"

Wait 5s

time.sleep(5)
lcd.clear()

meager fog
#

adul, did you adjust the contrast knob?

rigid storm
#

No I didnt touch it, should I?

#

Oh

#

Yeah

#

I adjusted it

#

It displays

#

My bad lol

#

Thank you

#

Also, the recent keypad code addition is in the "character_lcd_rgb_i2c.py" and not in the "character_lcd_i2c.py" which I am using, should I just copy the code? @meager fog

meager fog
#

non RGB πŸ˜ƒ

#

congrats on getting it working!

rigid storm
#

Thank you once again

manic glacierBOT
haughty bobcat
#

Any news on ST7789?

#

Why would such a great display not get circuitpython support?

stuck elbow
#

what makes you think it doesn't get support?

#

ah, 89, sorry, thought it's 35

meager fog
stuck elbow
#

looking at the datasheet, the commands seem to be the same as for the ili9341 display

#

the init sequence might need to be different

haughty bobcat
#

I saw the issue

#

Perhaps I will make an additional request

#

The pixel density is nice

#

and the square shape is awesome

raven canopy
mossy needle
#

@raven canopy Yes, I ultimately realized I had to download the library on the device, so it's working now. Thanks so much anyway!

raven canopy
#

sweet! just wanted to make sure you got an answer.

tawny creek
#

Hi all! I made a custom feather using a nrf52840 module, was able to program the bootloader.

What does a blue steady neopixel mean? I got the status light to blink and the neopixel is a solid blue and the USB drive doesn’t show up for me to upload circuitpython.

I have a reset button connected to the reset line (I think it’s p0.18 and on p1.06.

rigid storm
#

Any library available for creating Menus on LCD displays using Python?

tawny creek
raven canopy
#

i was thinking the same, but if its only the bootloader?

meager fog
#

@tidal kiln heya im not sure wher eyou're seeing that the i2s pins on the feather m4 are wrong

tidal kiln
tawny creek
#

yeah its bootloader only, i hear the ubiquitous windows USB connect sound but don't see a BOOT drive πŸ€” and the status light (LED_PRIMARY_PIN) slowly goes on/off

tidal kiln
#

that becomes:

#define PIN_I2S_SDO (5u)           = 5  = PA16
#define PIN_I2S_SDI PIN_SPI_MOSI   = 24 = PB23
#define PIN_I2S_SCK PIN_A2         = 16 = PB8
#define PIN_I2S_FS  PIN_SPI_MISO   = 23 = PB22
meager fog
#

kk

#

agree!

tidal kiln
#

and then checking datasheet, don't see i2s on those

#

assuming i have correct datasheet / table / column

meager fog
#

whats it say in the ds?

#

paste a screenshot of the page/colums

tidal kiln
#

PA16

meager fog
#

huh

tidal kiln
#

PB22/23

#

PB8

meager fog
#

yeah what does the circuitpython i2s guide use?

tidal kiln
meager fog
#

kk ya must be mistake, tr y them n if they work yuo can pr! πŸ˜ƒ

tidal kiln
#

i did. but will do it again. since i thought m0 wasn't working also.

#

want to make double sure on all this

#

thanks for double checking

tawny creek
raven canopy
tawny creek
#

@raven canopy cool! i shall look into it

raven canopy
#

yep. if you need some help, let me know. been a while since i used it. from what i remember, filtering down to the usable messages takes some time. its tedious... πŸ˜„

tawny creek
#

Is it possible I am missing a step?

#

I created a board definition and modified boards.h to include that new board

raven canopy
#

i could only recommend to check that your descriptors are valid...

tawny creek
#

one thing im not sure is working is the reset button, its using the only reset capable pin -- but i dont see the status led or anything change

raven canopy
#

well, and that; make sure that the reset isn't blocking any startup.

tawny creek
#
#define RTS_PIN_NUMBER 5
#define HWFC           false```

What is HWFC?
mild rain
#

@solar basin @pastel panther I've learned that the serial monitor in VS Code is read-only, you can send characters to the serial port through a special menu command but have not found a way to send ctrl-d (char 4) to put the circuit playground in auto-reload mode/out of REPL. Given these limitations, putty will be my serial interface for now, it works fine.

tawny creek
#

not sure what CTS/RTS is either, I looked at the adafruit NRF52840 feather and couldnt see where those pins are

#

anyway shall check the USB stuff later, gotta do uni stuff.. thanks @raven canopy !

#

will followup latur

raven canopy
#

@tawny creek i assume HWFC == Hardware Flow Control, which utilizes CTS/RTS.

meager fog
#

@tidal kiln back - on a train so not great wifi

#

but the i2s pins from circuitpython should be correct

#

pins verified

#

those should be right

raven canopy
#

ugh. my coffee must be broken. checking <= to an initial value of 0, with a descending range of 0-1000...is not a good idea. 🀦

tidal kiln
#

@meager fog awesome. thanks again for checking. will PR. have a great train ride!

meager fog
#

choo choo

solar basin
#

@mild rain yeah, I played with a bit last night too. That's fine for my immediate needs but I can see where that'd be less than desirable for others lol

terse kayak
#

Do I remember a doc somewhere to set up a local build environment for Circuitpython? I can't remember where it was. I have a Windows 10 laptop and was wanting to setup to be able to build both mpy libraries and cp itself though I have no real plans other than to just be able to compile at this point.

manic glacierBOT
#

I am having exact same issue but on Arduino Zero.
I flashed adafruit-circuitpython-arduino_zero-3.1.2.bin using BOSSA 1.9.1
command line Log is as follows:

C:\Program Files (x86)\BOSSA>bossac -e -w -v -R --offset=0x2000 adafruit-circuitpython-arduino_zero-3.1.2.bin
Erase flash

Done in 0.829 seconds
Write 188204 bytes to flash (2941 pages)
[==============================] 100% (2941/2941 pages)
Done in 2.302 seconds
Verify 188204 bytes of flash
[================...
bleak tiger
#

Hi, I'm trying to add an esp8266 wifi coprocessor to my M4 express but am getting the following error when running the code on the learning system:

#

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 15, in <module>
TypeError: can't convert float to int

#

line 15 is:

#

uart = busio.UART(board.TX, board.RX, timeout=0.1)

#

Can anyone help?

meager fog
#

jacob, you need to use very latest cpy - 4x

#

grab the latest latest release

bleak tiger
#

thanks!

manic glacierBOT
solar whale
terse kayak
#

@solar whale exactly what I was looking for. I knew I had see it somewhere. Thanks.

ruby atlas
#

bleh make: *** No rule to make target lib/tinyusb/src/class/midi/midi_device.c', needed by build-circuitplayground_express_crickit/genhdr/qstr.i.last'. Stop.... time to rebuild my checkouts.

manic glacierBOT
gilded cradle
#

@idle owl I added those missing files. Do I need to create a new PR?

idle owl
#

@gilded cradle Nope! You did it exactly right.

#

I was about to message you πŸ˜ƒ

gilded cradle
#

Ok, I wasn't sure if you got the replies to github

idle owl
#

Travis is now running on it, and has failed. (We all go through this!)

#

There's a couple of Pylint things it caught, and Sphinx isn't building. Have you dealt with Travis-CI output before?

gilded cradle
#

No. I've only dealt with Jenkins on web development

idle owl
#

Take a look at it and if it would help, I can go through it with you.

gilded cradle
#

Ok

idle owl
#

I'm not sure what Jenkins looks like so I have no frame of reference to compare, but I know Travis can be confusing the first time through.

gilded cradle
#

Ok, I can see a few things that are pretty obvious that I'll fix first.

idle owl
#

Ok good!

#

FYI that is the most obvious Sphinx error you'll see, they get more obscure from there.

#

I should be around today so feel free to ping me as you run into things that don't make sense.

gilded cradle
#

Ok, will do.

ruby atlas
#

Huh, now I'm having the same issue building some targets that I saw someone else have last week.

Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER]
                   [-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
                   files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [build-circuitplayground_express/frozen_mpy.c] Error 2
make: *** Deleting file `build-circuitplayground_express/frozen_mpy.c'
main meteor
#

Looks to me like it's attempting to run mpy-tool.py without any arguments

ruby atlas
#

it is.

#

other targets are fine. (eg metro_m4_express)

manic glacierBOT
gilded cradle
#

@idle owl I went ahead and fixed a bunch of errors and pushed. Do you need to do anything now for it to try again?

idle owl
#

Nope! It'll rerun each time on its own. And often provide you with a new set of errors πŸ˜‰ Sphinx likes to cascade fail.

#

Not provide you with everything at once, but one at a time, dole it out.

gilded cradle
#

Yeah, I saw another potential failure and fixed it

idle owl
#

Nice!

#

You got in behind a CircuitPython build, FYI, so it may be a bit before your run completes.

gilded cradle
#

Ah, ok.

idle owl
#

We've all also been through that. Repeatedly πŸ˜„

#

If you go to the build page on Travis CI, you can see the other builds running on the left side. If you see circuitpython, then sit back for a bit. πŸ˜ƒ

gilded cradle
#

I don't see a build page

idle owl
#

Ok, so if you go to the bottom of your PR, there is a "Some checks haven't completed yet" with a "Travis CI - Pull Request" bit under it with a "Details" link. Click that link. Then you'll get to the Details page, On that page, you'll see "The build" followed by "created" at the moment, but may be "running", or "failed" or whatever the status is. "The build" link will take you to the build page.

#

That's what I linked you to earlier.

gilded cradle
#

Ok, I got to the page, but I don't see that it says that it's working on circuitpython.

#

Maybe I don't have access to see that.

idle owl
#

Hmm. Ok maybe not. Well it's safe to assume if it's taking forever, CircuitPython is building.

gilded cradle
#

Yeah

raven canopy
#

or, Travis just woke up from a nap. πŸ›Œ

gilded cradle
#

Oh, it's running now

#

Ok, time to work on it some more

gilded cradle
#

@idle owl I have a couple questions about the generated output. First, I'm not sure why it's generating "Instance of 'SPIDevice' has no 'write' member (no-member)". Could you shed some light on that?Second, do you have any idea what the Sphinx error is wanting me to do?

idle owl
#

@gilded cradle Ok the SPIdevice thing is an issue. You can disable pylint for those errors. I'll tell you how to do that in a moment. Yes, I do know the problem with the sphinx thing, there's an issue with something in a different file, let me look at the rest of your files and find it. It's attempting to build the API docs page, and it can't because there's a title line in one of your .py files that isn't exactly right.

gilded cradle
#

Ok, that kind of makes sense...