Thanks for the explanation - makes sense. If you want input on this, or testing of the ideas with students, I'd like to help. I teach in an MFA program, build tools and teach designers how to use programming to make prototypes for things like IoT and AI, where multiprocessing and asynchronous processing are critical. I'm using the Circuit Playground Express, ESP32, etc. and am switching from Arduino to Python.
#circuitpython-dev
1 messages ยท Page 191 of 1
Thanks, see if you have any comments for #619, which may or may not be enough for you.
The latest MicroPython merge, incorporated in 4.0.0-alpha, now checks the validity of keyword args to print(), instead of ignoring keywords it doesn't recognize.
flush is not currently handled, but has valid uses: cf. https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint/pull/9, where end="", flush=True is passed to allow incremental status messages to be printed on the same line.
It looks like flush=True is the "default", and flush=False (buffers output) is not possi...
@deshipu,
@tannewt's suggestion to move shared_timer_handler back into CircuitPython is underway as part of samd-peripherals PR #4 referenced above.
Also at tannewt's suggestion, vectoring which specific handler to use now mimics how it is done with the EIC_Handler (samd-peripherals/external_interrupts.x). If you want to plan ahead, and or comment, the current version is here. This will...
Oh, thanks, I was planning to work on this this weekend, but things got in a way.
Here are some breaking-change requests to make uart match CPython (pyserial)
- Change
timeoutarg to seconds rather than milliseconds - Require bytes only, don't allow strings (e.g. uart.write("hello") should fail, but uart.write(b'hello') is ok)
I'm going to merge this because it fixes everything but the translation build. Its verifying all strings are in the .po files for translators. You'll need to run make translate at the top level and do another PR. Thanks!
I'm not concerned about a bit of performance loss because its not a core focus for us. I'm also not worried about losing the traceback since its arbitrary. So, its up to you how you want to solve it. :-) Either way works for me.
@bronze geyser I use this: https://github.com/bnahill/PyCortexMDebug
it prints registers out based on the svd file
hey all, i know how to read a file line by line ... but what would be the equivalent using readinto? how do you get the entire file, when you read X number of bytes at a time?
just do yourfile.read(), but there is no read_into(), it will allocate the buffer
yes, that's what you wanted
what if the file is large? how do i read smaller chunks at a time? the function readinto() seems to exit early.
sure, f.read(x) will read at most x bytes, see Python documentation on files: https://docs.python.org/3/library/io.html#io.RawIOBase.read
@stuck elbow that is the problem.... it exits the while loop before reading all contents.
exits the while loop?
sorry, the with loop
with is not a loop
perhaps you should pause what you are trying to do, and do a Python tutorial first, I'm sure it will clear some confusion
ouch ...
it's always good to systematize your knowledge a bit
problem solved I have.
if you store file in binary, you must read it in binary, otherwise , readline() will not work ๐
well, it will work, just not the way you expect it to
computers are contrary creatures, they will always jump at the opportunity to do literally what you told them, but not what you meant
With a new clone of the current master repo, I get the following error when trying to build the nrf port on my MACOS system. It compiles fine under Linux.
/Users/jerryneedell/projects/circuitpython/ports/nrf
[Jerry-desktop-mini-8:circuitpython/ports/nrf] jerryneedell% make BOARD=pca10056 clean
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-pca10056-s140
[Jerry-desktop-mini-8:circuitpython/ports/nrf] jerryneedell...
Re: translations - I assume we're going to have to add any new message strings to circuitpython.pot? I missed that until reading that PR..
[adafruit/circuitpython] New comment on issue #1126: long\-lived UART buffer still not working right
I'll try to take a look at this tonight. If I came provide a resolution then maybe the change needs to be reverted for now
@indigo wedge how is the bluetooth api coming?
@raven canopy yup, by running make translate at the top level
<@&356864093652516868> and anyone else interested, CircuitPython Weekly Meeting in approx 13 minutes.
๐
Hehe. Did I trample?
nah, happy to have help
<@&356864093652516868> Meeting notes are here: https://docs.google.com/document/d/1WCMrYDubcKOXvJg6x80jzjb0HQDTKM7mCQgDh2eIMNI/edit?usp=sharing
Google Docs
Adafruit CircuitPython Weekly August 20th, 2018 Video is available here:Thanks to @kattni for taking notes!Join here for the chat all week: http://adafru.it/discordThe weekly happens normally at 2pm ET/11am PT on Mondays. Check the #circuitpython channel for notices of ...
Morning! I'll be in stealth mode for today's call. ๐
(Ostensibly working. ๐ )
Android wants Google docs app... I'll start direct edit next week. ๐
here but not audio
Yay for the French translation folks!
Merci!
@meager fog hug report?
kattni & brennen for amazing break-neck speed raspberry pi testing and documentation
@kattni & @brennan for pushing through on the PyPi stuff. @deshipu for [display and other] support on discord this week. @dglaude, @arofarn, @carlos, and @turbinenreiter for the translation work. Group hug to cover what my scrambled neurons may have missed!
Reiteration Hug: @tannewt & @Dan Halbert for always having time questions (status update related).
they have rocked it, kattni is a fritzing machine
Thanks Sommersoft for your work on GitHub this weekend
she is HALF fritzing HALF human
terminator style
also brent wrote a great guide using the new circuitpython for raspi using a plethora of sensors
and tehy worked amazingly
so its all COming together
also scott and dan have happily reviewed my 2am PR's
๐ง 
goooooo team!
welcome back dan
nothing to report
(voice finally connected, yay!)
@meager fog status updates?
Adabot Patching: PR is merged. Will run .pylintrc->ignore-modules=board patch tonight. Then will work out the pylint v1.9.2 patch(es). Also will add a dry-run option to patching; I'm getting tired of changing git repo sources to test patches. ๐
FrequencyIn: Working just dandy; FREQM peripheral gets M4 as accurate as can be with the Open DFLL. For now, at least. Initial PRs for submodule updates are merged. Couple more things to tighten up, then the big PR will happen. <Insert Reiteration Hug>
Library cookiecutter: updated with .travis.yml->pylint v1.9.2 and .pylintrc->ignore-modules=board.
weeds -- build question
weeds - NFC lib general discussion (low prio)
fatal: no tag exactly matches '867a9c551f9cae41086030582ed690cabedca2d6'
re: pypi, something i didn't mention under status updates is that we've got an ongoing process of deprecating older adafruit python libs in favor of the circuitpython versions as they come online. (we're pushing READMEs to pypi that mention the deprecation.)
@slender iron hi was in a meetnig, update is just all the raspi python stuff
np
@tidal kiln if y'all are chatting about PN532 there's a python library that can be used to get started
i can help with it, too. its on my list
im not on audio
Thanks everyone! Have a great day!
@meager fog ok. that was the general question. i created the issue, but was wondering if anyone with experience with it would start working on the driver. i can take a look at existing python lib and make a start?
@tidal kiln to check do you mean PN532 or TCA9548?
do you have a PN532 breakout or shield or somethin' already?
@meager fog PN532 for NFC (we're chatting about something else now)
ik this is the python lib https://github.com/adafruit/Adafruit_Python_PN532
its pretty close - need circuitpythonification
i can take a look if its not up anyone's alley
Works for me:
/V/E/c/p/nrf (translate|โ) $ make BOARD=pca10056 clean
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-pca10056-s140
/V/E/c/p/nrf (translate|โ) $ make BOARD=pca10056
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Create build-pca10056-s140/genhdr/pins.h
QSTR updated
python3 ../../py/makeqstrdata.py build-pca10056-s140/genhdr/qstrdefs.preprocess...
-> food, back in a couple.
@meager fog currently don't have any NFC HW, but can acquire (probably go with breakout) and start chipping away at it
@slender iron creating the case sensitive image was simple!! Thanks. Will test build later tonight. I have to run out for a bit.
great @solar whale !
I went into the circuitpython weekly meeting and I could not unmute my mike. Is there something special that I have to do join in the conversation?
@inland tusk Sometimes Discord is weird. Reloading, reconnecting, restarting sometimes helps.
There's nothing special you have to do to join the conversation.
As suspected - it builds fine in a "case-sensitive filesystem" on the Mac.
Should I just close this or do you want to update the guide first?
can anyone else verify this? (latest everything):
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit CircuitPlayground Express with samd21g18
>>> from adafruit_crickit import crickit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_crickit.py", line 58, in <module>
MemoryError: memory allocation failed, allocating 235 bytes
>>>
@tidal kiln are you using the CPX with Crickit frozen in?
ah. maybe.
IIRC, it says
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit CircuitPlayground Express with Crickit
as in maybe not
Adafruit CircuitPython 3.0.0-rc.0-9-gbf9981e8d-dirty on 2018-07-04; Adafruit CircuitPlayground Express with Crickit libraries with samd21g18
>>> from adafruit_crickit import crickit
>>>
PEBKAC
@raven canopy thanks
:+1:
hmmm. the link here doesn't go to latest build:
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/circuitpython-code#install-cpx-special-build-23-1
@tidal kiln I will fix that link
@tulip sleet awesome. thanks.
@inland tusk The unmute button is way at the bottom:
Also check the "Voice and Video" settings. Click the Gear icon, seen on the right on the screenshot above
not infrequently i just have to restart the browser, and i've never had it work in firefox.
but that's pretty much par for the course with web apps and linux audio.
same here. i gave up and use the app version on mondays for the meeting just for that reason. otherwise i'm in browser.
i was sometimes able to get it to work in firefox, depending on tide, phase of moon, etc.
<@&356864093652516868> Here is the recording of today's meeting. Thanks all! https://youtu.be/XBIzLuUPkbU
Notes with time codes are available here: https://gist.github.com/tannewt/d54f35b2143443aae53c8b257a7073c2 Thanks to @kattni for taking notes! Join here for ...
@rotund basin we were testing UART with the wrong 3.x release; that one did not have the fix. Please try https://adafruit-circuit-python.s3.amazonaws.com/bin/feather_m0_adalogger/adafruit-circuitpython-feather_m0_adalogger-20180809-cac760a.bin
[adafruit/circuitpython] New comment on issue #1126: long\-lived UART buffer still not working right
The build that I tested against was too old, and did not include #1080. So I believe this is a red herring. Tested against cac760a, and UART seems to work fine.
@robomike could you retest with this build?
https://adafruit-circuit-python.s3.amazonaws.com/bin/feather_m0_adalogger/adafruit-circuitpython-feather_m0_adalogger-20180809-cac760a.bin
I added a paragraph about it: https://learn.adafruit.com/building-circuitpython/macos
Thanks!
@slender iron is this "typical"?
vagrant@ubuntu-xenial:/usr/sommersoft/circuitpython$ sudo git add locale/*
The following paths are ignored by one of your .gitignore files:
locale/en_US.po~
locale/es.po~
locale/fr.po~
Use -f if you really want to add them.
use -f?
the .po files are the compiled ones, you want to only add the .mo files, I guess?
or is it about the ~ at the end, because your vim/emacs keeps them as a caches?
๐คท first time i've run the new make translate. ๐
wait...nvm. add /* is picking up the cached files. good call @stuck elbow!
git add locale/*.po much happier...
I never remember which ones are the compiled ones, .mo or .po
now we wait to see what Travis has to say...
po are uncompiled
Travis does not like the new submodules. ๐ค
@notro whenever a new translate() call is added. Travis just runs make translate to see if anything new is picked up and errors out if there is.
@raven canopy Travis does not like... period
๐ i'll take Travis' grumpiness for the tradeoff of functioning code.
i need all the help i can get...
@solar whale 5v pins work for me with a single pixel
let me make sure its the right code
hmm - can you link the build and test code -- I'll try it.
import neopixel_write
import digitalio
import time
import board
import pulseio
pwm = pulseio.PWMOut(board.D10)
pwm.duty_cycle = 2 ** 15
pin = digitalio.DigitalInOut(board.D5)
pin.direction=digitalio.Direction.OUTPUT
pixel_off=bytearray([0,0,0,0])
pixel_on=bytearray([0,255,0,0])
while True:
neopixel_write.neopixel_write(pin,pixel_off)
time.sleep(1)
neopixel_write.neopixel_write(pin,pixel_on)
time.sleep(1)
what build?
building a fresh one now
could be cache weirdness still
measure the pwm on d10 if you have a chance @solar whale
Adafruit CircuitPython 3.0.0-7-gcac760aa6 on 2018-08-20
works ok
let me try from travis
I amm using the same build -- does not work for me
what frequency is the pwm for you?
checking
2e80 works from travis too
500 hz
let me see what other neopixels I have
i have fairly long wires
ok I found an rgbw that fails
shorter wires still fails
blindingly so
yup!
ok - sounds like we have the same setup now
ok and its ok on 3v
yup
still wrorried abput the spikes on 5V
ya. maybe @meager fog is around to help us debug
weird -- now it is working -- with scope probe on D5!!
and it works w/o probe now too!!
ok, if I shorten the high pulse for 0s it works
full strip test fails ...
how many?
--- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c
+++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c
@@ -109,7 +109,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop;");
#endif
#ifdef SAMD51
- delay_cycles(3);
+ delay_cycles(1);
#endif
if((p & bitMask) != 0) {
// This is the high delay unique to a one bit.
@@ -129,7 +129,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop;");
#endif
#ifdef SAMD51
- delay_cycles(3);
+ delay_cycles(2);
#endif
}
if((bitMask >>= 1) != 0) {
FYI - I'm using https://www.adafruit.com/product/2869
What is better than smart RGB LEDs? Smart RGB+White LEDs! These NeoPixel sticks now have 4 LEDs in them (red, green, blue and white) for excellent lighting effects.ย These are fun and ...
I'll try that mod
ya. I have one of those too
ah -- but taht is on the 3.x modified version - correct?
ok -- I need to pull that
itsy m4
thanks
np
hmm -- no response on the strip -- write freq is 926Hz
with 1 pixel or strip?
ok -- let me see if I can imporve my wiring.
ok -- your test works
and full test works
# Gemma IO demo - NeoPixel
from digitalio import *
from board import *
import neopixel
import time
pixpin = D5
numpix = 8
#led = DigitalInOut(D13)
#led.direction = Direction.OUTPUT
strip = neopixel.NeoPixel(pixpin, numpix, bpp=4, brightness=0.3,auto_write=False)
def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g - b - back to r.
if (pos < 0):
return (0, 0, 0, 0)
if (pos > 255):
return (0, 0, 0, 0)
if (pos < 85):
return (int(pos * 3), int(255 - (pos*3)), 0, 0)
elif (pos < 170):
pos -= 85
return (int(255 - pos*3), 0, int(pos*3), 0)
else:
pos -= 170
return (0, int(pos*3), int(255 - pos*3), 0)
def rainbow_cycle(wait):
for j in range(255):
for i in range(len(strip)):
idx = int ((i * 256 / len(strip)) + j)
strip[i] = wheel(idx & 255)
strip.show()
time.sleep(wait)
try:
while True:
rainbow_cycle(0.001)
except:
pass
finally:
strip.fill((0,0,0,0))
strip.show()
with shorter wires?
ya, will merge it over soon
thanks
np thanks for the testing!
SK6812 on 5v is pickier than WS2812 on 5v.
Hopefully fixes #1083.
PR #1132 worked on my ITSY BITSY M4 express -- but I did find that I had to improve my wire connections to get it to work reliably.
@raven canopy you around?
@slender iron do you need me to merge the PR or is Jerry's review enough?
travis is happy
@raven canopy nm, I was going to have you look at a PR but it's done. no worries
either way. I was waiting for travis. You ok with me releasing 3.0.1?
@slender iron I also checked it with a 7 RGB neopixel "jewel" -- worked at 5V and 3.3V
ok awesome!
ah, I need to hallowing too
@slender iron i'm fine with 3.0.1. The UART thing appears to have a been a red herrring -- we were confused about which build to test.
k. I need to test the hallowing first
[adafruit/circuitpython] New comment on issue #1126: long\-lived UART buffer still not working right
I don't have a Feather M0 datalogger, so I tested with a Feather M0 Express instead.
In order to make a test of both send and receive without getting out the 'scope, I placed a 220โฆ resistor between the RX and TX pins.
With the above-shown content in test_uart.py, I opened the repl:
Adafruit CircuitPython 3.0.0-7-gcac760aa6 on 2018-08-20; Adafruit Feather M0 Express with samd21g18
>>> import test_uart
>>> test_uart.uart.write(b'\xbb')
1
>>> test_uart.uart.read(1)
b'\xbb'
>...
@idle owl sorry. was eating and watching an episode of The 100 with kiddo. But, glad I wasn't essential! ๐
@slender iron or @tulip sleet, is there a right or wrong way to update the submodules? Getting this from Travis:
Fetched in submodule path 'ports/atmel-samd/asf4', but it did not contain f976380441d550910f0cd9726fac3cdea8d12a78. Direct fetching of that commit failed.
The command "eval git submodule update --init --recursive " failed. Retrying, 2 of 3
i updated with:
cd asf4
git pull origin master
cd ..
git commit
[adafruit/circuitpython] New comment on issue #1126: long\-lived UART buffer still not working right
@jepler Thanks for vetting. I think we can close.
@raven canopy. Just do git submodule update --init --recursive in circuitpython but not in a submodule. For asf4, you want the circuitpython branch, not the master branch, but you shouldn't need to do what you did manually above.
@tulip sleet i need to merge in updates for PRs i made to both asf4 and samd-peripherals... i didn't think that git submodule update would accomplish that.
I see. Do
cd asf4
git checkout circuitpython
git pull
I think that's all you need to do.
for samd-peripherals, git checkout master
hmm. i might need to revisit the asf4 one. i think we merged into master.
which would probably explain the fetch error...
first things first; revert that commit. ๐
The branches in asf4 are: master: pristine version from Atmel START; master-bugfixes: known bugs that should be applied to any branch; circuitpython: changes needed for circuitpython.
In practice, there's almost nothing in master-bugfixes, and we've just been changing the circuitpython branch. Just submit a PR against that branch.
The original idea was that something besides circuitpython might be using this repo. In practice nobody is, and I wouldn't recommend it ๐
๐
also submit a PR to revert the change to master, I think, to keep it clean
yep. i have a double revert, and a new commit underway. ๐
@tulip sleet before i push this revert, is this something that is "unwanted" in master? https://github.com/adafruit/asf4/pull/24
it's just "unwanted" because it's not present in what we would download from Atmel START. I made up a tiny project with FREQM in it and I see they did #define FREQM_GCLK_ID_REF 6 in driver_init.c, but not in freqm.h, which is, well, weird.
the idea is just that it would be easier to merge from upstream if there were no changes introduced by us.
kk. understood, and i am no help in explaining any decisions made by START. ๐
reverting that commit at least got Travis to run enough to give me more fixes. yay! ๐
and thanks for the quick merge @tulip sleet!
yw!
pirkey
-4 bytes free in flash out of 188416 bytes ( 184.0 kb ).
๐ฆ
4 bytes? Wow, cutting it close.
yeah. makes the time i'll spend getting it to pass worth it. ๐
that's enough Travis battle for tonight.. ๐ซ
Hi,
Had a busy week at work last week but i had some free time today to continue the strings translations for Spanish language, this is clearly work in progress, if there's anyone who talk/understand Spanish please let me know.
There seems to be a merge issue as i haven't update my fork it in the last days, if you see something really wrong please let me know.
Carlos
Hi y'all (i guess everybody is asleep already, my timezone doesn't help me a lot to hang in here), just finished listening today's report and there's my WIP in a PR. Cya.
@tidal kiln and others who wanted an RFID reader, https://github.com/ladyada/Adafruit_Circuitpython_PN532 mostly works, i2c only right now
@meager fog thanks. i've got a breakout on the way. i'll help out on this when it gets here, unless it's all done by then. ๐
I received my ItsyBitsy today. I have installed the latest library bundle and downloaded the latest uf2 file. I've read through various bits of documentation but it's still not obvious how I should update the boot loader.
is there much difference between circuitpython and micropython?
some
the hardware api is different, and cp has some features disabled, also they support different set of platforms
I just started with micropython last night and it(the IDE) works well with a wemos d1 mini but they're horrible when it comes to battery efficiency especially for deep sleep with the step-up and step-down of the battery voltage compared to an esp8266 using raw battery voltage. Is the cp ide good with a plain esp + usb-serial / nodemcu dev board (like arduino ide is) or will I have the same trouble?
the IDE?
yeah
Regarding the uf2 question. Problem solved, I just copied the latest uf2 file to the same directory that contains "current.uf2". Everything seems to be running correctly.
@rain charm on the samd and nrf52 platforms the device is simply visible as a usb drive, you can copy or edit your files there directly
@rain charm on the esp8266 you use ampy or any other utility that does it, just like with micropython
micropython doesn't have an ide either
fine - utility then. are there other utilities that are gui?
what would be a search term for a gui utility for micropython to an esp8266?
no idea
hello all
I am using feather M0 express and circuitpython but have some doubts about using the rtc to print the time in a different format like YYYY/MM/DD hh:mm
for now I use this:
import rtc
clock=rtc.RTC()
while True:
print(clock.datetime)
but can not understand how to change it?
Can some one give me a help?
clock.datetime is a tuple, you can access its individual fields by indexing, like clock.datetime[0] etc.
then you can incorportate those numbers in your own string using the % operator for strings, like: d=clock.datetime; "%d/%d/%d" % (d[0], d[1], d[2])
Oh I see!
thanks a lot
I want to make a log file and use this:
d=clock.datetime
f.write("%d/%d/%d %d:%d " % (d[0], d[1], d[2], d[3], d[4]))
Now it works!
Does some one know if the alarm option is already implemented or not?
I would like to make a log every minute and in order to preserve battery would like to put the processor in sleep state while wait...
circuitpython has no callbacks, so no alarm
do you know another way to reduce power while not acquire values?
no
so the better option probably is to use Arduino IDE as it have this functions but the file manager is not so friendly
๐ฆ
I'm sure circuitpython will have power management features at some point, it's just still relatively early in the development and there are other priorities
with arduino ide installed you can use vs code with arduino extension
but i wish there is circuitPython extension as well but need to work with python one for now
I understand!
@final root typically you don't need to update the bootloader. however, you can update the circuitpython firmware:
https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython
and once that's installed, add the latest library bundle:
https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries
๐ฉ i updated feather M0 adalogger to 3.0.1 and forgot to backup code before... Luckily I have an earlier version of the code i lost saved
did updating the firmware wipe out your files also?
It happens every so often.
anyone ever run into a read only behavior for CPLAYBOOT on Win 10?
https://forums.adafruit.com/viewtopic.php?f=58&t=139703&p=692229#p692188
@slender iron thanks for the link to PyCortexMDebug ....i haven't been on discord since Sunday - so I didn't see it until now. Funny though, this AM I started playing around with PyCortexMDebug once I figured out GDB has its very own python interpreter. I mean...wow...I had no idea...so there we have it. Every day. Something to learn that everyone else already seems to know.
not sure why but my feather MO adalogger is both drive (F:) and drive (G:) G is empty but when i eject it it ejects F: also...
i tried storage.erase_filesystem() also tried different version of CP still shows up as two drives... im gana restart PC and see if that helps
@tidal kiln the only thing I remember seeing is similar to explorer erroring or locking up. Dan has narrowed that down to antivirus (Kaspersky in most cases).
still shows up as 2 drives
it is a windows issue ๐คง
@upbeat plover mine does it also, it doesn't seem to affect anything so I'm not working about it. MU also recognizes it., again i'm nor worrying.
under Device Manager > Disk drives I just disabled the drive with nothing in it
did it work?
doesnt show up but, just visual pc still shows it disable in device manager
not sure what "Uninstall Device" would do so not going to try
This code produces an error. With release adafruit-circuitpython-circuitplayground_express-3.0.0.uf2
import board
import neopixel
from adafruit_circuitplayground.express import cpx
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cpxneo.py", line 4, in <module>
File "neopixel.py", line 91, in __init__
ValueError: Pin PB23 in use
neopixel is initialised in the Circuit Playground Express cpx lib, so you can't import both. If you want to use NeoPixels with the cpx lib, try using cpx.pixels. Otherwise, you'll need to use the individual libraries you wish to use to be able to use neopixel separately.
When running a DHT11 sensor, I get a hesiation in my system every second or so.
Ah, got it, thanks. Sorry, I was referencing this code which I guess is out of date now.
For completeness, working code:
import time
from adafruit_circuitplayground.express import cpx
cpx.pixels.fill((127, 0, 0))
cpx.pixels.show()
while True:
x, y, z = cpx.acceleration
print(x, y, z)
time.sleep(0.1)
@stoic marsh can you link to your code?
wait... if it uses busio, it needs bus_device right?
No I'm conflating I guess.
@tidal kiln Do you have a moment?
totes
sanity check me here: when auto_write is disabled, you call show in this library right? https://github.com/adafruit/Adafruit_CircuitPython_TLC59711/blob/master/adafruit_tlc59711.py
Not write?
wait it's not even called auto_write anymore either. it's auto_show
The library was updated and the example/guide was not. If I'm reading this correctly anyway.
i didn't write that lib. i can help with it though. what's the general issue?
That the guide is wrong. I want you to verify that I'm reading it right and it's auto_show and show that are used not auto_write and write.
I'm updating it for the PyPi stuff, and on a hunch, checked to see if it had changed to show
the parameter is definitely called auto_show:
https://github.com/adafruit/Adafruit_CircuitPython_TLC59711/blob/master/adafruit_tlc59711.py#L142
and there is a function called show:
https://github.com/adafruit/Adafruit_CircuitPython_TLC59711/blob/master/adafruit_tlc59711.py#L214
Ok. Thanks. I'm on the tail end of working entirely too many days in a row and wanted to make sure I wasn't missing something.
PR time
but under the hood, it looks like auto_show is being used conditionally to call _write, ex:
https://github.com/adafruit/Adafruit_CircuitPython_TLC59711/blob/master/adafruit_tlc59711.py#L232
yeah that's why I second guessed myself
Also, this Adafruit example uses the same approach combining cpx and neopixel libs and doesn't work. It would be good to get that updated:
https://learn.adafruit.com/ufo-circuit-playground-express/code-the-ufo-with-circuitpython
which is effectively the same as calling show:
https://github.com/adafruit/Adafruit_CircuitPython_TLC59711/blob/master/adafruit_tlc59711.py#L218
wait. I may have linked the wrong library. I did.
hold on.
No this one still uses write.
shakes her fist at the inconsistency
i have done something similar, i think it was with the LED backpacks, and i went with the naming convention used by neopixel:
https://circuitpython.readthedocs.io/projects/neopixel/en/latest/api.html#neopixel.NeoPixel
Yah. The other lib was updated by Scott it looks like, so I'm not surprised that it has show in it.
in that TLC59711 lib, i probably would have called show instead of _write, but for now it's a moot point since it's effectively the same
happy to help. i'll leave you to your first shaking....
I moved on pretty quickly ๐ so much to do, no time for much shaking.
@tidal kiln actually one more thing. I have a PR I need merged. Can you take a look? We removed SPI references from the example because SPI doesn't work. It was never tested.
@pvanallen There is a feedback link on the guide page, if you could leave the feedback there regarding the code, that would be greatly appreciated!
can't test it, but it looks pretty trivial
yah it doesn't change any actual code. it removes comments.
@tidal kiln #https://www.programcreek.com/python/example/68801/time.monotonic
import os
import time
import board
from analogio import AnalogIn
from digitalio import DigitalInOut, Direction, Pull
import adafruit_dht
dht = adafruit_dht.DHT22(board.D11)
led_5 = DigitalInOut(board.D5)
led_6 = DigitalInOut(board.D6)
led_9 = DigitalInOut(board.D9)
led_5.direction = Direction.OUTPUT
led_6.direction = Direction.OUTPUT
led_9.direction = Direction.OUTPUT
dht = adafruit_dht.DHT11(board.D11)
BLINK_RATE_1 = 0.15
BLINK_RATE_2 = 0.16
BLINK_RATE_3 = 0.165
DHT_RATE = 1
now = time.monotonic()
last_update_1 = now
last_update_2 = now
last_update_3 = now
dht_update = now
while True:
now = time.monotonic()
if now - last_update_1 > BLINK_RATE_1:
if led_5.value == 0:
led_5.value = True
else:
led_5.value = False
last_update_1 = now
if now - last_update_2 > BLINK_RATE_2:
if led_6.value == 0:
led_6.value = True
else:
led_6.value = False
last_update_2 = now
if now - last_update_3 > BLINK_RATE_3:
if led_9.value == 0:
led_9.value = True
else:
led_9.value = False
last_update_3= now
if now - dht_update > DHT_RATE:
try:
print("Temperature,", dht.temperature)
print("Humidity,", dht.humidity)
except:
pass
This page provides Python code examples for time.monotonic.
@idle owl done
Thank you so much!
@stoic marsh provide more detail on what you mean by hesitation
Yes, saw that after my post and commented a few minutes ago, referencing this issue.
@tidal kiln my LEDs blink at 0.2 seconds however each 1.0 second my system pauses for less than a second. The REPL will hang (stop printing) just like my lights
sounds like it's the small delay that occurs for talking to the DHT every 1 second
you need to update dht_update in the last conditional
if now - dht_update > DHT_RATE:
try:
print("Temperature,", dht.temperature)
print("Humidity,", dht.humidity)
except:
pass
dht_update = now
@tidal kiln I just realized that ๐ฆ
I am looking for an example of a simple checksum for a serial protocol that I can implement in circuitpython
Hello all. I was just rummaging through forums to see if there was any FFT library for CircuitPython. I found one discussion on it: https://forums.adafruit.com/viewtopic.php?f=60&t=130944&p=692349 - this feels like something that might be best glued in from an existing C implementation?
i don''t know what i'm doing so i am hoping my ask for help isn't too tedious. My challenge is getting PyCortexMDebug w/in GDB session. I downloaded PyCortexMDebug, then ran $ python2 setup.py install (note: i am paying the price for naively installing 2 versions of python - anaconda 3.6 and the default 2.7 that comes w/ Mac os). I then get into my debug session (copied gdb.py into the folder). Now on to (gdb) source gdb.py and i get Import Error: No module named cmdebug.svd_gdb ...usually, i have not problem. i just figure out the path to the module and get that all working. Here, I am confused because in my head the python2 setup.py install should have made these modules available? And i'm also not used to modules with dot....so advice appreciated. I am googling away and will eventually figure out my stupidity...but just in case it is possible to save me hours of stupidity.
Thank you cater. I'd confused firmware with bootloader, too much time spent on Arduino probably. Thank you also for the links.
PyConCanada (nov 9-13) just popped up on my feed again. Anyone else planning on going?
I'm breaking this out into its own PR because it can stand alone and be easily merged into other development branches.
The additions to feather_nrf52840_express/mpconfigboard.h will probably change. They are placeholder info for now.
@bronze geyser Python is built into in gdb. You don't need to install those things. Just clone https://github.com/tannewt/PyCortexMDebug. Then use the sload21 and sload51 entries in my .gdbinit file (attached) here, modified for where you cloned that repo. You get the .svd files from these "packs: https://www.keil.com/dd2/Pack/ Search for MicroChip on that page. Download the appropriate .pack file. They are really. zip files, so rename to .zip if necessary, unzip, and find the .svd files you need.
My .gdbinit file
@dhalbert THANK YOU (THANK YOU). I will give your steps a twirl. I completely appreciate your help.
@dhalbert AGAIN THANK YOU. This is simply wonderful. Thank you for sharing the .gbinit file. The contents are beyond my current capability...so it was great to learn from it. Oddly thrilling to type svd WDT and such then view the content.
@bronze geyser @slender iron found it originally; we both use it: a big timesaver and it really encourages "let's just look at the registers, shall we?"
@dhalbert i started playing around with EmbSysRegView w/in Eclipse when I was bumbling about the Atmel Start app i plugged into Eclipse. I had so much fun watching bits twiggling. I missed that in GDB (that and well - things like having all these windows with cool goop like local variables, watchpoint, breakpoints, source code/step debugging that is more obvious....but how cool it is to extend gdb w/ python. my oh my. folks sure are smart!
@bronze geyser v nice; btw, tag me as @tulip sleet, not @dhalbert here, else I won't see a notification. @dhalbert is right for GitHub.
@tulip sleet any suggestion on getting pIRkey build within size, when only one translation is failing (french)?
-12 bytes free in flash out of 188416 bytes ( 184.0 kb ).
24644 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
Too little flash!!!
trying...
this is on my Travis, with FrequencyIn. and just checked Trinket:
16 bytes free in flash out of 188416 bytes ( 184.0 kb ).
24592 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
๐ฌ
is this with your FREQM code?
i haven't tried to build other than english, what's the command line for the build?
runs to the makefile ๐
i need to run make translation with another arg?
is the point that you'd be using pulseio.FrequencyIn for the IR receive?
what is the size with en_US?
it won't be used on pirkey, that i can think of. it has no GPIO correct? i had the thought about of wrapping it all in #ifndef PIRKEY, and raising NotImplemented otherwise. but, even after that, it looks like French may be a problem elsewhere (see above for Trinket).
can i ask what you need to run to pull the recursive sub repos when you first download circuitpython?
@marble hornet yes git submodule update --init --recursive, and also when you change branches
@marble hornet because they aren't downloaded with the original clone. each submodule is a .git of its own...
or pull or merge to update
ohhhh.... "what to run". not "why". ๐
i can never remeber the darned thing. i'll put it in a text file now
thanks @tulip sleet
and you too sommer soft
hehe. i try. ๐
it should be in the "Building CircuitPython" Learn guide
YAY!
but we need pulseio for IR receive in general, right? Scott is very reluctant to drop individual classes from modules.
can you point to the travis page -- I just want to look at the other build sizes
could the class from pulseio be put into ir?
it's c code, so hard to move
@tulip sleet yeah. in comparing the last adafruit travis builds and mine, i'm eating flash like peanut butter. i may have to reserve FrequencyIn for M0 Express and M4....
esp & nrf are stubbed out...got one more thing to work out for those to build.
without FrequencyIn, pirkey has 2624 bytes free in english
there may be an example of #if'ing something out and making it NotImplemented, but I'm not sure about that
I2C has it, but only for the construct; not the entire module.
but, like i said. Trinket in French has 12 bytes... English and Spanish are at 1260 bytes. it really might be better to cast a wide net on this one.
or...my code is just that bloated. ๐
if the TC direct pin capture worked as advertised in the datasheets, it would be much slimmer. no need for all the EIC & EVSYS code.
i looked through the french msgs -- they don't look THAT much longer, but maybe the sum is
i need to look closer at how the translation stuff works. i know that i didn't add any translation strings, so i don't know what exactly it is translating.
spanish is a fake right now, because it's still being worked on -- it's just the english file -- that's why it's the same size
did you wrap all your messages in translate(), though?
yep. fails otherwise.
so I would say for now just do the same thing for FrequencyIn on the pirkey that you see for I2C. We have to think about what to add and what to drop for the small builds. Scott saved 2kB or so with the compressed strings, but we're losing it with more verbose languages and additional functionality. Eventually we have to stop stuffing new stuff in the small builds.
you can also crank -finline-limit down, but we've already done that several times, and it's good for emergencies
that's in the Makefile
@marble hornet there is now a #define BOARD_HAS_CRYSTAL 1 in the mpconfigboard.h for the boards that DO have a crystal
night @marble hornet! ๐
My itsbitsy M4 was working correctly until I started experimenting with analogue in. Now on start up the green led fades up then down again followed by two leds, a bluish and what could be orange it's a bit hard to tell. The leds are not blinking.
The result is that I cannot download code to the board either with MU or from a text editor. Actually, code.py does contain the code but it's not running. There aren't any error messages from MU.
After hours of trying to get a simple blink the led to download and run I've given up. There are no syntax errors and this code did initially work until I started to experiment with analogue in.
Before posting this I tried to load code into MU again. Nothing even though the text editor shows code.py has the correct code.
So, where to now?
I just unplugged the board and plugged it back into the usb port and the blink is running. Perhaps it has someting to do with MU? MU is closed..
I started putting together a project with my Trinket M0 to use for switching boot volumes on macOS. My goal was to have it select a volume by keystrokes. However, it doesn't seem to be working.Working correctly in macOS once booted
Using the same code for HID keyboard:
- plug trinket m0 into usb on mac
- reboot system
`
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adaf...
@C47D Thanks for the PR! You will need to update to a more recent version of master to get the string compression needed for the builds to work. Ping me on Discord if you need help with it.
I'm happy to get this merged before all strings are translated. Thanks!
Never mind, I found the problem. Mu had entered REPL mode.
This PR does following things with nrf52
- remove
bootloader,dfu-boot(loader)target, along with bootloader hex/zip file in the boards folder. User should clone the https://github.com/adafruit/Adafruit_nRF52_Bootloader and flash there. It is possible to flash or upgrade (dfu-flash) to specific version without compiling the bootloader. Also update readme.md for #1069 adafruit-nrfutilis used instead of nrfutil, readme.md is also updated- only new feature is touch 1200, when the...
The HID keyboard currently presented by CircuitPython is not a boot device keyboard, with its own endpoint(s), which is what the Mac Open Firmware ("BIOS") and regular PC BIOSes expect. It's part of a composite HID device that includes mouse, multimedia keys, and a gamepad. This was to save endpoints for other purposes.
We've had one other person who wants a boot-compatible keyboard and we're thinking about that - we have to count up the available endpoints and what we want for the futu...
"run follow command" -> "Run the following command"
"The uf2 file is generated last by the all target"
pip3 install --user adafruit-nrfutil
e1ccc07 remove bootloader & dfu-bootloader target - hathach
b7dd33b add touch 1200 for dfu-flash - hathach
1c4accf Merge branch 'nrf52_remove_boot_target' into nr... - hathach
df4184e rename linker file to SD major version only - hathach
fc955b1 remove bootloader binaries, update readme for u... - hathach
this is a very easy way to make timers or delayed stuff without sleeping
import time
# create start time
ticker = time.monotonic()
# delay for
def timeA(delay, ticker):
if ticker + delay < time.monotonic():
return True
else:
return False
while True:
# every 30 seconds do
if timeA(30, ticker) is True:
print('timer triggered')
# reset timer
ticker = time.monotonic()
using it in my adalogger script so i can do other stuff while the write to SD card is delayed
Thanks. I completely understand and figured that this wasnโt currently supported but thought filing a bug was the best way to ask/suggest implementation of the feature. Is there any roadmap for future HID support? And MIDI sounds quite awesome too :)
increase SD to 6.1.0
@upbeat plover neat. you could even remove the check for True and just do:
if timeA(30, ticker):
also wondering if there's a way to get the function to also deal with updating ticker for you...hmm....
@stoic marsh you might be interested in that ^^
would be cool if it was in the modula
like stick that code in time
i think timeA should be renamed to alarm
i'm stepping through a CP C extension I've written. At the end of a function, i'm getting in the Jlink window ```Performing single step...
...Breakpoint reached @ address 0x00017134
Reading all registers
Performing single step...
...Breakpoint reached @ address 0x00017134
Reading all registers
Performing single step...
...Breakpoint reached @ address 0x00017134
Reading all registers
@dhalbert yeah Nordic support team help to troubleshoot it, here is the detail
https://devzone.nordicsemi.com/f/nordic-q-a/37473/advertising-does-not-start-with-s140-6-1-0-same-hex-run-without-issue-with-s140-6-0-0
Not that important, but all these download functions could be refactored into one that takes a few arguments.
@umbral dagger helooooooooooo im around today - finally taking a break for raspi py
pca10056 build is failing in travis nrf52* builds are OK.
@meager fog The Pi stuff is lookign cool!
yah i can look at the perky ears again
do you still have that gif of your friend wearing them?
yeah, I also feel that. I am not a fan of shell script as well. It is better to have some kind of dictionary for SD name and link :+1:
You could rewrite it as a Python script. :smiley:
@meager fog I do
@meager fog In place of the one of me?
Sorry, forgot to add new SD it to the download all (no parameters). Only test it when already download the SD. Travis is very handy :)
@meager fog Added. Rearrange as you see fit.
@meager fog Should one of them be used for the thumbnail?
Not yet
That will be a very awful python script. I am way too bad with python :(
That's on the list.
ok well lets get this goin' as is, and can always add later
one moment
@umbral dagger by chance do you have a high rez version of that friend gif
@upbeat plover did some noodling...
import time
class Timer():
def __init__(self, duration):
self.duration = duration
self.last_update = time.monotonic()
@property
def elapsed(self):
now = time.monotonic()
if now - self.last_update > self.duration:
self.last_update = now
return True
else:
return False
which can be used like this:
timer1 = Timer(0.5)
timer2 = Timer(2.8)
while True:
if timer1.elapsed:
print("timer 1")
if timer2.elapsed:
print("timer 2")
@meager fog bigger, higher-res version at top of overview page now.
@umbral dagger can you toss me the 720p video
oops sorry i was away for a few min, didnt see your note
nice
@meager fog sent
thanx
@umbral dagger guid'es live!
huzzah
thanks for being patient, i was neck deep in linux
and linux is a baaaaaad place to be
@meager fog No worries.
@meager fog Ah... no way. Linux is awesome ๐ .. although I hear that driver-land might not be so much so.
its awesome until you have to do something that it doesnt do
or SAYS it does and doesnt do ๐
second one is trickiest
Some Linux/Pi projects/guides wouldn't be objectionable to me, BTW
yah! we'll have the crickit hat soon
if you can wait a little longer, i think thats better than trying to hack it on with wires
then of course you get full ๐ง power
PS: feather52832 does not fail since I leave it as it is for arturo182 to decide later.
Is there any reason to hold back to 6.0.0 on feather 52832 and feather 52840? Is the base code the same (the fix you added?)
No, the only reason is probably the flash size. In Arduino repo, I will also drop support for SD v2 as well for the next nrf52840 release. It is the pain to have ble driver to support 2 flows of the APIs. Since @arturo182 ask to wait for him to come back. And he is the one writing the ble driver ( I haven't touched it so far). I guess let's wait for him to clean them up later.
Can we wait for him to return before I merge this PR, then, so we won't have two versions in the tree?
hi anyone know how to use sprintf with cp in nrf52 port. It complains that _sbrk is not defined, should I implement the nanolib hook or there is other way to use sprintf function ?
@gentle bronze you can use mp_printf(&mp_plat_print, "foo %d", ...)
oh, sprintf, hold on
ah, I sorry, I misunderstood your question, since you askabout nrf52832, nrf52832 does not have SD 6.0.0 support. only v2 and v5
https://github.com/adafruit/circuitpython/tree/master/ports/nrf/boards/feather52832#s132-v201-single-bank-recommended
For 6.0.0, only nrf52840 is supported, 6.1.0 is binary compatible with 6.0.0 the flash size is the same, there is no reason to hold 6.0.0. I will remove them in the next push if you like
@tulip sleet not really need a full spritnf, only need to convert mcu unique ID 64-bit int in to serial string for usb descriptor
char tmp_serial[17];
sprintf(tmp_serial, "%08lX%08lX", NRF_FICR->DEVICEID[1], NRF_FICR->DEVICEID[0]);
something like this
@gentle bronze hmm, but I have a file here that I made up with sd's sizes:
nRF52832 has 512kB flash
size of S132 SoftDevices (info from release notes):
s132_nrf52_6.1.0
Flash: 152 kB (0x26000 bytes)
s132_nrf52_5.1.0
Flash: 140 kB (0x23000 bytes)
we have some other code that already converts to hex for unique id's in atmel -- I will find it
SD flash size changed when the first major version change, I though you want to remove 6.0.0 since we got 6.1.0
the current nrf52832 is only got to work with v2 & v5. Possibly no v6, since the bootloader with v6 for 832 is not released yet, until now ๐
yes 6.1.0 replaces 6.0.0 - don't need to wait for arturo - we'd back up only if necessary
ok, I will remove it then.
i would assume the advantages outweigh the disadvantages
@gentle bronze for nibbles to hex, there is some code you can adapt in /ports/atmel-samd/supervisor/serial.c: load_serial_number(). That code reads from specific registers and writes UTF-16 but you can remove that part and just use the conversion code.
it was to write UTF-16 into usb descriptors
@tulip sleet only need to remove the download script for s140 6.0.0, currently s132 6.1.0 is not supported at all, I will remove it as well.
@tulip sleet thanks, exactly what I am about to do with nrf52 port ๐
@slender iron when you get a chance: https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A/pull/2
Sorry for confusion, just remove s140 6.0.0 and s132 6.1.0 ( not supported yet )
@tulip sleet the nibble works, I just wonder if there is anything prevent us to add nanolib sprintf func to the nrf52 port. It will probably take 2k of flash, but nrf52840 have plenty to spare.
@gentle bronze (I thought you were asleep ๐ ) if sprintf is looking for _sbrk it may be trying to allocate memory, and that may or may not with the rest of the storage mgmt. There are similar routines that do formatted printing or string-making to implement that kind of stuff in python, and you could alternately use those. I was starting to look at how but ended up on the serial number stuff.
in other words sprintf might be kind of redundant
Ah I think that is std libc, nano spec does not use sbrk I thibk
Didn't try to change the makefile for that
there is py/objstr.c, which has formatting in a static function mp_obj_str_format_helper(), called by several routines there
for doing '%' formatting in Python, which is basically printf-style
it does it into python objects, so have to see how to use it, but it shouldn't be too hard
Yeah, I am too nervous to use those. I still prefer good old sprintf. It will come handy later on. 2k is not a big deal. Even bootloader uses sprintf :D
Maybe we will add it later if needed, the nimble things work now :D
yeah, let's wait, and I'll see if there's an easy way to call the python stuff. there is already mp_printf(), and maybe that or a sister routine even supports printing to a buffer in some way I don't know
๐
Time to sleep now, I submit serial pr tomrrow then focus on Arduino entirely. Since people that buy feather 52840 would expect it to work the same way with arduino as 52832 + usb ๐ฌ
@tulip sleet good night (noon)
yes, good night!
I think this might have to change to one of the "es_XX" versions.
As a general note, fuzzy entries will likely need manual review: https://www.gnu.org/software/gettext/manual/html_node/Fuzzy-Entries.html
In other items "Running" has been translated as "Ejecutando", which sounds slightly better to me.
@tulip sleet - re: CP submodules. Your guide notes to: git submodule update --init --recursive ...just thought you might be interested...in my case, I wanted to start using the released version of CP 3 (i'm assuming this is branch 3.x). for me to checkout 3.x correctly, i was not able to cleanly get to a 3.x with the steps in your guide. Rather this worked: git clone --recursive -j8 https://github.com/adafruit/circuitpython.git (caveat - i have just a little idea what i am doing).
Hi there @carlosperate , ยฟcomo estas?.
No problem with the comments, actually i made the WIP available so others can work on it if they want (sort of what the french people did).
I will update my fork later tonight and work on your suggestions.
Carlos
Yep, actually this was added automatically by the PO file editor i'm using at home, will see how to fix it.
Same for me, i guess i did the literal translation, will fix.
@bronze geyser git checkout 3.x --recurse-submodules might also work for you. i still maintain the belief that git is a strange and magical place. ๐ฆ
https://git-scm.com/docs/git-checkout#git-checkout---no-recurse-submodules
im having CPX issue it is in bootloader mode but CPLAYBOOT isnt showing up on PC
how do you know it's in bootloader mode?
red D13 but all neopixels green
red d13 is blinking a bit
im gana go plug it in other pc see if it is just my windows or something
red d13 should pulse
yeah thats what i mean goes bright then darker
yeah but ive been having issue lately, like stuff shows up as 2 drives
i just tried it in other PC working fine
UGH!!!! i guess im gana format HD and do fresh windows 10
Oh, SWEET. Since the last time I checked, CPX now has an RFM9x radio library (It's been at least a year, I put down the project and only "found" the radios again today)
Hmmm. So, what's the process to compile things to a .pyc file?
@umbral dagger would you happen to know?
@velvet badger Using a non-Express board.
Python files include comments + other stuff so compiling to pyc saves space
Right. No idea how you would do that.
I'm pretty sure the Lora boards have a circuit python ROM, though... I think I have a couple...
M0 basic + LoRa (RFM95) feather
Maybe?
mpycross (or similar) is used to do them... precompiled bytecode.
I havenโt played with it much though
Having files precompiled means you donโt need to use ram to compile them at read-time
@cunning crypt the " 3.x Bundle" has the ,mpy for the rfmf9x in it. You use mpy-cross to create your own
It can work on an M0 basic with rfm9x wing, but you will be very tight on both Flash and RAM
@solar whale Awesome!
Honestly, the M0 basic won't be used for final version.
I... just want to play around.
@cunning crypt - I think the only libraries you need are the adafruit_bus_device folder and adafruit_rfm9x.mpy
are you using the feather M0 basic with the rfm9x on the same board or a featherwing.
great -that it is working!!
I'm planning on building a remote rover. Which will likely be an M4 + Featherwing, and the controller for it will probably be an M0 Express + Featherwing. Since all I really have to do is acquire the M4 for that, it makes it a lot easier.
Sounds like fun!
You reminded me that I want to try the rfm9x and rfm69 with an M4 -- on todo list.
The editor made it look like the same indent, but it was tab vs spaces
Hi, i keep the translation for spanish lang and got a question about how to get my fork updated without having conflicts with my edited .po file, should i just pull from Adafruit's repo?
@granite crow yep. do you have adafruit's repo added as a remote?
now that i think about it i think i don't, iirc my origin is set to my fork, isn't?
i only know basic git
if you cloned from your fork, then yes you'll need to add it. run git remote -v real quick just to make sure. it will give a list of the current remotes mapped.
just make sure you're not in one of the submodule directories (e.g. "asf4", "peripherals", etc)
thanks @raven canopy , and yes, my fork is set as origin (both fetch and push)
do you know how to add the remote? if so, then i will only say, that the standard is to only merge. no rebasing, so the history stays "complete".
i just googled it, just to be sure, should i do git remote add adafruit https://github.com/adafruit/circuitpython, so this remote named adafruit gets added to my remote list?
yep. that's the one.
then just run:
git pull adafruit master
git submodule update --init --recursive
a merge message may open after the pull. leave the merge message uncommented and close.
ok, so this command gets the adafruit master and merge it into my branch? does it overwrite my edited .po file?
it shouldn't overwrite your local edits ("fast forward merge" is the default). if you're worried, you can use git stash to keep a copy of your local edits, and apply them after the update.
this is my goto reference for git. the documentation style takes some getting used to, but it is very comprehensive. https://git-scm.com/doc
thanks for the link
just another question, i'm working on a branch, should i stay on that branch and pull the adafruits master, do you think it's the best way to keep my changes out of master?
good that you're working on a branch (i was going to mention that; i waited too long to act on that advice. haha). you're fine either way. i do it both ways at different times; the only difference i've come across is an extra merge from... commit.
i think i can merge and don't commit the merge 'step'
well, if you pull into your branch, it will most likely have a merge commit. if you pull upstream (adafruit) master down to your master, then no merge commit is created. i wouldn't stress the extra commit...
sounds fair
i got a merge conflict when trying to pull into my branch CONFLICT (content): Merge conflict in locale/es.po
what does git diff locale/es.po show?
almost all the new strings marked to be translated
most of it it's green, just about three rows in red, which i think are the lines causing the conflic
conflict*
do you want me to upload the diff to pastebin or something?
here is what i would do:
- copy your local file to a location outside of the repository just in case.
- abort the merge
git merge --abort. - stash your local edits with
git stash. - attempt the pull from master again
- if no conflicts, reapply your local with
git stash apply stash@{0}
that is probably the long way to do it. i'm no git master either... ๐
there are different things you can do with merge strategies, but i don't understand them enough to advise on them. and i've done an interactive rebase when they were allowed; not fun.
np, i had used git for personal projects only, or projects that didn't moved so fast as circuitpython hehe
heh. i was the same. learned quite a bit on this project, with help from folks around here.
and now you're helping me ๐
trying, at least. ๐
well, we got it almost working haah
While trying to get Travis builds to pass on added module functionality, I'm finding flash space issues with translated builds (non-judgemental! more beautiful languages require more space). In thinking of things to help reduce the hit some, I thought about going through each of the msgids and seeing if we can standardize any of the "close but not exact" iterations.
Having said that, I'm not sure that it will help that much overall, as I still am not quite sure how it's all getting comp...
@granite crow is it just the one file that you've changed? it just dawned on me that the easiest option may be to just update your master, create a new branch from that, and then copy the edited file in and commit it.
downside is you lose any commit history you've had so far...
yes, it's just the po file for the spanish strings, i did a couple of commits so far. I was reading about solving the merge conflict using vimdiff
i solve three merge conflicts, they were really silly. i saved the po file and now if i run git mergetool i get no files need merging
what does git status say?
all conflicts fixed but you are still merging
i jst checked the es.po file and the markers of the conflict still in there, i guess i will work on another branch with the newest master from adafruit
this will be the second time i say this today: git is a strange and mystical land... ๐ฆ
it certainly does
alright. i'm gonna play a little before bed. hope git starts playing nice for you @granite crow! ๐ฎ ๐ด
Thanks @raven canopy for the help, i will let you know when i got it working. Have a good night!
@granite crow did you finish the merge?
no i didn't, i aborted it, it seemed like solved but a lot of 'junk' got into the po file
I'd actually recommend a rebase
git rebase -i adafruit/master
it still may have conflicts though
@sommersoft Lets discuss on the feature thread. We've had many space limited builds already and can discuss strategies on a feature by feature basis.
yup! it'll replay the changes on the newer files
ok, i now do git status and got a bunch of unstaged files, which i guess are the newer files pulled from the adafruit master
and a file named es.po.orig, i'm almost sure i messed something up ๐
hm, its usually similar to a merge
hehe. and i steered him away from a rebase. ๐คท ๐
@tannewt
Definitely. I have a host of other "problems" size wise. I just wanted to share the thought on minimizing translation space.
@dhalbert 6.0.0 is removed, it should be safe to merge now
I think it is ok to close this now
Serial string = 64-bit DeviceID
$ lsusb -v -d 239a:
Bus 001 Device 050: ID 239a:802a
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x239a
idProduct 0x802a
bcdDevice 1.00
iManufacturer 1 Adafruit Indu...
Yup, we can combine msgids by changing the translate call as we find them.
I thought the descriptor string had to be UTF-16, so every other byte has to be zero. Am I wrong about that? The code in ports/atmel-samd/supervisor/serial.c does that:
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 8; j++) {
uint8_t nibble = (*(addresses[i]) >> j * 4) & 0xf;
// Strings are UTF-16-LE encoded.
serial_number[i * 16 + j * 2] = nibble_to_hex[nibble];
serial_number[i * 16 + j * 2 + 1] = 0;
}
...
the array is uint16_t already, the samd treats it as uint8_t
I realized that a minute ago when I stepped away from the computer :smile:
I believe this is fixed. @Thomasinator please let me know if it's still an issue for you.
just got my hallowing in the mail
any plans for it?
yeah make something for my mom to wear, she works for Head Start, made a graphic for it the other day while waiting for it....
will be boot logo
128x128
i got some other stuff in mail with it, feather TFT wing, and Feather nRF52
nice
the hallowing when plugged into USB the charge LED blinks fast
no battery connected
Hey guys, I've updated CP on Feather M4 Express to 3.0.1 and on-board NeoPixel stopped working. Is this a known issue?
@dusk hemlock there was a neopixel bug fixed recently
cheers @stuck elbow
@upbeat plover i think that blink is normal. it happens on some feathers also.
There's also a CHG LED, which will light up while the battery is charging. This LED might also flicker if the battery is not connected.
^^ that's from the feather 32u4 guide, but it's probably the same thing, good chance the charge circuit was reused
@dusk hemlock this quick test worked for me:
Adafruit CircuitPython 3.0.1 on 2018-08-21; Adafruit Feather M0 Express with samd21g18
>>> import board
>>> import neopixel
>>> pixels = neopixel.NeoPixel(board.NEOPIXEL, 1)
>>> pixels[0] = 0xFF00FF
>>>
how are you trying to control it?
oh wait M4....hold on....
@tidal kiln it's the NeoPixel that's on the board
In 3.0.0 it works as expected but as soon as I flash 3.0.1 it stops working. Blue/green/white to indicate the state the board is in.
i'm getting the same behavior
there was suppose to be a fix in 3.0.1 for this:
https://github.com/adafruit/circuitpython/issues/1083
@slender iron @tulip sleet is that ^^ new / know?
@tidal kiln its supposed to be a fix. its possible I broke it because its undervolted
I fixed 5v neopixels
@tidal kiln @slender iron it works fine on Metro M4 Express
weird
please file an issue. I'll take a look soon but don't want to interrupt what I'm working on now
@dusk hemlock know how to file an issue?
I do
excellent. thanks for finding this.
After upgrading to CP 3.0.1, built in NeoPixel does't work anymore. It doesn't indicate the CP state with green/white and driving it with code has no effect.
Code below works in 3.0.0, doesn't work in 3.0.1
import time
import board
import neopixel
led = neopixel.NeoPixel(board.NEOPIXEL, 1)
led.brightness = 0.3
while True:
led[0] = (255, 0, 0)
time.sleep(0.5)
led[0] = (0, 255, 0)
time.sleep(0.5)
led[0] = (0, 0, 255)
time.sleep(0.5)
no problem, happy to help
thanks @dusk hemlock !
I started to write an emulation for a tiny library for an i2c device I wrote but I need to learn more about Python testing to refine this: https://forums.adafruit.com/viewtopic.php?f=60&t=137711&p=682274
I have also reproduced this issue on a feather_m4_express and on a metro_m4_express :-(
@tidal kiln @slender iron the my metroM4 neopixel does not work with 3.0.1
@solar whale are you interested in tuning the waits?
I think I may have made it a bit too fast now
I should have time tomorrow if not later tonight -- be happy to try.
same for me on Metro M4 Express as well as Feather M4 Express
ok thanks!
I'll try to find a balance taht works for both 5V on the itsybitsy M4 and the on-board neoppixels for the feather/metro...
perfect!
This is likely a result of PR #1132 -- I will experiment with the timing to try to resolve it.
OK, merged and finally passed. tinyusb submodule commit was out of sync with master.
Perhaps at some point we will need to add a parameter telling the neopixel code whether they are powered with 3.3V or 5V.
Hi, i'm planning to get a circuitpython supported board, which one do you guys recommend? just for learning purposes, i don't have a lot of projects in mind.
i like to work with DMA, so i guess an M4 board would be cool to have
CPX would probably be the most recommended, since it has a host of sensors already on it. If you're looking for one of the M4 boards (more flash/ram/mhz), its really just a matter of size and if you want an on board 2x5 SWD port.
Also, the M0 boards have DMA available on them as well. i'm not sure if it has as many DMA peripherals supported as the M4 though.
Hi @raven canopy , how are you? i will take a look into the CPX board, now that i think about it i haven't done anything related to audio, is there any board with mic or I2S periphs onboard?
I'm good. hope you are as well. the CPX is the only board that comes with anything already applied; includes a PDM mic. All of the "Express" boards have I2S out available (with exception of the ItsyBitsy M4 Express).
correction: CPX has a MEMS mic...not PDM.
The Circuit Playground Express one looks good
85df329 rename nrf boards to feather_nrf52832 and feath... - dhalbert
c503cf9 forgot to change .travis.yml - dhalbert
eaf4d19 Merge remote-tracking branch 'adafruit/master' ... - dhalbert
05ea9fd remove stray underscore - dhalbert
4cc33f8 Merge remote-tracking branch 'adafruit/master' ... - dhalbert
This works with the "onboard" neopixels on a metro_m4_express and feather_m4 express. It also works with the RGBW 8 pixel strip using VUSB and D5(5v) on my itsy_bitsy_m4_express.
I also tested running a "jewel" and the strip at 3V on the metro_m4_express. both worked.
I measured the write frequency on the itsybitsy_m4_express and saw ~757kHz
submitted PR #1141 - this seems to work.
I am not able to read the error report from Travis? Is it working? Can anyone tell me what failed?
@granite crow @raven canopy CPX has a MEMS mic that outputs the raw PDM (as opposed to I2S). The lack of I2S circuitry on the mic made it cheaper (and maybe smaller).
@solar whale you should be able to see travis output by clicking on the Details link on the PR page. I tried that link with an incognito window and still saw travis, so I don't think it's a credential issue
@tulip sleet I can see it, just did not understand it ๐
trying again -- I did see taht if I try to buld the nrf pca10056 without specifying the SD=s140 Under 3.1 the build fails -- this worked before for 4.x
waiting to see if that is where travis fails
there was a pr late last night that Scott merged that included my changes and thach's that built ok -- do you have those latest changes?
I dids a pull this moring -- did you build 3.0.1?
that was a master pr, forgot you're doing in 3.x. I'l get 3.x and see.
so pca10056 doesn't build for you on 3.x?
it builds i f I specify SD=s140
pca10056 built for me on 3.x; maybe you need to git update submodules?
just make BOARD=pca10058 worked?
yes, my alias is set up to specify SD=s140
ah -- byt travis does not do that
almost there pca10056 is next on travis
it seems to be building -- maybey it just needed to retry
was there an exclamation mark or an X when it failed?
exclamation - if I recall correctly
that's an internal travis failure, not a build step failure. it probably failed to download something or something else went badly wrong with the VM
X means that it's our problem. ! is travis's problem
! happens often than i would expect
just restart them, travis is having a bad day
EXCLAMATE!
Ah -- did not realize I could jsut restart individual builds --- much better!
hmm, that could be a name for a soft drink
when Travis has a bad day, wea ll have a bad day !
it has gotten worse. it may be running on older infrastructure. travis is migrating all travis-ci.org accounts to travis-ci.com, which has newer features. However, it's not an automatic migration yet, so we're waiting. They haven't changed the rules -- it will still be free for open-source projects
metro-m4 and pirkey passed this time -- now just wating for TRAVIS_TEST=docs
yay! all passed -- whew!
i can merge it. should i ask the original issue writer to test it? You saw the same thing, right?
Yes -- it would be good for the OP to test -- and anyone else!
thanks!
after the merge build finishes i'll post a link to the s3 build in the issue. thank you
once we are satisfied with this, it should also get into master
@tulip sleet I am getting frequent FS corruptions lately -- not sure if it is a CP issue or something to do with Ubuntu 18,04 -- have you had any problems.
[501893.026232] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 138)
[501893.026235] FAT-fs (sdc1): Filesystem has been set read-only
[501893.026238] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 138)
[501893.027650] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 138)
[501893.073174] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 138)
no problems here
I see thsi on power up all too often -- maybe one of 4 times!
perhaps your flash started failing
it has happend on metro_m4, itsbitsy m4 and feather m4
storage.erase_filesystem() then reload works -- for awhile
@stuck elbow what OS and boards are you using
@solar whale ubuntu 18.04.1 and all the feathers, trinkets, itsybitsys, metros, as well as my own custom boards...
OK -- good to know -- sounds like it is a setup problem at my end -
or af faulty operator ๐
@solar whale i have not seen that. i always sync after cp-ing, and I always use an editor that writes completely
Gonna test CircuitPython_NeoPixel with my Pi this AM, hopefully no 
driving a bunch of 'em
@ash0x1b could you try this build, which includes #1141, and see if it works on your board? Thanks.
@tidal kiln ok i released the ST7735 library and seesaw, examples now live in the tft library
wanna test it?
@meager fog sure. i can test the minitft featherwing, don't have one of the new tftshields yet though.
yah thats the only one i did so far
while you're here - for PN532 - want me to cookiecutter the repo?
Looks like you missed some merge markers. Here you'll want to delete the empty "AnalogOut not supported on given pin" entry and the markers.
@meager fog miniTFTwing examples look good, left==left, right==right ๐
(tested both basic and graphicstest examples in 1.2.2 release of ST7735 lib)
good day all... is there a way to run travis tests locally? im unfamiliar with them
@dhalbert I can confirm, build from caa2328 fixes the problem on both Feather M4 Express and Metro M4 Express.
I have 2 Metros M4 Express and 2 Feathers M4 Express. Yes, I always buy my boards in pairs due to magic white smoke being so eager to escape.
While both Feathers had the same issue with 3.0.1, Metros didn't. One worked fine but the other one presented the same issue. Both Metro boards were purchased at the same time from Mouser so I assume they were from the same batch.
@tidal kiln back yah if you wanna cookiecutter PN532
i killed my hardware but got new hardware so i can continue on that
it needs a little more โค
yep. i'm going through a pile of datasheets and ANs, but will be ready to help here in a bit...
you wanna merge your personal repo back into the adafruit one? and i'll fork and pr that?
cool. i'll look for that.
i'm thinking this is going to change a fair amount. maybe have a base PN532 class that I2C/SPI/UART specific classes can derive from? also use @property more, instead of get/set funcs.
yeah
@covert oxide the travis tests are just shell scripts, which you can run locally. Look at the .travis.yml file in the repo you're looking at. Or you can set up travis for yourself for free, but that may be more trouble that it's worth.
@slender iron any thoughts on when we should do another release for the onboard NeoPixel fix?
whenever
not fatal but annoying
maybe look at the other open issues for 3.x?
Any plans to have circuitpython run on something with a reasonable amount of memory? I'm running out on a cpx just making a simple state machine with 6 states, haven't even put code in the states and it's choking
feather M4 has "192 KB RAM"
I have seen some duplicated or almost equal strings like "Invalid pin" / "Invalid pins", "unknown type"
About the french translation, I think we can find shorter strings for some of them but it will never be as short as english.
@plush roost Check out the "M4" metro, Feather, and ItsyBitsy. As @upbeat plover says, they have 192K ram (512K flash). The upcoming "Grand Central" Metro (Arduino Mega form factor) will have 256K ram (and 1M flash).
@plush roost Getting a significant amount of CircuitPython code on an M0 board is challenging. I generally stay away from classes and stick to fairly simple scripts.
@plush roost There's also https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
Thanks @tulip sleet , i will take a closer look into the CPX board.
Hi, fixed with 0aef043, please let me know if i missed something.
Hi, thanks i will check that link, had a busy week until today :).
another useful thing, in_waiting lets you check if there's something to read, nonblocking
https://pythonhosted.org/pyserial/pyserial_api.html#serial.Serial.in_waiting
@tidal kiln well i got pn532 working 3 ways
nothing is really propertyish
so i think we can use it as-is
3 ways = i2c/spi/uart?
yah
uart is slow because we only have blocking reads right now
but i2c and spi are fast
ill do the linting tomorrow
time to pass out
๐ค
coolio! ill take a looksie. laterzzzzzz
This reverts commit 869024dd6e62905b7e1069b547856a769b3b24ba.
Ctrl-C stopped producing KeyboardInterrupt with this change on CircuitPython.
The Unix and stm32 ports handles Ctrl-C differently with a handler which is
probably why they where not affected.
Fixes #1092
@prime flower want me to look at neopixel today?
@meager fog sure!
ok leme get the pn532 in shape
careful. they're bright. don't look too close.
lol
https://github.com/jgarff/rpi_ws281x does work, just not the RGB function, passing it hex is fine. rgb writes GRB
I wonder if the wrapper is the OLD one, the one linked is latest
i've been poking at it, the pypi install seems to install a forked version of the linked lib.
GitHub
Red and Green seem to be backwards. strandtest.py has this: colorWipe(strip, Color(255, 0, 0)) # Red wipe colorWipe(strip, Color(0, 255, 0)) # Blue wipe colorWipe(strip, Color(0, 0, 255)) # Green w...
๐คท I'm uninstalling this one and installing the jgarff one from source
kk
@umbral dagger Thanks for the tips!
@tidal kiln do you by chance know what this erro is?
Warning, treated as error: autodoc: failed to import module 'adafruit_pn532'; the following exception was raised: No module named 'digitalio'
@raven canopy maybe you know too
i think its something simple im missing?
@meager fog look in the docs/conf.py. autodoc_modules should have digitalio in the list.
i'm opening the repo now...could've done that before i typed. ๐
boom thanx
yeah..i meant autodoc_mock_imports...need more coffee. โ
edito uncommento!
yw!
ill test on pi now as well
i wish we could get Travis to flag that one the same way it does for ..todo:, but alas, this is the Travis config file. hmm...maybe we can Travis the Travis? ๐คฃ
whew ok ill keep adding to that list
@meager fog what does this go to on the breakout? RSTOUT_N?
https://github.com/adafruit/Adafruit_Circuitpython_PN532/blob/master/examples/pn532_simpletest.py#L7
no, the side RSTPD_N
kinda weird design, was a very earily breakout
you may not need reset
must not. didn't have it hooked up. working fine. ๐
yay
i2c comms hiccup every now and then though
yeah
File "<stdin>", line 1, in <module>
File "pn532_simpletest.py", line 32, in <module>
File "/lib/adafruit_pn532.py", line 353, in read_passive_target
File "/lib/adafruit_pn532.py", line 349, in read_passive_target
File "/lib/adafruit_pn532.py", line 310, in call_function
File "/lib/adafruit_pn532.py", line 495, in _read_data
File "/lib/adafruit_pn532.py", line 495, in _read_data
File "adafruit_bus_device/i2c_device.py", line 86, in readinto
OSError: [Errno 5] Input/output error
>>>
i need to work on the timeouts and delays
i had this hooked to a pi the other day and was running i2cdetect
it would sometimes return no address, sometimes default+1, sometimes expected default
yeah so there's a thing wher eyou have to 'wake up' the pn532
but the wakeup procedure isnt that clear
hrmmmm, RGB>GRB on the source repo too.... ๐คท
i'm using 2.2k pull ups, in case that matters...
@tidal kiln on what board?
@prime flower looks like it only handles RGB & RGBW, with no option to change the order: https://github.com/jgarff/rpi_ws281x/blob/master/ws2811.c#L1159
that is based on a quick look...
@raven canopy It does, but it doesn't behave like that on hardware
Probably. I've tried their Color() method which converts RGB to a 24-bit color value independently of my code and the setPixelColorRGB() method
@meager fog PN532 / wakeup - did you try attaching to P32 (H_REQ)?
yah, it's not well documented, piecing together stuff across ANs.....
@meager fog from page 8 of this: https://cdn-shop.adafruit.com/datasheets/PN532C106_Application+Note_v1.2.pdf
PN532C106 implements only handshake mode
then on page 16 of this, shows waking it up with I2C in handshake mode: https://www.nxp.com/docs/en/nxp/application-notes/AN133910.pdf
maybe?
Discovered while implementing a PyFilesystem interface for CircuitPython.
I needed an easy way to sync a folder on the host to the board over serial and this required timestamps to work.
Version 2
- Unix test failed. Limit the stat root test in tests/extmod/vfs_fat_ramdisk.py to not compare timestamps
Additions
pulseio.FrequencyIn- SAMD21 and SAMD51 are working. Accuracy is within ยฑ 1kHz for me so far. Testing throughout has been with the use of a
PWMOutprogram. - nRF and ESP8266 are currently stubbed out. Will start working nRF soon.
- SAMD21 and SAMD51 are working. Accuracy is within ยฑ 1kHz for me so far. Testing throughout has been with the use of a
Changes
- Moved
shared_timer_handler()out of samd-peripherals and back into CircuitPython.- New location is
.../atmel-samd/timer_handler.c. - Updated samd-peripherals submodule.
- Updated all ...
- New location is
Version 3
- Changed the expected outcome of the test instead of the test itself.
Happy weekend all! I made a custom trinket m0 board and have successfully built the latest firmware for it. I want to use some pins as software UART, following the tutorial on the circuitpython welcome guide:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial#trinket-m0-create-uart-before-i2c-13-17 (replacing the RX and TX with board.A5 , board.A6 respectively -- used the Where's my UART? section to figure out which pin to use)
I've defined the pins like so:
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA04) }, // PA04```
but I get a "ValueError: Pin A5 in use" - what does this mean?
@tidal kiln ok ive got much better raspi performance
its sorta bubble-gum and tape but this chip is like that
spi kinda works the best overall
Hi everyone! This is my first post on the Adafruit discord server and I'm really excited about it. I'm a big fan of this company and community and I'm having a lot of fun playing with a lot of great tech. I'm new to coding and I'm having a small problem with a neopixel project I am working on. I'm using the code from the LED trampoline tutorial. I've removed the vibration sensor bits and I'm trying to add a couple more modes. Problem is, when I change the if mode > 2 line, to if mode > 3 and then add my new mode if statement, I can switch to the new mode, but I can't switch out of it. Could someone take a look and see what I am missing?
https://github.com/ShepTech40/Neopixels/blob/master/Neopixel demo with modes.py
In summary, when it goes into mode 3 on line 170, it stays there. Another button press doesn't take it to mode 4, which should reset it to 0 and turn off the lights. It stays in rainbow mode.
yah when it calls rainbow cycle its going to 'sit' in that code for a while
because its doing that, it isnt listening to buttons!
you may want to listen for button presses inside rainbow cycle's loop
and 'return' if so
@prime flower ok i think you can pip3 install neopixel now
i tried it on a pi and it installed at least
@meager fog installs but errors
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/brentrubell/.pyenv/versions/3.5.2/lib/python3.5/site-packages/neopixel.py", line 34, in <module> from neopixel_write import neopixel_write ImportError: No module named 'neopixel_write'
where?
oh yeah
well thats normal
there isnt neopixel_write ๐
we have to add that to blinka ๐
ok, cool. issue can be closed then.
i gotta go eat, but can revisit it tonite
basically we make a new file, neopixel_write.py and make a single function in it
and stick it int....
ok!
https://github.com/adafruit/Adafruit_Blinka/tree/master/src/adafruit_blinka/microcontroller/raspi_23
put it there
if you want you can try
basically it will then call whatever underlying neopixel support library we want
I'll try that
actually sorry it would go here
@abstract panther to expand a little on what ladyada is saying, rainbow will block out any other code from executing until the for... loops are finished.
pixel_count = 17
def rainbow_cycle(wait):
for j in range(255):
for i in range(pixel_count):
so, the total number of iterations that will complete is 255 * 17 = 4335. which could take quite some time..
and check the platform, to include the correct file
since we'll be adding other platforms
@meager fog I see. Thank you. I will investigate. @raven canopy That makes sense. So, because it takes so long and doesn't listen for button presses, I have to wait. I'm am confused as to why the sparkle_code responds to a button press. It doesn't seem to have any code that listens for a button an returns.
@abstract panther def sparkle_code doesn't have a blocking loop in it. it runs once. the changes are handled in two places. line 149 in the main loop (while True:), and the sparkle_code function. this is why it will intercept button state changes.
you could break out the switch checking code into another function definition. then, you could use it in both your main loop, as well as inside rainbow to break out. Psuedocode:
def rainbow_cycle(wait):
for j in range(255):
if button_state() == True: # or "pressed"...depends on the return val
break
for i in range(pixel_count):
@raven canopy - Very cool! I appreciate the help. Thanks for the lesson!
@abstract panther you're very welcome! and welcome to the Discord!
๐
anyone lurking that is up to speed on nRF progress? wondering which SDK version we're working off of...
@raven canopy we are up to 6.1.0 s140 on nRF52840. See discussion in pr https://github.com/adafruit/circuitpython/pull/1138
we are not using the whole SDK, just the nrfx part
@tawny creek is PA05 assigned to something else as well?
k. so the SoftDevice is more than just the BT stuff?
no, the SD is S140. We are using the nrfx repo, which is a subset of the SDK. I'm not sure what version that's up to. I'm not sure what is in the SDK that's not in nrfx. nrfx is kind of like ASF3 in functionality
@tulip sleet nope, it isn't assigned to anything ..
ok...that's what i was assuming. i looked at nrfx for a minute, and yeah it doesn't mention much about which SDK version it "matches".
@tulip sleet using this chart to determine this