@idle owl @fading solstice Did the RGB library update touch on this: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/issues/5 at all?
#circuitpython-dev
1 messages Β· Page 138 of 1
It was a linting update so I don't think so.... well linting and catching some other stuff along the way.
With a feather M0 Express it worked right though
I still have it hooked up
Yeah, I wasn't sure if it was among the "Catching some other stuff along the way"
It's working properly? Fantastic
I was just reading online that the power default are different between ST7735R and ST7735 with respect to RGB and BGR modes
That could be it
I don't think it was an issue on other ones, but I only remember from one for sure
With what @fading solstice just said, it seems unlikely that it'd affect others.
Yeah agreed
@cunning crypt @idle owl after reviewing the ST7735R and ST7735 datasheets, i do not see any difference with respect to RGB vs BGR. It looks like they both default to RGB
Hmm ok.
You have to run looping() by hand or uncomment it. π
import main;main.looping() << like that in the REPL
what is it?
Its also a color program
It's a short demo of (what we used to refer to as)
ANSI.SYS use. Very common on dialup BBS years ago.
I don't understand why u are showing it to me
It's just another way to do what your program is doing.
oh!
did you make it before mine?
No. I've been directly editing files to include these codes for about 25 years, though. π
wow!
ANSI escape codes. There's a special editor for this. I forget the name. Would be on ftp.funet.fi I think.
You can put them in /etc/issue (probably would work in MacOSX).
I just did some reaserch on color codes then added them
You can also clear the screen and move the cursor around.
ANSI art is based on this, too.
I gtg
@timber mango it'd be awesome for circuitpython's messages use it
@slender iron we used them in a forth interpreter. π
π
I'm not seeing examples for some of the repos that you have checked off: Adafruit_CircuitPython_SD for example.
@Sigafoos The checked ones are ones that I plan on adding examples to. If you want to help with examples, pick one that is not check yet.
@Sigafoos BTW: if you really like any of the ones I selected, please let me know, you can do em.
@slender iron Looks like we borrowed from gforth:
https://github.com/wa1tnr/cpx-basic-studies/blob/master/141-print.d/ansi.fs
borrowed what?
all the ansi.sys manipulation code for a forth interpreter (to provide full colored text support, cursor movement, basically all that ncurses provides (or most of it). Pretty sure it's in the vt220 spec or similar.
(my first exposure to the system was called ansi.sys in MSDOS -- was an element triggered in their CONFIG.SYS file)
yeah, circuitpython doesn't actually do anything, its the terminal program doign the hard work
thats why it just worked π
hehe that's right. Fortunately, most terminals do support this (and have for decades. π
yup!
It always goes back to forth π
FYI - I was able to merge this PR into master and build/load the code into my feather52 - Seems to be working as expected.
Trinket M0 Circuit Python autonomous string car update: successful outside run today. Will be sending the other boards across the state to anxious string car racers. Okay, just two relatives, but it's a big step forward in performance and ease of support since they're not programmers. When updates are needed, I can just email a .py file to them that they can install themselves. Happy (Circuit Python) Camper here.
I have a new noun.
@idle owl the "Creating and Editing Code" section in the Welcome to CPy! guide is in draft mode (again?). Do you know if that's deliberate or it's not done?
@tulip sleet I have no idea, it's been completed from my point of view for a while.
I think that was an accident - I'll flip it back again. Last updated yesterday evening.
I don't know if this belongs here or in #help-with-projects but I'm having problems with the CCS811 air quality sensor breakout board and the Feather Huzzah. I can't get the CP example code to work.
I've switched busio with bitbangio and atleast one other error in the code. I'm getting "OSError: [Error 5} EIO" as the last line of the error.
Don't want to 'wall of text' you all with the full error unless asked.
@stark wolf using bitbangio awas the first step - can you post the code you are running?
New to Discord. I hope this is correct.
can you try just doing an i2c scan ```from board import *
import bitbangio
i2c=bitbangio.I2C(SCL,SDA)
i2c.try_lock()
i2c.scan()
after the tyr_lock it should respond True
ok - so it is seeing the device
This is also typed directly into REPL. The example.py was run using 'ampy -p port run ./example.py'
do you know where it was failing
Also I have a si7021 temp and humidity sensor and it's example.py ran just fine that way.
I haven't tried to type the CCS811 example code into the REPL so I don't know where the failure happened.
Do you want the full error message?
ok - so try - after a reboot (control-D) ```from board import *
import bitbangio
i2c=bitbangio.I2C(SCL,SDA)
ccs=adafruit_ccs811.CCS811(i2c)
sure - post the file or post it between 3 backticks
3 backticks before -- 3 after
\
Traceback (most recent call last):
File "/usr/bin/ampy", line 11, in <module>
load_entry_point('adafruit-ampy==1.0.3', 'console_scripts', 'ampy')()
File "/usr/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/ampy/cli.py", line 277, in run
output = board_files.run(local_file, not no_output)
File "/usr/lib/python3.6/site-packages/ampy/files.py", line 227, in run
out = self.pyboard.execfile(filename)
File "/usr/lib/python3.6/site-packages/ampy/pyboard.py", line 271, in execfile
return self.exec(pyfile)
File "/usr/lib/python3.6/site-packages/ampy/pyboard.py", line 265, in exec
raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n File "<stdin>", line 9, in <module>\r\n File "adafruit_ccs811.py", line 113, in init\r\n File "adafruit_register/i2c_bit.py", line 40, in get\r\n File "adafruit_register/i2c_bit.py", line 39, in get\r\n File "adafruit_bus_device/i2c_device.py", line 94, in write\r\nOSError: [Errno 5] EIO\r\n')
\\
hmmm - not a lot togo on - try the example in teh REPL - lets see where it is failing.
OK, in the last code snippet that you had me try it failed on the last line. once because we forgot to import the lib for the sensor and second with the following:
oops
\
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_ccs811.py", line 102, in init
File "adafruit_register/i2c_bits.py", line 48, in get
File "adafruit_register/i2c_bits.py", line 47, in get
File "adafruit_bus_device/i2c_device.py", line 94, in write
OSError: [Errno 5] EIO
\\
No worries. We both forgot it.
One thing that I've noticed is that the CCS811 uses the adafruit_register lib and the SI7021 does not.
hmm - I don't have my ccs811 avaliable now to hook up to my esp8266 - I can try tomorrow and see if I can reproduce this. I ahve oonly used it on an M0 (SAMD21) board with hardware I2C.
No worries. This isn't time sensitive. Just playing with new toys my wife gifted me.
You are welcome to open an issue on regarding this - at https://github.com/adafruit/Adafruit_CircuitPython_CCS811
Sorry - just recalled. I have one running on an esp8266 now - but via Arduiono ....
First time I might have found a genuine issue and not something I made a mistake on.
I've got an Uno board that I tested the breakout on just to make sure it wasn't borked. Worked fine there.
So it can work with the hardware. May well be an issue with the Circuitpython bitbangio I2C.
Looks like I will have a "snow-day" tomorrow and have time to investigate.
I take it you are out east and have that noreaster heading in?
sigh - its been an intersesting winter so far...
time for bed now -- have fun with the new toys.
Thanks. Be safe and sleep well.
@stark wolf you have jogged my memory. You can brows through https://forums.adafruit.com/viewtopic.php?f=19&t=121816 for a long story of my struggles with this sensor on an esp8266 a few months ago. Iβm looking forward to revisiting this.
@solar whale Thank you. I'll dig through it. I just posted an issue as you suggested as well.
I saw. Thanks.
who from Circuitpythonistas are PyMLadies?
Hm, maybe I should try to tackle the βmore helpful OSErrorβ issue before adding examples...
@slender iron @tulip sleet @stark wolf opened an issue against the ccs811 driver last night and I can reproduce the problems on an esp8266. I suspect the problem is really with bus_device or register and not with the ccs811 driver. Should I open an issue there is link it to the ccs811 issue or just keep is all in the ccs811 issue until we know more. https://github.com/adafruit/Adafruit_CircuitPython_CCS811/issues/9
@solar whale adding a circuitpython issue is fine. it'll be easier to keep track of there
@opal elk adding examples will be easier
@slender iron OK - I'm still trying to get some good scope shots. Getting very confusing results but making progress
@slender iron yeah, but potentially less helpful overall. I'll try to add a few examples soon (I was going to yesterday and then other things came up)
@solar whale with a saleae? sometimes having a trigger pin can help. aka use another digitalinout to just trigger the saleae recording
@opal elk its all helpful π
Im using a scope for this
documentation may be where I dump the majority of my time. always needed, always helpful.
the I2C signals are not very clean - even on busio - but I think it is my setup.
CCS811 requires clock stretching, that may not be implemented on bitbangi
ah
raspberry pi does not, so you have to really slow down I2C
BNO055 also has clocks stretching as does PN532
they are Cursed
Small u here because its for micro.
I don't think all of these conf_* files are needed with ASF4.
Oy, thatβs a lot of snow...
@meager fog slowing i2c down to 10Khz does allow the esp8266 to work - for awile - that is a big improvement, but it still crashes after a few seconds to 10s of seconds.
it ran better on the m0 with bitbanging at 10 Khz
yeah i think the Issue is just we dont have clockstretchin'
but the signals look much nicer at 10 Khz π
Something to add to the todo list.
@slender iron I created an issue in circuitpython to implement clockstretching in bitbangio. I guess if arduino can do it, CP can....
Some I2C sensors require clock stretching and do not work properly when using bitbangio (necessary on the esp8266). Examples are CCS811 https://github.com/adafruit/Adafruit_CircuitPython_CCS811/issues/9 and bno055.
does it handle opentype fonts?
i dont think it does much of anything other than ascii, it has QT as the gui backend
Qt uses Rich text
Or at least mu-editor uses the RichText panes for its text areas
@meager fog FYI - I cleaned up my setup - removed some extraneous wires and I can now get the ccs811 to run on the esp8266 at 10Khz. However, I do notice that if the ccs811 is present then the 3.3v lin show aabout 100mV ripple at ~10khz. And it is dropping below 3V sometimes.. I even see this if I run the mcp9808 at 400khz. still ripple at 10khz - it goes away if I remove the ccs811 and just run the mcp9808.
ah - I saw it as well on the M0 so good to know it makes sense.
I'm blowing my own mind by writing stepper motor unit tests
mOtOrPaRtY
@meager fog do you think I should add speed and multiple step controls? right now its only onestep
whats the func proto for onestep?
onestep(self, *, direction=FORWARD, style=SINGLE)
@slender iron are you writing some motor test so you can implement them in
toaster
whee motors
@sick creek nope, just a side quest from getting the pca9685 driver linted
Forked question: Can audioio cope with changing a sample buffer while looped-playing? -OR- is pyb.DAC actually supported, I couldn't find the library file for it
(I want to mix a couple of different waveforms at a credible audio rate on Trinket M0 -- guessing I'll likely have to go to native code to do it, but I thought I'd try to pull it off at the circuitpython level first)
(Also, hi everyone)
Hi @stark hawk
So bossa is downloaded, not pip/brew installed?
It let's me copy the .app obviously, but it's refusing to let me put bossac into /usr/bin
even with sudo on from the command line.
have you tried creating a symbolic link in /usr/bin
No I haven't. It's working on my old machine, but I haven't done anything with it on the new one yet. And I'm not entirely sure how to make a symlink into /usr/bin.
I must have had help getting it onto the previous laptop π
Oh.
Looks like I cloned the repo last time.
Must have been running it from there.
I usually create symlinks instead of adding files to /usr/bin, the syntax is ln -sf /path/to/file /path/to/symlink
You would need to add sudo for /usr/bin
Ok, this is sounding familiar
I think I cloned the repo, must have built bossac? Then created the symlink? Question marks because I'm fuzzy on whether that's right
Hmm.
$ cd ; mkdir ~/.local
$ mkdir ~/.local/bin
$ ln -s .local/bin .
$ ls -la | egrep bin
Then populate ~/.local/bin with stuff you want to override with.
$ echo $PATH
/home/kattni/bin:..and the rest of your $PATH
For programs (xephem comes to mind) that want a full populated directory to run the binary from, I like to use:
$ /bin/pwd
/home/nis/.local/bin/bin.0/xephem.d
The last directory in that path is full of .o object files and .c source files, having built the binary in that directory.
I generally cd to that xephem.d directory then just ./xephem in there.
@stark hawk you should be able to change the buffer while it plays. no promises it sounds good, its being DMAed to the DAC under the hood
I'm not even getting to that point yet. I can't get it downloaded in a way that runs in the first place.
@slender iron I think I need some help when you get back.
kk
@idle owl I'm back
Ok
I think you walked me through getting bossac setup the first time, and I'm obviously missing something crucial here.
why do you need it?
Install CP on an Adalogger M0 and test 2 more libraries.
ah ok
Yeah. heh
I think I just download it and run it directly
It's not working right for me then. I'll try it again.
this is where I'd get it: https://github.com/adafruit/BOSSA/releases
I'm in a dir with what I downloaded and it says command not found. You can just do bossac -h to test it right?
Oh...
right
looks like there is no mac osx latest version though
Still getting command not found. Can I run it from anywhere or does it have to be somewhere specific?
if its not in your path you'll need to be specific about where it is
if its in your current dir then ./bossac
@slender iron hiya back was fixing an arduino library. i think onestep is good for now
can always see how people use it, add more wrappers later
Worked!
vr00m
oi slowly finding all of the background stuff I had installed on my old laptop. I don't remember how to get mpy-cross going either. I think I had to make it?
its released with every circuitpython release too
Oh. Ok.
I think
yep
anyone know what voltage the automotive gauge should be used with?
are you driving it with a HBridge?
ya, looks like its 5v
I had to copy it out of one of my CP repos. I couldn't figure out how to make it work from the downloaded version.
weird, productpage and datasheet dont have any measurements...prob ~5-6.3v
the test circuit on the product page looks like its driven from the arduino in the GIF
Dear, on another Discord, I have been discussing and replicating the fact that Trinked M0 demo code fail to demo the Neopixel. Silently fail.
I am talking about this zip file: https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython#trinket-default-zip-install
And tested with 2.0.0 version.
If you flash 2.0.0 and put the demo code and connect neopixel on D4 ... nothing is happeing.
Silently fail (no error message, but no light either).
The build in dotstar does work.
Not the neopixel.
they recently updated the CP, so that could be a hidden problem
you can submit an issue, and they will get back to it really fast.
Somebody receiving a trinked M0 out of factory is receiveing what??? 2.0.0. and Demo code.
No doubt about it, the topic was... do you test demo code before releasing?
@half sedge the demo code shouldn't use a neopixel, it uses the built in dotstar
But it does.
it didn't work for you though.
ah, I see
'''
NeoPixel strip (of 16 LEDs) connected on D4
NUMPIXELS = 16
neopixels = neopixel.NeoPixel(board.D4, NUMPIXELS, brightness=0.2, auto_write=False)
So the demo code is pushing you to connect neopixel on D4.
Not fun if not working...
@half sedge how ar eyou powering them?
Quick fix is: return (0, int(pos3), int(255 - pos3))
@meager fog it doesn't work with the code he has
It work with the fix !!!!
ik
Not my fault, your bug.
it's an issue
The trick is that neopixel expect tuple
Line 63 your code is saying:
return [0, int(pos3), int(255 - pos3)]
And that work for dotstar, but not neopixel
i'll be updating the programmers to v2.2 anyways
There might be another issue with the documentation of seesaw and circuit python.
I'm attempting to test the adafruit_vc0706 and adafruit_sdcard but I'm running into issues. I switched to the current libs from the PR libs, same issue. Traceback (most recent call last): File "code.py", line 30, in <module> File "adafruit_sdcard.py", line 84, in __init__ File "adafruit_sdcard.py", line 117, in _init_card File "adafruit_sdcard.py", line 172, in _init_card_v2 OSError: timeout waiting for v2 card
Formatted the card using the SD formatter suggested in the guide
@idle owl hmm what size is the card?
we added support for any sequence to neopixel but the shipping neopixel.mpy may not have it
i wonder if 32GB is SDXC or whatnot, do you have a 2-16GB?
@slender iron or the demo zip 2.0.0 was not tested with 2.0.0
worth trying another card
Back to seesaw, the question is what should be put into the /lib ?
true, there were issues with different cards I remember.
@half sedge I don't think its a circuitpython version issue because this is a library issue
Just adafruit_seesaw.py ?
@slender iron i can take a look at the zip later, probbaly just has the older neopix mpy cause we did that changeup of tuples around the time we released
I remember that
yeah, I looked at the mpy but its too early to have a version string in it
@slender iron Maybe trying to accept anything is not the best option...
it accepts any sequence
What would be the recommend argument? (0, 0, 0) or [0, 0, 0] ?
Other 32GB card does it too. Trying to locate a smaller card.
they should both work
@idle owl ok let me know if you'd like me to try it on a breadboard ive got
How much extra code to support both?
none
iter is ~amazing~ π
it works with any object that supports __len__ and __getitem__
yes though dotstar got it first
thats why I suspect there is a mismatch with the demo code, it was added to neopixel later
When I tested 2.0.0 (and I was the one requesting a zip so that I could have a "like out of factory" when upgrading from 1.0.0 to 2.0.0) I did not knew I had Neopixel at home...
So I did not test.
It seems I have many Neopixel on Unicorn HATs
well now we can fix it π
@slender iron updatin' metro m0's - they'll be shipping with 2.2 starting this week
yay!
Getting a new error! No response from cam, check wiring.
Is that what RX and TX are?
its always confusing which to go to which - i get it wrong a lot
That worked! I swear they're backwards from the board now though.... π
This is strange, because I remember that I implemented clock stretching for MicroPython for the software I2C... Could it be that CircuitPython didn't use that?
Looking at the code, it's there: https://github.com/adafruit/circuitpython/blob/master/shared-module/bitbangio/I2C.c#L53
Do you have a logic analyzer to capture what is happening with that sensor?
@idle owl they are the only labels where they don't match up RX goes to TX on another board
Hah! ok
yeah RX goes to TX - SPI solved this by calling them "MOSI" and "MISO" but we're stuck with UART's names
@slender iron heya i just noticed simpleio isnt in the latest bundle?
but it is in the libraries folder? https://github.com/adafruit/Adafruit_CircuitPython_Bundle/tree/master/libraries/helpers
Also should we update the lib zip name to reflect the new release?
looks at travis
oh wait its from a week ago
thats odd, no new bundles?
do we have to kick it to create new bundles when we add libraries?
sounds like a bug π
oh noooo! want an issue?
nah, I'll look now
k - whew π
@opal elk you got a pylint complaint on the example file
yep, working on it
@slender iron audioio looks not supported on Trinket M0? About to give up and make some VCOs out of discretes at this point.
no, I don't think we had space for the code
the script didn't expect an update to the circuitpython submodule in the bundle
I do have some logic analyzer captures - GitHub won't accept the file types. I can get them to you in discord.
Ok we apparently need to update the code in the guide for the cam, but it looks like the PRs for both libs are good to go.
So I'll get both of those merged.
thx!
@stuck elbow the logicanalyzer files are too big for discord
@stark hawk for sound on Trinket M0 I used this: https://gist.github.com/dglaude/b085d54eec077874d28394fd317b7b54
@rotund ether Before i do it. To indicate a new release of a bundle library we draft a new release or just add a new tag
I'm gonna go climb. Before I get the bundle autorelease going I'll need to tweak the builder to fail if an added library doesn't have a release
some of the newest added are missing releases
@half sedge I'm looking for a pleasant drone for an accelerometer-controlled theremin, so "buzzing" doesn't sound like what I want, thank you though π
I'll have to regenerate them, but it won't be today - the ones I have are too large because I captures some analog data as well. I'll try to repeat the tests tomorrow and post the files. Sorry for the confusion.
@fading solstice You need to do a new release. But also tag it with a higher release number since it's a new release anyway.
@idle owl i am allowed to draft a release i.e. there is a button enabled for that on the releases, but i don't see a button on the tag page
You don't do it through the tag page. Draft a new release, then you give it a tag from there.
Give me a minute to merge this lib and I can walk through it at the same time.
@idle owl thanks
Ok. Draft new release. Then in the box that says "Tag Version" you give it a number appropriately higher than the previous one. I've been doing a whole number up for the linting and autobundle stuff, but if it's just a minor fix, give it a 0.0.1 increase, or 0.1.0 increase. Really it's up to you, in the end it's arbitrary.
So for Adafruit_CircuitPython_SD, I'm going to make the tag version 3.0.0
this one have 3.0.0, so it should be 3.0.1?
If it's a little update then yep, that's perfect. If it's added functionality or whatnot, you could do 3.1.0 etc.
examples fo;der added ana an example .py file
I'd give it 3.1, that's a solid addition.
k
The title is "Added an examples folder and example .py file." is the more i need to say in the desciption?
Then make a note about what was added, and you can add something like this: To use in CircuitPython, simply install the [Adafruit CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases) or the zip from here that matches the version of CircuitPython you are using.
That will add a link
But it's not strictly necessary to add that bit
Then publish release
here is a screenshot of the Logic analyzer capture - perhaps it will tell you enough

this is the start of the capture

@idle owl tahnks and done
@fading solstice Excellent! You're welcome π
hrm i noticed the VC0706 lint pull was just merged but i'm curious @slender iron @hollow raptorni what was the intention of moving the command buffer from its class member position to instance member? it was made a class member to reduce memory usage in the case of multiple cameras... bit of an edge case but it's not necessary to have a buffer for every cam instance
not a big issue to keep it as is with the change right now but FYI in the future, most libraries explicitly use class instance buffers for that reason
the little I2C sensors are really where it might matter the most, in those cases you could definitely have like multiple LCD backpacks
Ok. I don't know what the intention was. I tested before merging but with a single cam.
so having lots of little buffers is a bummer for memory usage
oh yeah functionally it should be all good, thanks for checking it!
but it's the danger of mixing lint changes with other changes to the lib.. some things are design choices
it looks like the guide will need to be updated too with new names for the sizes
intresting point there @timber lion
ah hrm
one project where using small cameras as 2 in steroe could have multiple cameras
Actually wait it looks like it's on the github repo
I can do a PR for it
But that won't update the snippets.
That I don't have access to.
yeah i'd say in the future lets stage these updates so the guide is updated at the same time
i'll tweak the guide right now but we should get you access to edit this guide too
timed updates
i think you have learn system access right? to make the circuit python getting started guide
if you go here do you see an 'edit this page' button in top right? https://learn.adafruit.com/ttl-serial-camera/circuitpython-usage
Snap, Snap!
@timber lion think if code update is there then it wait guide update for it so it can be accepted
I do, but it won't let me edit it, it drops me to the learn admin page and does nothing. If I'm not added as a contributer, I can't edit a guide
Seemed like a feature I guess
I think there is extra something yes.
Is the learn system server on Vogon? π
yeah janisku IMHO the code shouldn't change without the guide changing too.. if it means the code has to wait a bit then that's the right call for users. the risk is the confusion of a guide being out of sync with the code
can you make a checking policy for PR so it check if guide is updated or not for it?
hrm what if you try now @idle owl i think i added you
i am 100% for that policy π
I wasn't going to let it go without getting updated. Might have been 24 hours, but I would have gotten added.
Yep I can edit it now
oh no worries, yeah we'd get it updated eventually
but let's unblock getting you access to update them so it can be even smoother π
awesome!
Eventually sure, but that doesn't help whoever is trying to use it today. I have the code already updated too.
i'll email justin and folks to see if maybe there's a 'super contributor' status you can have to edit guide pages like that
So do you want me to update it then? You said you were going to, I don't want to be editing over you if you were going to do it
Ok sounds good
oh yeah go for updating it
Ok will do
i think it makes the most sense for people integrating the pull and making the change to update the guide
@timber lion What about your big demo for CPX? Is it going to be publish? Is it maintain to follow potential change with new CP release/library?
since they'll have the most context
@timber mangoGlaude ah yeah the mega demo i'd love to publish but other driver stuff is taking priority
github have the templating now what helps it
i was also hoping to rework it to use the frozen in versions of the LIS3DH and other modules that are available now
I don't know if everyone who merges can update, but as long as we coordinate we'll make sure everything stays well enough synced. I'm concerned we'll end up blocking people from doing merges because they can't also update guides.
but it might need changes to work with those updated libs
yep just be careful, we can't assume someone can update the guide at the same time.. good to send a heads up if something is changing and needs some work from someone
I agree it's needed and communication is crucial.
okidoke trinket m0 'default' download bundle is updated and even uses tuples ooo fancy
nice. I have no I2C device at address 70. π but it looks like I had my wires over by one. bonus!
I have 1 out of what is apparently supposed to be 3 lit LEDs.
Progress! Apparently
Hmm. It's not talking to the second part of the 16x8 matrix.
I can light up other ones on the first section of it if I but it's only showing 1 by default because the other two in the demo code are on the second section.
Checking the wiring guide. I wonder if I had to close a jumper or something.
Doesn't say.
The second section gets power if I have it plugged in with no code running, some of the LEDs are dimly lit, but with the code running it does not talk to that section.
what type of display is it? sounds like a character LCD?
No 16x8 led matrix
the large ones, like 1.2" really want 5V instead of 3V to get max bright
so the HT16K33 backpack with two of the 8x8 blue LED matrices on it
I gave it 5V
powering it from USB on a feather M0 express
ah gotcha, have you seen it work before or first time trying that display? one gotcha if one display isn't working could be the soldering
First time. And yeah I'm wondering if it's hardware.
they're easy to accidentally solder in the wrong orientation, text on the matrix side should be facing down IIRC
Same results with current version of libs as with PR version
let me see what the guide shows
oh bugger
you might want to test with arduino too to try a different lib
ahh oops yeah it needs to be in a specific orientation for the LED cathodes and anodes
They're not the same at the moment, so one of them is definitely wrong. Ok
good to know
Going to try to fix it apparently π
Thank you!
oh yeah i've been there done that π
if you have a solder sucker it can probably pull the solder out without too much trouble
1 sec let me jsut get a link to the guide
yeah for the backpacks here's the guide: https://learn.adafruit.com/adafruit-led-backpack/0-8-8x8-matrix
and the feathers wing: https://learn.adafruit.com/adafruit-8x16-led-matrix-featherwing/
easy fix though, don't worry it won't damage it to have it backwards
these are the easiest for removing solder from through hole stuff: https://www.adafruit.com/product/148
Strangely enough, that's the technical term for this desoldering vacuum tool. Useful in cleaning up mistakes, every electrical engineer has one of these on their desk.To use, depress the ...
heat up and then jam the nozzle over it and press the button to suck it out
i have that for sure
takes a little time and might need a few passes to get it all
i have seem some strange soldering ones what have like a sucksion container too
a wick is handy too for small cleanup but they take a long time to desolder a big throughhole joint: https://www.adafruit.com/product/149
I had to press it onto the work table and pop it through. I took some of the copper off the backpack with it. The sucker wasn't enough in the end. But it's working so good enough π
ah yeah with those matrices it's hard because they have so many pins, yeah usually a teeny bit of solder is left and you have to pop or pry the component out.. gets harder with a lot of pins
if it works though it's all good π
Yeah! Thanks for helping me figure that out. I would have been ages staring at it if you hadn't come mentioned the orientation thing
π
@timber lion I changed the command buffer to an instance variable because I was worried about behavior when multiple instances use it in separate threads.
@idle owl I have never had good results with solder suckers. Solder wick with some flux on it works great for me, though.
@cunning crypt I think maybe I don't get how to use wick. Because it didn't seem to help much. But there was silver on it when I was done, so I assume it helped a little.
wick +1
Wick without flux can be hard to use
I fluxed it a bunch.
@idle owl how hot is your soldering iron?
700
I run mine at 850...
I got what I needed to get done though!
Still can't believe it worked.
But I have my blue LEDs.
370C /454C O_o
thats what counts π
De-soldering through-hole components is a GIANT pain
@idle owl woo! no 
Yep. Blue LEDs instead of a blue smoke monster. Always a bonus.
have you guys used solder suction + air?
somebody want to review this? https://github.com/adafruit/circuitpython-build-tools/pull/8
Yeah
this will cause the bundle build to fail temporarily
(which is the point because future PRs will catch the issue earlier)
yeah there's no multithreading right now so my take is optimize for memory.. but in this case it's fine either way
i put comments on the buffers that have this dependency so we can find them easily later
ok
Looks good, so unless Dan's got something else to put in, I'll approve it
β
If you're using Atom on Windows, I just fixed a bug in this package that forces Atom to write out files immediately. It was not checking correctly on Windows for the file location. https://atom.io/packages/circuitpython-force-to-drive
Ah ok was about something else π
there's a lot of assumptions for multithreading though that will break when we get there π
stuff like serializing access to the busses
I'll approve. Want me to merge?
yeah true, I think the register classes will need a re-look too
@slender iron where do the failed build msgs go?
but not email to us?
i'll look, prob good to get a notification
that run failed without failing π
fatal: No names found, cannot describe anything. Stopping at 'libraries/drivers/drv2605'; script returned non-zero status.
thats bad but travis thought it passed
so still merge the change? I assume what you're looking into now is travis-specific?
yeah please
ok on it
I'll do a build tools release and then redo the bundle build to make it fail
then I'll fix it π
I apparently can't merge
kk
I approved though.
ok, bundle is officially broken
so now what
do you have a list of those? or need/want help with that
I'll take care of it. I think its just four
ok
and next time it'll be caught in a PR
nice
and DRV2605 fails lint: https://travis-ci.org/adafruit/Adafruit_CircuitPython_DRV2605
somebody wanna disable those two checks?
and bump the release
sure.
thanks!
Oh. Can you help me get a venv and sphinx setup again? I had pylint in the same venv
you called it venv3 right because it was python3 ?
nah, I just have a bunch scattered in individual repos called .env
then its source .env/bin/activate
ok it's started
ok, bundle build is green now since travis checkouts each submodule each time and picks up the new tags
ugh. need to reboot. PyCharm is doing something weird.
065e820 merge from 2.2.0 + fix up board defs - dhalbert
d8686cc use correct LD_FILE in mpconfigboard.mk for boa... - dhalbert
19d353c nrf: fixups for changes from 2.2 - dhalbert
d0cc8ab revise boards/ files for 3.0. All now compiled ... - dhalbert
5cb361c Merge pull request #510 from dhalbert/3.0_merge... - dhalbert
Need to know how to validate input as integer or string (need a safe way to test to see if it is a string
before I try to int("string") against it.)
# primitive repl-like dialog # nis 2018 January 05
# developed on Gemma M0
import builtins ; import time
versionne = "seven foxtrot two"
def prompt():
print(" ok ", end='',)
def get_things():
global tib ; tib=input(); # terminal input buffer
global tab ; tab=''
try:
tab='' ; tab = int(tib)
except ValueError:
pass
if (isinstance(tab, int)):
print("tab was an int. ", end='')
prompt() ; return tab, tib
def signon():
print(versionne, end=' ')
print("OK. ", end='')
def looping():
while True:
get_things()
if (isinstance(tab, int)):
print("printing integer tab: ", end='')
print(tab)
print("less 7: ", end='')
print(tab -7)
if (isinstance(tab, str)):
m = 1 ; # noop # print("ERROR - detect and ignore.")
if (isinstance(tib, str)):
if (len(tib) > 0):
print("printing the str, tib, the terminal input buffer: ")
print(tib)
time.sleep(0.128)
# - - - - - - - - - - - - - - - - - - - -
signon()
# looping() # run this in the REPL:
# 'import main;main.looping()'
# END.
I'll give it a go. ;) later Yes, indeed it is. Working with it now. Thank you!
@timber mango awesome! wasn't sure but i'm glad it's there!
I'm getting class string for any input ;) I will update the code in the scrollback to show what I'm working with now.
ok
33
result is:
<class 'str'>
Yeah I don't think he considered this when input.c was crafted. I'll have to look again at the source.
Or the doco. ;)
https://docs.python.org/3/library/functions.html#input
https://github.com/adafruit/circuitpython/issues/143
It's too obscure. I can't find it.
https://docs.python.org/3/library/stdtypes.html#str
@timber mango I think isinstance(tib, str) is more common
Thanks Scott. Will look at that!
https://docs.python.org/3/library/functions.html#isinstance
Ah. Limor was talking about 'iter' earlier. There it is.
thanks @slender iron π
Doesn't seem to be a way to know if input() is now holding what could be an integer, before trying to int("foo") and blowing that up.
Is there a graceful way to handle a bad throw?
@timber mango https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint/blob/master/examples/main.py#L147
@meager fog to the rescue! I didn't remember the except clause to use, so I stopped short. π
π
Very nice! Thank you vy much, ladyada.
is building a Forth inside circuit python. ;) Looks like I have working code now (updated in scrollback; verifying it now).
@raven canopy Yoda would not like programming. He'd say "There is no 'Try'!"
@tulip sleet I have that display. I'll take a look tomorrow.
hrm memoryerrors
@timber mango why not just try to convert and catch the ValueError? If it doesn't convert, then it's a string.
cpx library struggles a bit doing both audio playing and anything else
@tulip sleet i tossed him some code π
@meager fog tnx - @timber mango it's always a string to start. it only becomes an int when you try to convert
I just started reading the channel and forgot to scroll down
i made a pomodoro itmer if anyone here is into that
Every comment helps. Reposted the improved code. Right now it's over my head, but it does what I want it to do. ;)
If you type '0032' at the ok prompt something interesting happens. ;) (all that verbiage follows the ok prompt, which is still prompting)
@meager fog Excellent "timing" -- my wife reminded me yesterday that I should be pacing myself when in the studio working on a project. I'd be interested in trying your timer.
bah, why is this diymall oled using a non-stand pin order
hope I didnt fry it
still works, at least
@meager fog Thanks! I'll run it tomorrow morning.
o.c. I pegged my analog meter movement twice, yesterday, due to shunting the milliammeter across the power supply with no resistance. Wish it were a Simpson. I haven't reacquired the muscle memory not to do that (but the meter sound allowed me to instantly separate the contacts, which I did have muscle memory for).
how fast is an oled.show? It greatly slows down my code loop
I am showing a converted pot value on the oled, it updates once a second at best
the AD conversion is fine
Try not to use that. the show is slow on the graphic LCD.
well, I am going to need to show stuff on the display π
right, but how many instances of the show do you have in the code?
one at start, one in loop
Maybe the loop iterates more than is necessary (as when info hasn't changed).
Yeah I have the same issue reading a rotary encoder during the slack time of the loop with a graphic LCD.
I can afford maybe 100uS for it
a single midi byte takes 320uS to receive, so I have to be ready for them
So maybe keep a count of iterations through the loop and update the OLED 1 in 4 or 1 in 5 passes thru the loop.
yeah, I want to update it when it is not receiving midi data. Would be easier if I could bind an interrupt to the serial port
You can do that in Arduino. ;)
See you.
<@&356864093652516868> Here is the video from the meeting last week. Sorry it took a while for me to post. https://youtu.be/GMJXIFo2HvI The notes are here: https://gist.github.com/tannewt/8c4d20223aec66398397cac3662ccfd3 The next meeting will be as usual on next Monday the 8th at 11am Pacific / 2pm Eastern.
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...
@meager fog Couldn't wait -- needed the timer for some late-nite work. It's fantastic and the chime is not disruptive. The only mod I made was to dim the neopixels to 50%; better for nighttime use. Might have to use the light sensor to adjust. Anyway, thank you!
Refuses to find the feather m0 express. Wiped and reinstalled drivers, rebooted etc. (win7)
This doesn't look like clock stretching is happening β the SCL line is hardly ever pulled low for a longer time. Have you tried with slower clocks?
Hi Dan, sorry just saw the email alert for this. :( Looks good to me though!
I lowered the I2C frequency to 10000 and it works better, but still occasionally fails withe either an OSError 5 as above or sometimes a RunTime error 2. I donβt have a logic analyzer capture of it at 10000. Would you like to see one?
What value of pull-up resistors are you using? Do you have analog pins on your logic analyzer, or an oscilloscope, so that you can actually see the shape of the signal? How long are the wires?
The breakout board has 10k pulllups. Iβll try to get some scopeshots to post this morning. I was having some trouble getting good shots yesterday. I also have another sensor, mcp9808 also with 10k pull-ups connected. Wires are about 15 cm. to ccs811.
Hi, I'm new here so first of all I'd like to congratulate everyone on a great job with circuitpython.
Thank you for the help. I have a much better idea what I am looking for now.
I also have a rather technical question:
I know I can easily achieve the same goal by connecting an RTC module to the board but I'd like to avoid it if possible.
With arduino, you can create timer interrupts by using the on-board crystal. since the Metro M0 express has a "32.768 KHz crystal for clock generation & RTC", I was wondering if circuitpython could create such interrupts (or rather event listeners I guess) based on that crystal.
I was also wondering if the time module listens is using this crystal or something else
CircuitPython doesn't currently have support for interrupts or timers.
The time module is using the same clock source that is used for the processor itself, AFAIK.
Ok, thanks!
If you have a particular project or use case in mind, we may be able to advise a better solution.
The project is a simple clock (no internet connection), so I see 3 solutions in python and 1 in c:
- in
while True: sleep 1 second then update everything (python is quite slow so I'm guessing it will be drifting quite fast) - in
while True: compare thetime.monotonic()and update when the difference is>=1 sec (less drifting that way) - add an RTC module
- in c, use timer interrupts to execute updates
sleep(1) is a bad idea, yeah
With the first 2 solutions, if it was just running the clock, things would be fine, but then there is everything that goes next to that like using buttons to set the time and/or alarm
all the rest seems workable, RTC module giving the best results with the least work
Yes, I just don't have one on hand (planned for next order :p )
well, you can just use time.monotonic() to compute the current time at any moment, and do updates whenever it's convenient in your code
you just have to set the offset
Yes, I guess that's the best solution for python with no RTC
I mean, instead of updating the seconds counter every second, just calculate it from time.monotonic() using division and modulo.
You mean and always update the display in the loop no matter what?
like curent_time = (time.monotoni() + offset) % div_constant and then display the time without further check instead of: if time.monotonic() >= next_timestamp: update()
well, you can have the check too, to not slow down your program with unnecessary updates
the point is, even if your program does something that slows it down for a second or two, afterwards your time is correct again
good luck with the project
Thanks π
ccs811 - 10Khz clock

ccs811 - default clock

ccs811 - default clock

@stuck elbow ccs811 is working a bit better at default clock rate today (cleaner wiring) still crashes with either EIO or ENOENT error after awhile
@stuck elbow also only have the ccs811 connected so only one set of pullups.
you could try with some extra pullups
the stronger the pullups, the cleaner the signal
but you said it worked fine with Arduino?
It works OK with arduino - It does occaisionally fail and I just reset it and continue on. Just hooked up logic analyzer - now failing every time at default clock - here is a screenshot
lower traces are analog
this is the last tranmission before it failed.
looks good
but it does not work π¦
can you try compiling firmware with higher timeout for the clock stretching?
sure - 512 or even higher?
Those signals look reasonable, I don't think this is the problem.
here it is working at at 10K clock
the datasheet claims it should be working with 400kHz clock...
"should" π -- I'll try increasing the strech limit
at some point you will get a WDT reset when it's too large
@stuck elbow hmm - happier with 512 - get some clearly bad readings every once in ahile, but it is running
oops - died with EIO error after a minute or so...
but I think taht happens occaisionally even on arduino
now it is back to failing every time π¦
what happens if you add a sleep so that your program doesn't query the sensor as often?
it has a .5 sec sleep now
It is running with 10K clock for several minutes (with 512 stretch) oops - just died with RunTime Error 2....
can you paste the exact error?
CO2: 402 TVOC: 0 temp: -36.1665
CO2: 402 TVOC: 0 temp: 28.1072
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ccs811_bitbang_10k.py", line 19, in <module>
File "adafruit_ccs811.py", line 155, in TVOC
File "adafruit_ccs811.py", line 150, in _update_data
RuntimeError: Error:2
>>>
>>>
that error came from the ccs811 driver
looking at the code, this is thrown when the "error" bit is set on the sensor itself
it's not a communication problem
the sensor decided to report an error
error 2 is MEASMODE_INVALID
οΏΌ
"The CCS811 received an I2C request to write an unsupported mode to
MEAS_MODE"
that looks like the sending of data is flaky
hmmm - I suppose it could still be communication related....
here is a screenshot of it working at default clock and 512 stretch
failed with EIO error shorly after....
I think three are problems with both read and write at times.
I have alway had problems wit this sensor - see forum discussion for a long history ... https://forums.adafruit.com/viewtopic.php?f=19&t=121816
i don't have the 100 micro farad capactor installed now.
you are powering the whole thing from USB, right?
but datasheet says it should only take 20-something mA
yes - I tried adding a lipo yesterday but it did not make any differnce.
yes, but it induces a lot of variation on the 3.3v line - presumably die to the heater cyccling. It sometimes drops below 3.0v
I'll need to move it back to ther breadboard to add that - ran out of pins on the feather trippler! Its too bad the featehr has only one ground pin! I'll reconfigure and try more tests.
now with 10 microF cap and 10khz clock 3.3v is 2.88 to 3.12 v - it is running.....
that may be the main problem - and I don't know wha tto do about it.....
teh 2.88-3.12 is on the breakout board 3v outout - on the input I see3.01 to 3.22
can you try powering it from the VUSB pin instead of the 3V one?
it has its own voltage regulator on board
no reason to use the one on the metro
yes, but then do I need to level shift scl/sda
I couls also bybass the ccs81 regulator and feed 3.3 v into it.
feather 3V into Vin - I ccan put it into the 3v3 output pin - I thinh taht bypasses the cccs811 regulator.
the schematic shows it already has a 10Β΅F cap, btw
yeah, do that
the regulators have a voltage drop of their own
just a minute.
pulls it down when it is running 2.88 - 3.20 V
if I reset (ground ccs811 reset pin) then the 3V line goes back to normal 3.1- 3.3 v
can you measure what current it's drawing?
perhaps I should try 5V input with level shifting for SCL/SDA?
current for ccs811 or whole system?
just for the ccs
it'll take some work. I do have an INA219 that I have not used yet. I can try to hook it up. I don't have a current probe for the scope.
you don't have a multimeter?
you connect it in series, not like the voltmeter (you probably know that, just making sure)
I do - but thanks fo checking!
I am new to circuitpython. I have a trinket m0 that I want to make a timed switch. Press the button and output goes high for the selected time. I want it to be able to be stopped if the button is pressed again before the timer is done. I've searched all over and can't find the best solution. I believe i need to use time.time but don't know the best way to impliment it. Can anyone help or direct me to a detailed article on using time.time?
@stuck elbow I have the multimeter common on ground and the 10mA DC current (red) connected to VIN - is taht right? When Ia m not seeing any voltage (on the scope) at Vin. When I tru to run it, the mter say 6 or 7 mA, but it fails to recognze the device ID
oops
in series
it measures the flow, not the potential π
@heavy galleon I don't know about any tutorial specifically about that, sorry.
ok - getting -18mA when running
that would fit the datasheet information
but that doesn't explain the voltage sagging
no - it doesn't
same as before - goes back to normal if I ground the rest pin -- meter shows - 5mA after RESET
when it fails to run - the voltage does not sag ....
@ruby lake See here https://forums.adafruit.com/viewtopic.php?f=57&t=126780#p632659 for some help on cleaning up and reinstalling Windows 7 drivers.
@stuck elbow If I powere it with 5V (and level shift the I2C lines) would taht be likely to help stabilze the current? I have a level shifter for I2C taht I can hook up.
it's worth a try
stabilize the voltage
at least we would know it's the culprit
OK - tath will take some time and I have to go do some snow removal (we got qutte bit yesterday) I'll hook that up this afternoon and let you know how it goes. thanks for a ll the time and support.
@tulip sleet yeah I'll figure it out. IT is odd though, the CPX ha no problem.
@stuck elbow re SSD1306: the Arduino lib asks for a reset pin even for I2C. So it works all the time.
it shouldn't be required
i'll look at the datasheet. If you know this well, could you look at the init sequence?
I will try, but not today
Also, I don't have that display module from Adafruit β I have similar ones from other vendors, but no problems with them other than the SH1106 one
perhaps it's enough to have the reset pulled high
I'll keep looking; the datasheet is pretty clear. I did try tying reset to ground and V+, and neither helped. It does need to be toggled, and that works.
@stuck elbow I read a number of Arduino and other forum threads. One really does need to deal with the reset pin. Boards with no external reset pins have an RC circuit to do a hardware reset on that pin.
I see, my modules probably all have that
good to know
that would also explain the trouble I had with a bare display I tried to use in a project recently
how can I simply print time in circuit python? print time.time() does not work
@heavy galleon CP boards don't have clocks onboard, so you won't be able to print out, say, 12:30 PM
time.monotonic() will print out milliseconds since... honestly, I'm not really sure, but it only counts up.
So you can use it to time things after one second, half a second, ten seconds, etc
can i just: print time.monotomic()
you can do that
doesnt seem to work on my trinket m0
I can do nothing with the time lib except time.sleep()
maybe you need to upgrade your circuitpython version
you are spelling it correctly time.monotonic() ?
yea i just mispelled it in here. my version is 2.1.0
>>>
>>>
>>> import time
>>> time.monotonic()
30.849
>>> print(time.monotonic())
42.011
>>>
@idle owl is your 938 SSD1306 wired for SPI or I2C?
ok sweet thats workin, now were getting somewhere! I can count!
@heavy galleon time.monotonic() returns a float. You will get 1msec resolution up to about 2^22 ticks, then the resolution will decrease due to floating-point precision issues. No ticks get lost, but time.monotonic will start increasing only every two msecs, then four, etc.
you can save the value when the button is pressed, and then compare to it
is that value miliseconds since... boot up? I would be happy to be within a few seconds on the minute for accuracy
2^22 msecs is about 1.165 hours. It's since hard-reset or powerup. It doesn't get reset by a soft-reset (like ctrl-D in the REPL).
well thats way more than accurate enough for my application. This is the info I needed doing all this searching on time in python didnt see anything about monotonic!
.monotonic() is not going to be wrong, it's just going to have less accuracy after 1.165 hours (to the nearest 2msecs instead of 1msecs)
for example:```>>> start=time.monotonic()
do some stuff
stop=time.monotonic()- start
print(stop)
30.6021```
@idle owl never mind I reconfigured mine. Less trouble desoldering the jumpers than I thought.
@tulip sleet Is there anything that keeps 1msec precision past 1.165 hours, or a way to programatically reset it?
@cunning crypt the internal counter is still keeping 1ms accuracy, but we don't have a way to report it (or reset .monotonic(). We're thinking about higher-precision time reporting, but haven't added anything yet. On the m4 we would be able to report the 64-bit tick value as a long int.
@stuck elbow voltage looks better with 5V VIN but not change in behavior - fails at default clock rate - runs for awhile at 10K - here is a picture at 10K
@microbuilder Feel free to add comments to PRs after they are merged. The author can always follow up with an additional PR.
@stuck elbow at least I am testing all the error conditions π ```CO2: 403 TVOC: 0 temp: 24.6277
CO2: 403 TVOC: 0 temp: 24.6277
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ccs811_bitbang_10k.py", line 19, in <module>
File "adafruit_ccs811.py", line 170, in temperature
File "adafruit_ccs811.py", line 169, in temperature
File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 19] ENODEV
Is it ok to post full code files (~100 lines) in here, I think what I've been doing today might be of help to @heavy galleon or should I PM them?
you can post files here especially if tehy may be of interest to others as well. or post code between sets of 3 backtics if it is a small file.
Thanks @solar whale
Binary clock in circuit python (no RTC)
@heavy galleon β This is a binary clock in circuitpython (without RTC module), you might not care about the binary part but the rest really sounds like what you're trying to do (from what I've seen here and in #general-tech )
awesome thank you I am going to take a look at this
@solar whale is that with the extended clock stretching timeout?
@stuck elbow yes
I'm out of ideas, sorry.
Do you have a board that has hardware i2c that you could try?
me too! I'm not a big fan of this sensor!
yes - feather m0 - I tried it yesteday - hardware I2C works well. also tried bitbang on it with mixed results - I'll try it again with this setup. Nicce taht I can just swap the boards!
@stuck elbow deshipu - have it running on feather_m0_supersized (express with bigger flash) Hardware I2C seesm to run well - bitbang with 255 stretch ran for a minute or so then error 5. I will rebuild with the increased stretch timeout for M0
@errant grail i updated the pomo code to turn off all the LEDs between 'sessions'
I have tried several approaches- here is a summary:
slow clock rate to 10Hkz -- works "better" runs for 10s of seconds or minutes then fails
increase Clock stretching limit to 512 - works a bit better -sometimes works at default clock rate - still fails eventually even at 10Khz
noted that 3V line was sagging (sometimes below 3V) when ccs811 running. powered with 5Vin and level shifters on SCL/SDA
still tight increased clock stretch timeout it works "better" It now runs at both defaul...
so at least it wont change at nite
I was doing this a few weeks ago -- let the snooze timer run on the Android smartphone clock all day -- about 14 minute intervals. I was surprised at how uneven the periods felt, depending on what was happening.
@solar whale you could also try to increase the clock stretching to something like 65535
@stuck elbow sure - I have the m0 running now with 512 - benn running for about a minute so far
@solar whale which salae did you use to get the analog signals side by side with the others? /shopping
btw im also going to release an SGP30 breakout next week
which doesnt have clock stretching
since the CCS811 has been, overall, an annoying chip
@timber mango salae 8
Thank you!
@timber mango it s a very nice tool!
@stuck elbow still running bitbang on m0 stretch=512 - several minutes
Yeah that looks like a sweet unit. Your screencaps posted last 12 hours told me I already understand it enough to be able to use it. ;) /barely
@stuck elbow - just died - error 5 - I'll set it for 65535
I had no idea an oscope could show just the leading edge of all pulses in a pulse train, cutting out the stuff to the right of each ascender.
I have so much to learn abut using my scope.
Yeah on the job we had specific instructions to follow; not a whole lot of room for innovation in approach. In high school, mostly making lissajous figures (the fun part was finding new signal sources).
@stuck elbow running now on M0 with stretch timeout 65535
just died - with erro 5 .....
I wonder if there is a firmware update for that sensor
the datasheet mentions you can update it
thanks for all the help. I think I can close the clock stretching issue - do you agree?
I think so
I learned a lot anyway.
After much discussion with @deshipu and many tests on esp8266 and feather m0 (bit banging) there does not appear to be any problem with i2c clock stretching. At least the issues with the ccs811 do not appear to be related to clock stretching so it is time to close this issue.
@slender iron heya im reviewing/testing @prime flower tone code, once its ready ill do the merge & release - kk?
yup! sounds good @meager fog
@stuck elbow > 15 minutes on M0 using HW I2C π
maybe the chip expects some specific timings
@meager fog the the try catch can probably be tightened up a bit
i know the CCS811 actually has a microcontroller in it
so it may have a wonky I2C implementation
@slender iron ok he's rebasing, im checking the guide
i'll do a style review after π
kk
@slender iron eh im not seeing what i can really do to tweak the try block
it seems pretty minimal?
last I looked it caught both ValueError and NameError
we could do the 'opposite'
try PWM first
if that fails, then try analog, then raise if that fails??
I think you only need ValueError
well also this way we dont alloc each time
thats what AudioOut raises when the pin doesn't work I think
analog out is a rarity
ok, that works for me too
how about
with pulseio.PWMOut(pin, frequency=int(frequency), variable_frequency=False) as pwm:
pwm.duty_cycle = 0x8000
time.sleep(duration)
except ValueError: # no PWM available, try analog output?
sample_length = length
square_wave = array.array("H", [0] * sample_length)
for i in range(sample_length / 2):
square_wave[i] = 0xFFFF
sample_tone = audioio.AudioOut(pin, square_wave)
sample_tone.frequency = int(len(square_wave) * frequency)
if not sample_tone.playing:
sample_tone.play(loop=True)
time.sleep(duration)
sample_tone.stop()```
@slender iron ^
π
nah, the gc will clean up if an error is raised
@meager fog ok, that works.
ok cool, yeah its a little nicer on py, since 90% of pins are PWM, but only one is analog
yup..was trying to figure out how not to alloc. the buffer. I'll test it out
oo cool, works. tested on A0 and PWM pins π
@cunning crypt time.monotonic() appears to count up in seconds of time since last power cycled. Resolves to 0.001 second and reports in seconds and decimal fractions of a second.
Thanks!
Oh since it's you .. it was .. time for me to learn this. ;)
@slender iron @prime flower ok travis passed https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO/pull/24/files ill merge then?
Anyone have an alphanumeric segment display on a H16K33 backpack and is willing to test a CircuitPython lib?
@meager fog please squash since its 9 commits
@stuck elbow Great. Want me to post the files here? Or do you want to pull them out of the PR yourself.
(first time squashin')
@idle owl I will get them
Ok.
@slender iron It looks like there's a couple of things you copied and pasted out of another file into the H16K33 readme (from CPX). I'll try to fix it through GitHub but you might want to go over it when I'm done to make sure I caught it all.
@meager fog yup
Actually I'm sure what it's supposed to look like.
should we have one library for each feather wing or one library for all wings? here is one for the motor featherwing: https://gist.github.com/tannewt/662f0ba340b6481c3ffeffb6a84d99f7
Might run into memory issues if we have one for all wings?
well, you can still import the particular wing you need
yeah
Yeah 1 might be nice
id make one librar for HT16K33
but diff libs for each implementation?
because 7 seg is really different than 16-seg or 8x8
your API will be totall different ...
dunno if that is helpful
I'm thinking these featherwing libs would mostly do init for you like cpx does
import time
from board import *
import busio
import motor_featherwing
from adafruit_motor import stepper
i2c = busio.I2C(SCL, SDA)
wing = motor_featherwing.MotorFeatherWing(i2c)
for i in range(100):
wing.stepper34.onestep()
time.sleep(0.01)
for i in range(100):
wing.stepper34.onestep(direction=stepper.BACKWARD)
time.sleep(0.01)
Are we wanting to be doing from board import * because I feel like right now we're being inconsistent with that
ideally we wouldn't need to provide i2c here at all
yeah
it'd either be from adafruit_featherwings.motor_featherwing import MotorFeatherWing or from adafruit_motor_featherwing import MotorFeatherWing
And if we run into memory issues, we start freezing modules again. I like it. And @meager fog has a good point, we have different calls for each option.
lunchtimz
I mean if we run into memory issues, it's going to be a global issue I think
we haz a lot of libs.
@idle owl the example code works for me
@stuck elbow Thank you!
@idle owl for the 14-seg display, I mean
yeah, these easy init libraries aren't memory friendly
Can you put an update that you tested it in the PR?
@slender iron Agreed but we've figured out a lot of techniques in building cpx
sounds good to me
that way we have a place for issues to add new ones
and its easier to track
driver chip libs should be separate because they are used in multiple ways
oooh, we could have the wing classes share the i2c on their own
@stuck elbow I still have to fix the linting issues that came up from the travis update I assume since it didn't run a check until I did a commit to fix the typos you caught earlier. So if you can just update that you tested it with a segment display that would be great
@slender iron nice yeah!
just did that
Thank you!
ohhh, kicad hackchat time
Oh yeah!
@stuck elbow You have a minute? I'm not sure how to fix the issue pylint is throwing. Feels like something you might know.
shoot
class Matrix8x8(HT16K33):
"""A single matrix."""
def pixel(self, x, y, color=None):
"""Get or set the color of a given pixel."""
if not 0 <= x <= 7:
return
if not 0 <= y <= 7:
return
x = (x - 1) % 8
return super()._pixel(x, y, color)```
Saying `R: 53, 4: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)` - ` x = (x - 1) % 8` is line 53. There are three of these in two files. Same error for all of them.
replace return with return None I guess
ok trying that. need to make a local copy of the file so I'm not waiting for travis every time
that's what an empty return does anyways
yep ^^
shouldn't it raise an exception if the x, y coordinates are out of bounds?
wait a sec bugger, wrong file. hold on.
@slender iron that would make writing graphics functions very tedious
Ok, that error is being thrown on the def pixel line here: python class Matrix16x8(HT16K33): """A double matrix or the matrix wing.""" def pixel(self, x, y, color=None): """Get or set the color of a given pixel.""" if not 0 <= x <= 15: return if not 0 <= y <= 7: return if x >= 8: x -= 8 y += 8 return super()._pixel(y, x, color)
it's on the def line of each of the class members in this file
@slender iron it's much easier to assume an infinite drawing surface that is only partially shown on the screen
ah, that makes sense
so I don't know which return statements it's unhappy about
@idle owl it doesn't like the 2 empty returns. well, its not happy that they have a close relative that isn't empty like they are...
ah ok
@idle owl the empty ones inside the ifs
So try return None there then?
yes
Hey nice. made it happy
sorry about that, that was me being lazy
Well locally I have a bunch more errors but we must have altered those in the pylint config online. need to get that locally apparently.
@slender iron I had Andon test UID last night. CPX and Feather M0 Basic reported unique numbers. I just wish I could figure out a way to talk to my trinket with Atmel Studio and read the memory from there to verify...