#circuitpython-dev
1 messages ยท Page 222 of 1
same error
just as sec
get the miniesptool_esp32argon.py from https://github.com/adafruit/Adafruit_CircuitPython_miniesptool/tree/master/examples
copy it to the baord and import miniesptool_esp32argon remove code.py
taht part of the guide is way out of date.
ESP32 mini prog
Resetting
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "miniesptool_esp32argon.py", line 28, in <module>
File "adafruit_miniesptool.py", line 448, in sync
RuntimeError: Couldn't sync to ESP```
looks like the same issue, code.py was removed.
power cycel the argon and retry
nope...
what version of CP is on the argon
no -- let me try it on mine
np
@prime flower copy this to your argon the import uart_comm
then do control-c and return to exut the script -- then retry the load...
Adafruit CircuitPython 4.0.0-alpha.5-53-g555da95cf on 2018-12-29; Particle Argon with nRF52840
>>> import uart_comm
b'ets Jun 8 2016 00:22:57\r\n'
b'\r\n'
b'rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\n'
b'configsip: 0, SPIWP:0xee\r\n'
b'clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\r\n'
b'mode:DIO, clock div:2\r\n'
b'load:0x3fff0018,len:4\r\n'
b'load:0x3fff001c,len:6248\r\n'
b'load:0x40078000,len:10168\r\n'
b'load:0x40080400,len:6468\r\n'
b'entry 0x40080758\r\n'
b'\xfe\r\n'
b'ready\r\n'
b''
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "uart_comm.py", line 55, in <module>
File "uart_comm.py", line 39, in <module>
KeyboardInterrupt:
>>>
wait for ready?
after doing that, the upload worked for me.
did you get any output?
no need for ready
>>> import uart_comm
b'\xc0ets Jun 8 2016 00:22:57\r\n'
b'\r\n'
b'rst:0N_ET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\n'
b'configs\r\n'
b'clk_drvx00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\r\n'
b'mode:DI018,len:4\r\n'
b'load:0x1c,len:756\r\n'
b'load:0x00,len:4892\r\n'
b'load:0x00,len:6476\r\n'
b'entry 0ec\r\n'
b''
ok -- control-c enter then try load
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/uart_comm.py", line 55, in <module>
File "/lib/uart_comm.py", line 39, in <module>
KeyboardInterrupt:
>>> import miniesptool_esp32argon
ESP32 mini prog
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "miniesptool_esp32argon.py", line 18, in <module>
ValueError: ESP_WIFI_EN in use```
sync issue again
hmm -- try this version of CP -- just a sec
or just try load agin one more time
you are using miniesptool_esp32argon.py
yes
if you load that version of CP you can reporduce my setup --
ok -- try the load -- if it fails -- try the uart_comm then retry the load.
well that worked on load
yay!
there were recent changes to UART support in CP . did you have to do the uart_comm step?
good -- its a bit finicky about how it is reset ....
tha lst load bit takes ahwile
you can use the uart_comm to test it after the load -- ```ress any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-53-g555da95cf on 2018-12-29; Particle Argon with nRF52840
import uart_comm
b'ets Jun 8 2016 00:22:57\r\n'
b'\r\n'
b'rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\n'
b'configsip: 0, SPIWP:0xee\r\n'
b'clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\r\n'
b'mode:DIO, clock div:2\r\n'
b'load:0x3fff0018,len:4\r\n'
b'load:0x3fff001c,len:6248\r\n'
b'load:0x40078000,len:10168\r\n'
b'load:0x40080400,len:6468\r\n'
b'entry 0x40080758\r\n'
b'\xfe\r\n'
b'ready\r\n'
b''
at+GMR
b'WIFI CONNECTED\r\n'
b'WIFI GOT IP\r\n'
b'at+GMR\r\n'
b'AT version:1.3.0.0-dev(6aafec8 - Dec 7 2018 02:23:19)\r\n'
b'SDK version:v3.3-dev-343-g7fa98593b\r\n'
b'compile time:Dec 24 2018 12:27:05\r\n'
b'\r\n'
b'OK\r\n'
b''
do control-d first
enter AT+GMR after the ready response
got an OK, matches yours
b'ready\r\n'
b''
AT+GMR
b'AT+GMR\r\n'
b'AT version:1.3.0.0-dev(6aafec8 - Dec 7 2018 02:23:19)\r\n'
b'SDK version:v3.3-dev-343-g7fa98593b\r\n'
b'compile time:Dec 24 2018 12:27:05\r\n'
b'\r\n'
b'OK\r\n'
b''```
๐ yay
cool -- have fun! -- just a minute -- I will post the argon version of some of the test programs -- they need a few changes from what is in the repo.
the esp at control examples?
yes
checkout the changes fom the ESPATcontrol version
try argon_webclient.py first
you ned to create settings.py.. Have you tried all thsi on an M4?
nope
github down for you on https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol ?
yes ๐ฆ
Welcome to GitHub's home for real-time and historical data on system performance.
looks like they're down
since it is in the bundle -- you ahould be good to go woth those scripts
if your bundle is new...
github is down \o/
yep
happy new year
here is the latest
got it
@stuck elbow Happy New Year to you!
@solar whale im gonna modify the io sketch for argon, I see the main diffs.
@prime flower you just need to cahnge these lines for argon ```RX = board.ESP_TX
TX = board.ESP_RX
resetpin = DigitalInOut(board.ESP_WIFI_EN)
esp_boot = DigitalInOut(board.ESP_BOOT_MODE)
esp_boot.direction = Direction.OUTPUT
esp_boot.value = True
uart = busio.UART(TX, RX, timeout=0.1)
rtspin = DigitalInOut(board.ESP_CTS)
the esp_boot part may not be necessary, but it won't hurt !
note the RX <-> ESP_TX swap
hm, getting a Failed to connect, retrying No OK response to AT+CWJAP
on both client and IO
enable debug=True -- if it is responding to AT commands then the problem is most likely in your settings
they are often lots of failure/retries
Connecting...
---> AT+CIPSTATUS
<--- b'STATUS:5\r\n\r\nOK\r\n'
Connected to None```
Hrm, doesnt seem to be connected, but the AT+CWJAP=[ssid/pass] does pull from settings
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-53-g555da95cf on 2018-12-29; Particle Argon with nRF52840
>>> import argon_webclient
ESP AT GET URL http://wifitest.adafruit.com/testwifi/index.html
Resetting ESP module
Checking connection...
---> AT
<--- b'AT\r\n\r\nOK\r\n'
---> ATE0
<--- b'ATE0\r\n\r\nOK\r\n'
Changing baudrate to: 9600
---> AT+UART_CUR=9600,8,1,0,0
---> AT
<--- b'\r\nOK\r\n'
---> AT+GMR
<--- b'AT version:1.3.0.0-dev(6aafec8 - Dec 7 2018 02:23:19)\r\nSDK version:v3.3-dev-343-g7fa98593b\r\ncompile time:Dec 24 2018 12:27:05\r\n\r\nOK\r\n'
---> AT+CIPMUX?
<--- b'+CIPMUX:0\r\n\r\nOK\r\n'
---> AT+CIPSSLSIZE=4096
<--- b'ERR CODE:'
---> AT+CIPSSLCCONF?
<--- b'+CIPSSLCCONF:0,0,0,0\r\n+CIPSSLCCONF:1,0,0,0\r\n+CIPSSLCCONF:2,0,0,0\r\n+CIPSSLCCONF:3,0,0,0\r\n+CIPSSLCCONF:4,0,0,0\r\n\r\nOK\r\n'
---> ATE0
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:0\r\n\r\nOK\r\n'
Connecting...
<--- b'\r\nOK\r\n'
---> AT+GMR
<--- b'AT version:1.3.0.0-dev(6aafec8 - Dec 7 2018 02:23:19)\r\nSDK version:v3.3-dev-343-g7fa98593b\r\ncompile time:Dec 24 2018 12:27:05\r\n\r\nOK\r\n'
---> AT+CIPMUX?
<--- b'+CIPMUX:0\r\n\r\nOK\r\n'
---> AT+CIPSSLSIZE=4096
<--- b'ERR CODE:'
---> AT+CIPSSLCCONF?
<--- b'+CIPSSLCCONF:0,0,0,0\r\n+CIPSSLCCONF:1,0,0,0\r\n+CIPSSLCCONF:2,0,0,0\r\n+CIPSSLCCONF:3,0,0,0\r\n+CIPSSLCCONF:4,0,0,0\r\n\r\nOK\r\n'
---> ATE0
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:2\r\n\r\nOK\r\n'
Retrieving URL...---> AT+CIPSTATUS
<--- b'STATUS:2\r\n\r\nOK\r\n'
---> AT+CIPSTART="TCP","wifitest.adafruit.com",80,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:3\r\n+CIPSTATUS:0,"TCP","104.236.193.178",80,54523,0\r\n\r\nOK\r\n'
---> AT+CIPSEND=97
<--- b'\r\nOK\r\n'
<--- b'\r\nRecv 97 bytes\r\n\r\nSEND OK\r\n'
Receiving: 318
[b'HTTP/1.1 200 OK', b'Server: nginx/1.10.3 (Ubuntu)', b'Date: Wed, 02 Jan 2019 17:45:47 GMT', b'Content-Type: text/html', b'Content-Length: 73', b'Last-Modified: Thu, 16 Feb 2017 17:42:29 GMT', b'Connection: keep-alive', b'ETag: "58a5e485-49"', b'Accept-Ranges: bytes', b'', b'This is a test of the CC3000 module!\nIf you can read this, its working :)']
---> AT+CIPCLOSE
<--- b'CLOSED\r\n\r\nOK\r\n'
OK
----------------------------------------
This is a test of the CC3000 module!
If you can read this, its working :)
----------------------------------------
those ar enot from the same run but you get teh idea
are you running the webclient code I posted
yeah
since tou see SSIDS and all -- its communicating
---> AT+CIPSTATUS
<--- b'ERR CODE:'
---> AT+CIPSTATUS
<--- b'STATUS:5\r\n\r\nOK\r\n'
Connected to None
---> AT+CWMODE?
<--- b'+CWMODE:1\r\n\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:5\r\n\r\nOK\r\n'
---> AT+CWJAP="Adafruit"```
seems its in esp.connect(settings) ๐คท
taht STATUS:5 does not look normal
yeah, it wont print APs either
do you ahve the antenna installed ?
...right. nope. (keep thinking its built into it)
need to dig it up (not in the box). Are you going to add particle_example to the examples, or just the particle pinouts?
I need to go AFK for awhile be back in an hour -- good luck!
I'll add wahtever is wanted... new example make sense
<@&356864093652516868> and others in this channel - we have nrf52840 feathers in stock
woohoo!
now's a good time to pick some up before we notify the many many poeple signed up ๐
runs to open laptop
ok
thats for cp ble? i like the swd thats nice to have
Man am I gonna have to make another order. Lol ๐
im waiting on feather wiced STM32F205, i like wireless but not ble
hmmm?
@meager fog does that mean the hw will be up on github today/soon?
oh it is! thank you ๐
@upbeat plover there's no eta on the WICED boards, i dont recommend waiting, we may never get more modules in
could cp run on the "16KB SRAM and 128KB flash available for user code" on the winced?
nope
i'm lookig at the product page and the .brd file and to me to looks like the brd has two more pins for nfc? is this true? ๐ค
its not NFC the way you think it is
and we dont have code/support for it
its not very useful
If I'm placing an order any other boards i should add? Been a while since I added any ๐
Other than the Trellis and whatever's been in Adabox 008 009 and 010
maybe a crickit feather?
Since I should do a bunch more testing of pixelbuf. ๐
could plug the nrf52840 into it
Oh that's a thought.
Most low cost soil sensors are resistive style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually start to oxidize ...
@prime flower any luck with antenna?
@solar whale yerp!
yay!
Added the particle pinout to post, adding it to webclient and simpletest as well next
OK great! feel free to update the gude as well!
@solar whale is that file we used earlier, for comms, on github?
no - just something I use for testing.
It's pretty dang useful..
I can add it or you are welcome to. needs a bit of cleanup -- some commented out code.
I'll look at the guide after lunch - adding a page to an IO Basics guide first
I really wish they integrated a pcb antenna into the Argon instead of this external one...I'm sure it was a/b tested though
velkominn aftur? @slender iron
๐
@slender iron I got my clock issue fixed while you were away ๐
HI! @slender iron I hope you had a great time with your spouse.
๐ nice
@prime flower I have some time now if you want me to try to update the gude - or would you pefer to do it?
I was planning to do it after lunch, or could take a look at your edit?
SOunds good -- I'll make a few quick obvious changes than you can have it - thanks
sure, ping me when ready
@prime flower ok -- I got some of the "low hanging fruit" Needs new screenshots. Let me know if you want me to create them or if you have them . Sorry it's taken so long to get this updated. Too many distractions. You'll note I went awy from using code.py -- I never do it that way but you iif that is preferred go ahead and change it back.
]
@solar whale which screenshots were you considering changing?
@prime flower the ones on the bottom of the page - they used to old file name
the actual upload to the argon esp32
I think I'm off
Anyone running Windows with their CircuitPython boards that can check something for me?
sorry ๐ฆ no Windows here
@solar whale Want me to include the steps to flash, just got a fresh argon from downstairs
Would you want the Flashing of the NRF bootloader, then the ESP load?
or just the load step
depends on the audience -- I think it good to show how to do it all since you can't use CP unless you first do the bootloader and doing a bootloader and Softdevice is not something everyone has done.
almost makes me feel as if a page just for the argon is req.'d...
We probably should provide the steps to "put it back" I have reloaded the ESP32 firmware but the particle bootloader or firmware. No promises ๐
I dont think I've tried re-flashing the particle fw
first you have to reload the ESP32 via miniesptool!
before you blow away CP!
although I think you can do it via the particle firmware as well.
@solar whale You're running Linux tho?
@idle owl yes
@prime flower there are really 4 cases: 1) external ESP8266, External ESP32 Huzzah Feather, External Espressif ESP32 with programming UART exposed, Internal ESP32 (Argon)
all require different load files
@solar whale Ok, I would like your help with something then if you have a bit here. Turns out you can rename CIRCUITPY and the rename sticks through disconnecting the board (it writes the name to the filesystem, so if you do a storage.erase_filesystem() it will revert). Thing is, we can't figure out a consistent way to rename it on linux. Dan found fatlabel but you have to figure out what the device path is first, which he tried df or something... I'm adding to the Essentials guide that you can rename the drive so people know they can do it, but I should include how, and I have no idea how that works on Linux.
I can try to help with that one
There were a lot of awful suggestions on the internet on renaming a mount point... we need something that isn't destructive and is consistent.
hmm does it work on nrfs?
@idle owl I usually just use gparted for such stuff
That seems like a bad idea though
but it's easy to break something with it
@exotic pumice did you have to reboot the board to see the new label?
it shows up immediatle n the File manager with thenew name , but not in with df df only shows it after rebot or maybey remount
yeas just hasd to remount to see it with df
that was on a Trinket -- now back to nrf
I did it on a cpx btw
@idle owl works the same on nrf !
looks good
it even survived my reload the CP .uf2 on the trinket
what would happen if a different device became sda1 (in my example) though
we should probably check that
make sure it's bound to the actual device not just the /dev/sda1 path
@idle owl if you still need Windows stuff (screenshots, perhaps?)...let me know.
@idle owl ```
jerryneedell@Ubuntu-Macmini:~/projects/ESP_ATcontrol/argon$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 4005852 0 4005852 0% /dev
tmpfs 807220 1780 805440 1% /run
/dev/sda2 952625076 77777296 826434188 9% /
tmpfs 4036100 121692 3914408 4% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 4036100 0 4036100 0% /sys/fs/cgroup
/dev/sda1 523248 6228 517020 2% /boot/efi
tmpfs 807220 24 807196 1% /run/user/123
tmpfs 807220 84 807136 1% /run/user/1000
/dev/sdb1 3845578572 116021908 3534189404 4% /media/jerryneedell/Backups
/dev/sdc1 4072 2758 1314 68% /media/jerryneedell/CIRCUITPY
0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Automatically removing dirty bit.
jerryneedell@Ubuntu-Macmini:~/projects/ESP_ATcontrol/argon$
jerryneedell@Ubuntu-Macmini:~/projects/ESP_ATcontrol/argon$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 4005852 0 4005852 0% /dev
tmpfs 807220 1772 805448 1% /run
/dev/sda2 952625076 77777320 826434164 9% /
tmpfs 4036100 121692 3914408 4% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
/dev/sda1 523248 6228 517020 2% /boot/efi
tmpfs 807220 24 807196 1% /run/user/123
tmpfs 807220 88 807132 1% /run/user/1000
tmpfs 4036100 0 4036100 0% /sys/fs/cgroup
tmpfs 807220 88 807132 1% /run/user/1000
/dev/sdb1 3845578572 116021908 3534189404 4% /media/jerryneedell/Backups
/dev/sdc1 4072 2758 1314 68% /media/jerryneedell/ARGONCP```
to see the new lable in df I had to unmount/remount it
ok
I just confirmed it's bound to the device not the devicepath
That's good
and it does require sudo privilege
at least it did on my system
same
see my screenshot for the error
adding the user to the disk group makes it not need sudo
which requires sudo I'm sure.
yeah
someone has to be responsible ๐
the disk group also basically gives permission to rewrite the whole disk so probably not the best
@raven canopy How do you rename CIRCUITPY in Windows? Right click and rename? Or is there a bunch of nonsense on Windows too?
i would imagine it's a right-click away...
let me spin up a 4.alpha board real quick
Thank you
@solar whale I'm gonna put it in https://learn.adafruit.com/circuitpython-on-the-nrf52/quick-start here per ladyada req.
the flashing part at least
@prime flower Good to have a pro doing the guide! And I'm really glad you are now an argon expert!
not yet, only been a day, im just excited
will address a lot of issues with io on arduino (looks at ESP8266 v2.5 beta..)
looks good, I just setup an argon dash lol
@idle owl there are 3 ways in file explorer alone to get to the drive's properties. right click, of course, and here is the other "easy" one...
actually, 2 and 3 are there. upper left corner is another quick link to properties.
yep. i've got 6 (or 7?) screen shots. want me to zip 'em and send here? or upload to learn assets?
I can't link to already uploaded learn assets, so zip them here is fine. Still not sure I'm going to include screenies yet.
kk
Bleh I probably should. And side2 them.
do you want me to highlight "clicks" in adafruit pink before i send them?
I mean... I won't say no to less work for me ๐
on windows 10 there's just a right-click-> rename, doesn't look like you have to go into properties
hah! oh yeah... there's also the F2 key. plenty of options.
oi ๐
you could just make the windows step read like this: "Change the name like you would any other file object in Windows."
done. ๐
"They're in the computer."
The files are in the computer..????
I saw a thing today like, "why would I put a window on my computer?"
can't find it now
oh, found it https://www.reddit.com/r/talesfromtechsupport/comments/ab95n2/why_would_i_put_a_window_in_my_computer/
2,154 votes and 226 comments so far on Reddit
alight. grabbed a "click rename" screenshot.
heya everone here should get nrf52840 feather now
we wll start notifying people and we will sell out ๐
@solar whale got the argon workin with Mu ๐
Hey pythonistas, I hope this isn't too spammy but humble bundle has a bundle going on with a bunch of DRM-free python books. Pay what you want and give it all to charity if you wish:
https://www.humblebundle.com/books/python-packt-2019-books?hmb_source=humble_home&hmb_medium=product_tile&hmb_campaign=mosaic_section_1_layout_index_1_layout_type_twos_tile_index_1
@raven canopy Do you get an error on Windows if you try to name it something longer than 11 characters? You do on Mac and Linux.
Apparently.
i think that is "standard" for volume labels. been a while since i went around naming drives. ๐ i'll check.
11 chars is the FAT max
I think it's a FAT limit
FATMAX
yep. file explorer won't even let me type more than 11 chars.
ok thanks
@raven canopy Did you send me a zip and I missed it or are you still fancying them
been DM spam research discracted...
right on
only one mention to Discord about it in the black hole of Twitter...
@regal juniper ask some of the people above this line of text about making a custom board folder
------separately---------
does the esp at support the esp pico d4?
esp 32 pico d4**
@solar whale I opened a PR for the Argon on Mu (since I dont have the Boron/Xenon VID/PIDs), if you wanna try it out https://github.com/mu-editor/mu/pull/730
this board is the first embedded risc-v processor but porting would allow for flexibility in the future:
https://www.sifive.com/boards/hifive1
filming neopixels is hard but suffice it to say I got a Rust rainbow cycle going
using nops, sadly
my partner in crime has taken over the spi version
Icosahedron has 20 sides which is what I use.
Sorry wrong chat. Meant to put it in live video chat.
sorry if this is a stupid question(I'm new to this) but if I had a question about circuitpython could I ask it here?
@ember pagoda yep! no stupid questions
@solar whale any idea about this? https://forums.adafruit.com/viewtopic.php?f=60&t=145554
Awesome! so I'm using a adafruit trinket M0 and with circuit python I would like to know how to use two adafruit vl53l0x devices at the same time. I'm confused specifically how to (I think this is what I'm supposed to do) change the I2c address on one of them. If this would not work with the trinket I have the same question with the adafruit feather M4 express.
@ember pagoda Most folks are watching the broadcast now. Sit tight for help.
awesome thanks for the headsup
Does the at command for the esp32 work on any esp 32?
Like a pico? Or just the wroom
@slender iron asked for some additional info.
@marble hornet the builds I have used are for the wroom but it can be built for other versions. Iโm not familiar with the pico.
thanks @solar whale
@solar whale can I send you a copy and board link? I wanna use it in my v2 tricorder
When code matures and I finish v1
Sure. Just post a link to the pico info and Iโll see if I can find out more about it.
It's a qfp chip not board
But here is the generic breakout
The top link is the more important one
This is the repo the firmware is built from. https://github.com/espressif/esp32-at
@marble hornet not sure. Iโll look at it a bit later and see if I can find it . Wroom was easy
Thanks. I'll take a look too
i already asked this question I just want to make sure it doesn't get forgotten: so I'm using an adafruit trinket M0 and with circuit python I would like to know how to use two adafruit vl53l0x devices at the same time. I'm confused specifically how to (I think this is what I'm supposed to do) change the I2c address on one of them. If this would not work with the trinket I have the same question with the adafruit feather M4 express.
@ember pagoda People are pretty good about reading scroll back, you don't need to post multiple times. In the event that you don't get an answer for a day and there's been a ton of conversation, you can post again, but don't worry about posting again so soon. ๐
I'm really sorry
No worries!
@marble hornet when it built the WROOM vesrion ita also built a PICO_D4 version do you want the .bin file?
@marble hornet or just clone the repo and build/customize it yourself.
@ember pagoda Ok, I looked into it. From the Learn guide: For future reference, the default I2C address is 0x29. You can change it, but only in software. That means you have to wire the SHUTDOWN pin and hold all but one sensor in reset while you reconfigure one sensor at a time
I was told that you should look at the Arduino library, it explains it, but it's apparently difficult to do.
The other option is to use a multiplexing chip of some sort.
but I was wondering if I could do it with circuitpython
Noted. When the board comes in I'll take a closer look. I'd like to do it right so other people don't have to. Thank you for showing me the repo! When I try to build it (for wroom) mind if I pick your brain on issues that arise?
@ember pagoda I'm not sure. It wasn't mentioned in the response to the question.
No problem -- and it builds for several boards automatically. I just chose the WROOM.bin
Oh
@marble hornet to get the builds for all boards - follow the instructions in the README for doing a "factory_bin" build at the end. It builds them all.
๐๐ I'll check back in tomorrow (at my dad's then, the workshop location)
@ember pagoda are you able to just power down each one? and just power up one at a time for reading
@ember pagoda I don't see anything in the CircuitPython library that looks like it might do that. I think if you want to use CircuitPython, your only option is to include a multiplexer. If it's possible in Arduino, I believe it's possible in CircuitPython, however it doesn't appear to be implemented.
@ember pagoda You'll need to manage the change of address yourself. If our driver doesn't let you pass in the correct address we can change it.
@idle owl thank you very much!
@idle owl from our converstaion on setup.py, just came across this while working on cookie updates:
Anyway, find_packages() walks the target directory, filtering by inclusion patterns, and finds Python packages (any directory). Packages are only recognized if they include an __init__.py file.
we haven't moved on the open issue about removing __init__.py, so this would still work "as is". however, do we want to re-hash the larger conversation?
@ember pagoda You can file an issue requesting the feature on the CircuitPython repo if you like. https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X
@raven canopy We decided to include it because it's inconsistent without it, but it's consistent with it.
lol. was i asleep? or is it just my aging memory cells... ๐
So even though it's unnecessary in some cases, we're going to include it in all cases for the few where it's necessary. At least for now until someone can put some deeper effort into figuring out why it's inconsistent.
I think it was a quick discussion between Scott, Dan and I. I am pretty sure I closed the issue for it though with that information.
yep. closed. didn't notice it. all good...just missed it getting closed. ๐
You had me questioning my own brain there for a minute ๐
Dan wants to understand it, but now isn't the time.
I'd love to know as well. But we'll get to it later.
@ember pagoda FYI, the I2C multiplexer that was mentioned is this:
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
@idle owl agree, though not sure i can help anyone understand it.
with this find_packages() knowledge though, since a non-package library doesn't have __init__.py, i'm not confident it will work. you can pass in inclusion patterns as well, but i don't know if that's enough. i'll keep reading, just stinks that the only verification is actually deploying and testing.
@raven canopy Yeah. I will create a test repo that we can use because I'm not waiting for a legit release cycle to test all of this.
for now, do you want me to just have it put the cookiecutter.library_name in there?
Yeah. And we'll add a todo to the file
k
# TODO: CHANGE py_modules= TO packages= IF LIBRARY FILES ARE A PACKAGE FOLDERRight above the py_modules line.
or something like that anyway
PyCharm highlights it yellow. Easy enough for me anyway.
uhh...where is the py_modules line? i may have grabbed an outdated version?
Second to last line
in setup.py
My line numbers are different because I added todos in mine ๐
i'll go hunting for a "better" version.
oh wait...
somehow i backspaced over it and renamed. ๐คฆ
๐
Hmmm. That's going to be hard whether there's a separate charge pin or not
-
touching the pin directly (without an insulating layer) introduces a bunch of electrical noise and also potentially some leakage currents ... I get very noisy results too when touching the non-insulated parts of the touchpad.
-
touching just an insulated wire is quite a small coupling area compared to a touchpad, and so while there's a capacitance signal there it's quite small.
We might be able to do some b...
In general though, capacitive touch detection works better and will always work better on the Feathers than on the DevKit, because the devkit has ~3" of track zigzagging its way between MCU and pin header and the Feather doesn't.
Looking forward to that Feather '840 arriving :-)
java.io.IOException: Cannot run program "{runtime.tools.bossac-1.7.0.path}/bossac": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:207)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:82)
at processing.app.SketchController.upload(SketchController.java:736)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2028)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 8 more
An error occurred while uploading the sketch
anyone know how to fix this error?
short update:
i have tested the output with a modern 100MHzu scope - and the voltage drops did not show up. so this is only my scope. not the chip! โ 30MHz was fine with 3.3V and nice Square-Wave form!
next thing: i will have to dig / read through the code and try to change the clock source thing & and the graceful resolution degrading..
@solar whale i missed one of your messages yesterday and totally didn;t see it. i'd love the d4 bin
i'm also getting this error:
make: xtensa-esp32-elf-gcc: Command not found
expr: syntax error
/Users/jonahym/Desktop/esp32-at/tools/mkfatfs/Makefile.projbuild:13: warning: overriding commands for target `clean'
/Users/jonahym/Desktop/esp32-at/esp-idf/components/app_update/Makefile.projbuild:38: warning: ignoring old commands for target `clean'
/bin/bash: xtensa-esp32-elf-gcc: command not found
/bin/bash: xtensa-esp32-elf-gcc: command not found
Toolchain path:
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
Traceback (most recent call last):
File "/Users/jonahym/Desktop/esp32-at/tools/esp32_at_combine.py", line 97, in <module>
main()
File "/Users/jonahym/Desktop/esp32-at/tools/esp32_at_combine.py", line 93, in main
esp32_at_combine_bin(args.flash_mode.upper(), args.flash_size.upper(), args.flash_speed.upper(), args.bin_directory, args.parameter_file)
File "/Users/jonahym/Desktop/esp32-at/tools/esp32_at_combine.py", line 40, in esp32_at_combine_bin
with open(os.path.join(build_dir, 'download.config')) as f:
IOError: [Errno 2] No such file or directory: '/Users/jonahym/Desktop/esp32-at/build/download.config'
make: *** [factory_bin] Error 1
when i try to build it
any idea where the file is / should be?
Does anyone with either a particle Xenon or Boron have the USB VID/PID of them? (Adding them into Mu for
)
@prime flower I have both, but it'll be after work that I can get em. But.. aren't they in CP's code? runs to look
may be, I dug thru some particle code for references to them and didn't find them
@prime flower we may want to check with particle about the usb ids
I pulled them from their enumeration as a cdc device
@slender iron Let's check, then. The Argon one is correct (for my setup, at least), notsure about the rest.
I'm saying we may want to change them
Change them to an Adafruit VID/PID?
@marble hornet when you cloned the esp32-at repo did you also do `git submodule update --init --recursive .. it should install the toolchain for you in esp-idf/ int the esp32-at folder. here is the PICO_D4.bin
@raven canopy not sure we have a good solution for it at this point
@marble hornet a few other things -- did you first build the firmware make then follow all the steps at the end of this to build the config file. make factory_bin to combine factory bin, by default, the factory bin is 4MB flash size, DIO flash mode and 40MHz flash speed. If you want use this command, you must fisrt run make print_flash_cmd | tail -n 1 > build/download.config to generate build/download.config.
try making my first own frozen lib for "Adafruit Mini Color TFT with Joystick FeatherWing" for feather_m4 i think it may be too big for feather_m0
@marble hornet one more thing - you'l probalby need to do a make menuconfig before the make you should not have to change anything just save the file (sdkconfig) unless you did the make defconfig -- that may do the same thing. Sorry - there are many ways to get the the same place...
Thanks for the update @s-light !
Looks like @notro is correct: http://elixir.tronnes.org/circuitpython/latest/source/py/objobject.c#L71
I'd love to see CPYTHON_COMPAT enabled for all builds. Until then we can add it to expectations though.
I think we should aim to be backwards compatible with neopixel and break any weird things with other RGB LED drivers. Most of those differences are a result of bad copy and paste so we should take the hit now to make them uniform.
We should update each individual driver and include the new PixelBuf dependency as needed.
Does that clarify things? Any other issues we need direction on?
In a recent version of master right now, a Trinket M0 build with MICROPY_CPYTHON_COMPAT off has 5668 bytes free. Turned on, there are 4684 bytes free. So I think we could turn this on everywhere.
@slender iron yeah, seems a tricky situation. my understanding is the IDs are tied to hardware, but I could definitely be off the mark on that. "product" could just as easily include both hard and soft...
I think we should sit on that space a bit longer until displayio is further along.
I believe the Arduino Zero in French is the largest build at the moment too. Trinket is smaller because it has fewer pins.
import sys
import time
# pylint: disable=wrong-import-position
try:
lib_index = sys.path.index("/lib") # pylint: disable=invalid-name
if lib_index < sys.path.index(".frozen"):
# Prefer frozen modules over those in /lib.
sys.path.insert(lib_index, ".frozen")
except ValueError:
# Don't change sys.path if it doesn't contain "lib" or ".frozen".
pass
import random
from TG_Modules.TG_RGB.rgb import colorst as color # use color to make
from TG_Modules.TG_RGB.st7735r import ST7735R
from adafruit_seesaw import seesaw as ss
from adafruit_seesaw import digitalio as dio
from adafruit_seesaw import pwmout as pwm
from micropython import const
import board
import bitmapfont
import busio
import digitalio
import gc
__version__ = "0.0.0-auto.0"
class joystick: # pylint: disable=too-many-public-methods
"""Represents a single mini tft featherwing. Do not use more than one at
a time."""
def __init__(self):
# Only create the joystick module member when we're aren't being imported by Sphinx
if ("__module__" in dir(digitalio.DigitalInOut) and
digitalio.DigitalInOut.__module__ == "sphinx.ext.autodoc"):
return
self._disp_sck = board.SCK
self._disp_mosi = board.MOSI
self._disp_miso = board.MISO
self._disp_cs = board.D9
self._disp_dc = board.D10
self._i2c = busio.I2C(board.SCL, board.SDA)
self._seesaw = ss.Seesaw(self._i2c, 94)
self._backlight_pin = pwm.PWMOut(self._seesaw, 5)
self._disp_rst = otherdio.DigitalIO(self._seesaw, 8)
self._disp_spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO
is this correct way to start a frozen?
@raven canopy I think the challenge is that some hosts cache usb descriptor based on ids and this will cause different descriptors for the same id
@upbeat plover the latest versions of circuitpython should already prefer frozen over lib
thank you so i can remove that bit?
yup, I think so
I think we need something like this. I wonder though if it could be merged with FrequencyIn which should do edge counting while also tracking a period to determine frequency as well. They both can use the EXTI to generate an event which a TC can count. (Better than using an interrupt because it won't starve the CPU at high frequencies.) What do you think?
@notro Cool work! I have a few questions:
- What is the code size impact of this?
- How different is
uselectfrom CPython'sselect? - What would the typical process for adding async support to a hardware module look like?
Thanks for this example code!
@slender iron good point. Didn't even think about that.
@CarlFK If you need direction for CircuitPython on Fomu let me know. I've been chatting with @mithro about it and have been hanging out in #timvideos on Freenode too.
The unix port has a lot of history to it that we want to avoid. In CircuitPython most of our work is hardware specific anyway so the UNIX port doesn't help much.
This can fit into the audioio pipeline as a sink. Then one can read the values from the object in CircuitPython.
@raven canopy adabot question, related to this feature:
https://github.com/adafruit/adabot/issues/18
is there a way to also determine the amount of time? like how far behind calendar-wise the release is?
woot got backlight on/off and button values all working in frozen
The HiFive1 doesn't have native USB so I'd rather not port to it.
However, the FPGA folks will have native USB and RISCV cores. It brings up an interesting point though where we really define a port by peripheral family instead of the cpu core itself. Porting to the RISCV cpu itself shouldn't be hard since its a gcc change. The peripheral support is the hard part.
Good catch - it is. I looked for an existing issue, but couldn't find it. I think I'd close #335 in favor of this, which is more clearly explained.
Closed in favor of #1434, which is a duplicate but written up more clearly.
im not sure how to call something from the frozen
wing._disp.rect(5,5,150,50, color(0,0,50))
says no color but i have it in the frozen as from TG_Modules.TG_RGB.rgb import colorst as color
if i do
from frozen import wing
from TG_Modules.TG_RGB.rgb import colorst as color
wing._disp.rect(5,5,150,50, color(0,0,50))```
works as expected
i guess for now ill just remove it from frozen
check your path?
>>> import sys
>>> sys.path
['', '/', '.frozen', '/lib']
>>>
@tidal kiln indeed. the first API call in that check is to get the tag name, which is date of the release; but the query also returns the published date. from there, its just a matter of mathing the difference. what did you have in mind for the difference?
@raven canopy just thinking of someway of escalating or emphasizing ones with greater amounts of lag
correction: bundle release tag names are the date. library releases are not, but the pub date is still available
we might be able to append the library name in that section with "stale days". e.g. ```
Adafruit_CircuitPython_FRAM (30)
Adafruit_CircuitPython_DHT (145)
if the delta is like a day or so, maybe up to week, then that's like "normal", but if delta is like several weeks or more then make it bold or blink or blinking bold red with scroll effect and sparkles
delta = time between latest commit and latest release
@tidal kiln ['', '/', '.frozen', '/lib'] was the return?
adabot needs some sparkles. i'm sold... ๐
i'm mainly just thinking out loud...and seeing if something like this is possible
all good. i'd say its a definite possibility, and some vectorable info would be nice to have. adabot has about 2500-2900 API requests left as available when all 3 scripts are run (libraries, dl stats, arduino). guess the hard part is where do we draw the line on grabbing/using that info...
@upbeat plover that's the search order then. not sure what you have, but if it's in '/', then it will get used instead of the frozen version, for example
@raven canopy thanks. i think this a good in-the-weeds thing. i'll ask it next meeting.
๐ go ahead an put an issue in too, if you want. make it open-ended, but use the release issue as an example...
also thinking out loud: if we start to run into API rate limiting, we can bolster adabot and have her handle it accordingly by waiting until the next limit reset. time.sleep(3600)
oh..will have to include Travis stall handling as well. great...now i already feel like doing it. ๐
from adafruit_mini_tft_featherwing.joywing import wing
can you take a look when you have time @tidal kiln
oh i should have made comment but my CS and DS were moved
We're way behind because of the badge URL update. So everything is unreleased.
"This release was brought to you by: Adabot!" ๐คฃ
And the number Travis.
And the letter 9.
@upbeat plover sry if you've posted about this, but i don't know background here - what is TG_Modules?
https://github.com/TG-Techie/TG-Modules
@marble hornet i use his because he has rotations for st7735r he has no PR but i could use them
they dont go in the lib folder is that the cause of issue? cp isnt looking in correct spot?
I'm writing up a guide page that I think makes the most sense in the Welcome guide vs the Essentials guide. I will close this once completed.
so you have a folder named TG_Modules?
yeah
what's in that folder?
hold on ill give you exact path
\tg_modules\TG_RGB\rgb
do i change line 51 to that?
that's all in your CIRCUITPY folder?
oh, that zip and the repo are different
yeah it can rotate
but basically you have the contents of the zip copied to CIRCUITPY?
yes its all in feather_m4 CIRCUITPY
where did you find those?
here like months ago
oh, that one
may still find in chat
ok. starting to see how you're setup.
says 0ct 20? is that right?
and where did you put joywing.py?
in /lib/adafruit_mini_tft_featherwing
this is still alpha version i started it today still havent copy pasted over my offset fixes
basically needs this as it is now
def yfix(ya):
ya = ya + 24
return ya
then when you do a command you would (x, yfix(y)) for stuff and it would come out right
@marble hornet doesnt that version have a built in offset, idk how to use it
wing._disp.rect(5,5,150,50, color(0,0,50)) says no color
what the actual text of the error you got here?
`Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'color' is not defined
wing._disp.rect(5,5,150,50, color(0,0,50))`
it's complaining about not knowing what the function color() is
let me look at me adafruit stuff there is similar there
look at the code, i try to name variables well it'll be in all of them
are you trying to call this?
from TG_Modules.TG_RGB.rgb import colorst as color
think it would be same as from adafruit_rgb_display import color565 as color
then cater's code should work
you do that in joywing.py, but you would also need to do something similar in your main code
try this real quick just to see if it returns without error:
wing._disp.rect(5,5,150,50, 0)
works
and when i do python wing._disp.rect(5,5,150,50, 255) it makes red rectangle
so, yah, it's just that in your calling code, it doesn't know about color()
@upbeat plover what ya making?
helper lib for tft
ah
my code is starting to look huge in main.py and i want to clean it up, still have 100kram of free space, im like what can i add next lol
thank you!!!!
really hate seting up seesaw (like i can;t figure it out
)
so thank you
seesaw was fun
where is the documentioan or guide for that ?
this was my first test way back https://cdn.discordapp.com/attachments/327298996332658690/503153179223916545/m4_joytft_etch.py
think that is where you start
i did trial and error till i got buttons right
i have basic cp thing for https://learn.adafruit.com/adafruit-mini-tft-featherwing
if you guys want to post up the code?
from adafruit_rgb_display import st7735
from adafruit_seesaw import seesaw as ss
from adafruit_seesaw import digitalio as dio
from adafruit_seesaw import pwmout as pwm
from micropython import const
import time
import busio
import board
import digitalio
i2c = busio.I2C(board.SCL, board.SDA)
seesaw = ss.Seesaw(i2c, 94)
rst = dio.DigitalIO(seesaw, 8)
cs = digitalio.DigitalInOut(board.D5)
dc = digitalio.DigitalInOut(board.D6)
backlight = pwm.PWMOut(seesaw, 5)
backlight.duty_cycle = 0xffff
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
display = st7735.ST7735(spi, cs, dc, rst, 80, 160)
# pylint: disable=bad-whitespace
BUTTON_RIGHT = const(7)
BUTTON_DOWN = const(4)
BUTTON_UP = const(2)
BUTTON_LEFT = const(3)
BUTTON_B = const(9)
BUTTON_A = const(10)
BUTTON_SEL = const(11)
# pylint: enable=bad-whitespace
button_mask = const((1 << BUTTON_RIGHT) |
(1 << BUTTON_DOWN) |
(1 << BUTTON_UP) |
(1 << BUTTON_LEFT) |
(1 << BUTTON_B) |
(1 << BUTTON_A) |
(1 << BUTTON_SEL))
seesaw.pin_mode_bulk(button_mask, seesaw.INPUT_PULLUP)
display.reset()
while True:
buttons = seesaw.digital_read_bulk(button_mask)
if not buttons & (1 << BUTTON_RIGHT):
print("Button Right-D pressed")
if not buttons & (1 << BUTTON_DOWN):
print("Button Down-D pressed")
if not buttons & (1 << BUTTON_LEFT):
print("Button Left-D pressed")
if not buttons & (1 << BUTTON_UP):
print("Button Up-D pressed")
if not buttons & (1 << BUTTON_B):
print("Button B pressed")
if not buttons & (1 << BUTTON_A):
print("Button A pressed")
if not buttons & (1 << BUTTON_SEL):
print("Button SEL pressed")
time.sleep(0.01)
that would be cut down pretty good but i think the etch would be a good demo
#WhenYouFigureOutThatYouForgotPullUpResistorsTheDayAfterOrderingThePCB
i have the etch demo for adruino too... just say
anyone want try reproducing this on a hallowing? https://github.com/adafruit/circuitpython/issues/1436
CircuitPython.zip Message: You are running in safe mode which means something unanticipated happened. Looks like our core CircuitPython code crashed hard. Whoops! Please file an issue at https://gi...
anyone want to test IR reception on the nrf52840? https://github.com/adafruit/circuitpython/pull/1408
The Argon was SPI because QSPI wasn't working on mine even though it should have. I bet this PR fixes the issue I was hitting.
I also removed the can from one Argon and one Xenon to verify the chip they shipped with.
@slender iron i'll look at the hallowing/ble one
thank you!
What is the code size impact of this?
SAMD51:
- async/await: 1272 bytes
- uselect: 1504 bytes
- uio.IOBase: 240 bytes
How different is uselect from CPython's select?
The main difference is that CPython polls on file descriptors:
poll.register(fd[, eventmask])
while MicroPython polls on objects:
poll.register(obj[, eventmask])
This object needs to support the stream protocol with i...
<@&356864093652516868> Has anyone written a #circuitpython-dev2019 post yet? https://blog.adafruit.com/2018/12/17/what-do-you-want-from-circuitpython-in-2019-circuitpython2019-circuitpython/
I'm working on mine now
hmmm....
@ruby atlas congrats?
from adafruit_mini_tft_featherwing.rgb import colorst as color
from adafruit_mini_tft_featherwing.joywing import wing
# wing._disp.
"""
pixel(x, y, color=None)
rect(x, y, width, height, color)
fill(color=0)
hline(x, y, width, color)
vline(x, y, height, color)
text_dimension(x, y, text, size = 1)
text(x, y, text, color(255,255,255), background = color(0,0,0), size = 1, rect_extension = 0, italics = 0)
scroll(x, y, str, color(255,255,255), background = None, size = 1)
round_rect(x, y, width, height, r, color)
"""
wing.backlight_on
wing._disp.pixel(0,0, 255)
wing._disp.rect(5, 5, 150, 50, color(75, 200, 50))
wing._disp.scroll(20, 20, "hello", color(255,255,255), background = None, size = 1)
wing._disp.text(10,10,"This test shows \n if it is working",color(255,255,255), background = color(0,0,0), size = 1, rect_extension = 0, italics = 0)```
for featherM4 and tft joywing @marble hornet want to test it?
everything is now in lib/adafruit_mini_tft_featherwing
requires adafruit_seesaw lib too
i runout of memory on M0 maybe someone can take a look?
@slender iron finished mine! http://dopieralski.pl/posts/2019-01-04-circuitpython/
I have notionally recreated this behavior.
I ran the code from the zip file above on a Hallowing, saved as different name and run as import:
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5 on 2018-12-10; HalloWing M0 Express with samd21g18
>>> import test_code
I did not have the BLE UART connected (not sure of complete wiring used). I did attach a strand of NeoPixes (PID 3919. The NeoPi...
@upbeat plover are you using compiled .mpy versions or .py ones?
4.0.0-alpha.5
@stuck elbow Great! Thanks! Reading it now.
@ruby atlas Thanks!
@stuck elbow speech recognition is definitely a stretch. It would get people very excited!
hello, i am having a problem.
This is the error I get when trying to make a keyboard press a bunch of keys at once:
Traceback (most recent call last):
File "main.py", line 64, in <module>
File "adafruit_hid/keyboard.py", line 100, in press
File "adafruit_hid/keyboard.py", line 152, in _add_keycode_to_report
ValueError: Trying to press more than six keys at once.
the thing is, im specifically splitting the array of keys to press in to smaller arrays of 6 keys each and asking to press them:
import digitalio
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard import Keyboard
from keysetup import kbd_pins
kbd = Keyboard()
kbd_keys = []
toggles = []
queuepress = []
queuerelease = []
prev = []
macros = ["macro1.py"]
which_macro = 0
macro = macros[which_macro]
def splitarray(arr, size):
arrs = []
while len(arr) > size:
pice = arr[:size]
arrs.append(pice)
arr = arr[size:]
arrs.append(arr)
return arrs
for pin in kbd_pins:
pin.direction = digitalio.Direction.INPUT
pin.pull = digitalio.Pull.UP
toggles.append(False)
file = open(macro, "r")
for line in file:
kbd_keys.append(eval(line))
print("Waiting for Keypresses")
while True:
for key in kbd_pins:
key_index = kbd_pins.index(key)
if not key.value: # pressed?
if not toggles[key_index]:
toggles[key_index] = True
key_press = kbd_keys[key_index]
for press in key_press:
queuepress.append(press)
else:
if toggles[key_index]:
toggles[key_index] = False
key_release = kbd_keys[key_index]
for release in key_release:
queuerelease.append(release)
queuepress = splitarray(queuepress, 6)
queuerelease = splitarray(queuerelease, 6)
for press in queuepress:
kbd.press(*press)
for release in queuerelease:
kbd.release(*release)
queuepress = []
queuerelease = []
any help would be appreciated
I don't think you can do that because we maintain the state of pressed keys internally
the usb report itself is always a list of pressed keys if I remember right
hmmmmmm damn
so there's no way to get n-key rollover with the current code?
not without changing the underlying C code
oof
that, i cannot do ๐
I'm not sure how the usb protocol changes for n-key rollover
you could figure it out ๐
i dont know C, and i certainly dont know how to make my own circuitpython sourcecode ๐
I'll just stick with 6-key rollover at the moment i guess....
i'll only be making stuff for gaming and i only have 5 fingers on a hand, so i guess it isnt much of a problem ๐
please file an issue about it, it may not be hard to support
pretend to be more than one keyboard ๐
ooooooh ok, a quick skim-read of the QMK firmware which showed up when i did a google: https://github.com/qmk/qmk_firmware/blob/995c3141a674a0311786cc713ea96d39330a9b48/docs/usb_nkro.txt
it is indeed a limit of the USB protocol??
so i might need to add some more keyboards and send more events over them... is it possible to have multiple 'keyboard' devices in circuitpython?
cause i know i have to define a keyboard like so:
kbd = Keyboard()
can i just... do this? lol:
kbd_1 = keyboard(1)
kbd_2 = keyboard(2)
etc..
? lol
it may not be that hard actually
@slender iron I'll take a shot at some 2019 ideas later tonight. Much of what I need/want has already been expressed, so I need time to dream a little more.
thanks @errant grail!
you could try adding a second keyboard to that list
the code above it may not work for it though
an issue is the best place to discuss it
Been thinking about further abstraction for coprocessing, like AT support for RFMxx...
๐ @stuck elbow mentioned it too
oof, ok ๐ I'll file an issue ๐
Thanks @caternuson! I plan on poking at displayio next week and will try to look then.
thanks @scarlet fjord
current support only allows for one keyboard device with 6 pressed keys. The gamer in me can and will press more than that on occasion. More keys = more better ๐
@slender iron tried irremote_simpletest on a particle_xenon with pr_1408 -- not sure what to expect ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-27-g675226667 on 2019-01-03; Particle Xenon with nRF52840
import irremote_simpletest
Heard 1 Pulses: [791]
Failed to decode: ('10 pulses minimum',)
Heard 1 Pulses: [792]
Failed to decode: ('10 pulses minimum',)
Heard 67 Pulses: [8927, 3517, 1375, 486, 1379, 1485, 380, 1485, 379, 1486, 379, 1486, 1380, 484, 1407, 458, 1409, 456, 1410, 2346, 434, 2317, 435, 2317, 1434, 317, 1435, 2317, 435, 2317, 435, 1426, 1436, 317, 1435, 425, 1439, 426, 438, 1427, 438, 1426, 438, 2316, 1435, 427, 1437, 427, 1437, 427, 1438, 2316, 435, 2317, 1406, 344, 1407, 345, 1407, 1454, 438, 2316, 405, 2346, 1405, 345, 1404]
Failed to decode: ('Both even/odd pulses differ',)
Heard 3 Pulses: [8910, 1792, 1375]
Failed to decode: ('10 pulses minimum',)
Heard 3 Pulses: [8904, 1788, 1377]
Failed to decode: ('10 pulses minimum',)
Heard 1 Pulses: [815]
Failed to decode: ('10 pulses minimum',)
FYI - I tried running the irremote_simpletest.py with this PR on a particle_xenon. I was not sure what to expect. Seems to respond to an keypress from the IR Remote, but does not decode properly -- receives lots of noise triggers.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-27-g675226667 on 2019-01-03; Particle Xenon with nRF52840
>>> import irremote_simpletest
Heard 1 Pulses: [772]
Failed to decode: ('10 pulses minimum',)
-----...
Do you have an example of a keyboard that transmits more than 6 pressed keys at once? All the USB HID keyboard descriptors I have seen do 6 keys max. I just checked a Logitech Gaming Keyboard, and it's also 6.
FYI - same code as above (D11 instead of D2) on a featherm4 express - this does decode the keypreses - also lots of noise. May be the environment
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.3-43-g80db2cec9 on 2018-12-03; Adafruit Feather M4 Express with samd51j19
>>> import irremote_simpletest
Heard 1 Pulses: [252]
Failed to decode: ('10 pulses minimum',)
----------------------------
Heard 67 Pulses: [9027, 4511, 587, 558, 551, 582,...
@meager fog is the NFC on the nrf for auto pairing to a phone kinda NFC?
@jerryneedell can you tell me how you test this out, I will add the required hardware the next time I order some hardware.
@hathach I just connected an IR receiver (one Iv'e used before but it cam rom some other system) -- I'll retry with a standard part and give you the part number in a minute
Most of the info I have comes from open-source wikis, where they use many keyboard devices each sending 6 keys each - https://deskthority.net/wiki/Rollover,_blocking_and_ghosting#Interface-limited_NKRO
https://github.com/qmk/qmk_firmware/blob/995c3141a674a0311786cc713ea96d39330a9b48/docs/usb_nkro.txt
My Corsair K95 RGB for instance creates many virtual devices for N-Key rollover. Here I have two screenshots, one with the K95 RGB unplugged, and one with it plugged in, and you can see more t...
ok used one of these https://www.adafruit.com/product/157
much less noise -- still does not decode
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-27-g675226667 on 2019-01-03; Particle Xenon with nRF52840
>>>
>>> import irremote_simpletest
Heard 67 Pulses: [8962, 3484, 1410, 455, 1403, 1462, 407, 1458, 411, 1454, 405, 1460, 1408, 457, 1412, 453, 1405, 460, 1409, 2344, 403, 2349, 409, 2343, 1404, 349, 1409, 2343, 404, 2348, 409, 1455,...
Thank for the part number, I haven't worked with IR before. Will order one next time I do to adjust/correct the PR later on.
I have not done a a lot -- just a bit with the CPX and this simple test. I connected it to 3V, GND and a digital pin (D2) -- the part says it can run on 3-5V and as noted, it does decode on the M4.
Good luck!
@hathach FYI - the code for the test came from the examples in the Adafruit_CircuitPython_IRRemote library https://github.com/adafruit/Adafruit_CircuitPython_IRRemote/blob/master/examples/irremote_simpletest.py
@jerryneedell thanks a lot, it may take a while before I could get my hand on the sensor and test this out :)
hmm. should we throw a DHT at nrf pulsein? ๐ฌ
@hathach no problem and no rush -- I just wanted to make sure you had all the information available since I'll have forgotten about what I did to test it by the time you get the parts ;-)
@raven canopy ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-27-g675226667 on 2019-01-03; Particle Xenon with nRF52840
import dht22_test
RunTime Error Checksum did not validate. Try again.
-3276.7 6553.5
-3276.7 6553.5
RunTime Error Checksum did not validate. Try again.
-3276.7 6553.5
-3276.7 6553.5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "dht22_test.py", line 11, in <module>
File "dht22_test.py", line 9, in <module>
KeyboardInterrupt:
@solar whale 2-to-1...seems normal. ๐
@hathach @sommesoft made me do it! just for fun I tried a DHT22 temperature sensor with this PR.
Adafruit CircuitPython 4.0.0-alpha.5-27-g675226667 on 2019-01-03; Particle Xenon with nRF52840
>>> import dht22_test
RunTime Error Checksum did not validate. Try again.
-3276.7 6553.5
-3276.7 6553.5
RunTime Error Checksum did not validate. Try again.
-3276.7 6553.5
-3276.7 6553.5
Traceback (most recent call last):
File "<s...
@jerryneedell I think I could find DHT22 in local here, is this the right one ?
https://hshop.vn/products/cam-bien-do-am-nhiet-do-dht22
@hathach that looks like the same part.
Add support for serial interface of this backpack:
https://www.adafruit.com/product/781
thanks for the help @solar whale
@slender iron I sent a link to my CircuitPython 2019 post to the circuitpython2019@adafruit.com email address. Hope it's useful for the planning process.
Great! I look forward to reading it tomorrow @errant grail thanks!
You're welcome!
@plucky flint here! here! great post. ^^^^
does particle argon kit do wifi and TLS 1.2?
Thanks for the info @notro. Do you think uselect and ioctl is the best way to go about it? The event mask bits seem a bit weird to me but I'm not sure what would be better.
@upbeat plover The ESP32 can support TLS v1.2 -- are you asking with regards to using it with CircuitPython and the AT Firmware or "as-delivered" by Particle with Particle mesh?
I think the simple answer is - yes. The devil is in the details..
I understand, you guys are still in dev for cp for those boards?
yes -- lots of rapid development in progress.
@hathach yep thats the part, you can print out the pulse pairs, that will help debug as well!
bells?
a train station?
a whistle?
I'm in Switzerland, I always hear bells
there it is again
๐
ain't hear nothing
No
Doppler effect.
๐ฎ
Mind the gap!
Must be the arrival of...
train reference!
Gc
public transportation coming back to US?
๐
@stuck elbow In very specific locales only.
F5 F5 F5 F5 F5
๐ ๐พ
Well, it has a price now...
i see it coming round the bend
haha
48 in stock!
inb4 we break the website F5ing
its here! https://www.adafruit.com/product/4064
GET ON THE TRAIN EVERYBODY
I think I can... and I did!
๐
And done.
๐
In other news my debouncer library is nearing readiness. How many input pins did you say there is on the GrandCentral?? Debounce All The Pins!!!;).
๐
I'm on board!
Choo choo! Don't have the spare cash (nor the time, nor any projects, honestly), but awesome anyway
Envy. I'm just chilling on the notification list....
@drowsy geyser if you go to the shop it will let you purchase.
What? I just looked last night. <scampering off to the shop>
I think polling with uselect looks promising. It's the mechanism MicroPython has chosen for polling on I/O operations (in line with CPython) and is thus fairly future proof.
Even wiznet supports polling with uselect: socket_ioctl() -> wiznet5k_socket_ioctl().
I suspect that UART would work to if it changed to [MP_STREAM_POLL](http://elixir.tronne...
"256KB of RAM" ๐ป
Oh nice. Order in. ๐
choo choo!
thats the cat's meow right there
18 down, 30 left
(I'm sure there is more for the hoards that will decend when notifications go out)
19 down 29 left
26
needs a shield to put feather wings on
I forsee a Grand Central weather station shield. <dusting off kicad>
๐
Haha, that's the thing I got in the steam sale yesterday ๐ @exotic pumice
it's very poignant
@upbeat plover I'm already on it ๐
@slender iron saw your comment on the PR. I think the one Neopixel API change I need to address is that pixel orders in my work come from classes defined in pixelbuf.ByteOrder rather than being tuples. I can probably catch the tuples in the wrapper classes and find a matching ByteOrder class.
ah ya, I'd move away from the tuples I think @ruby atlas
Do you think I need to bother with translating the tuples, since most examples just use the named classes?
Also the other bit is how we want to transition to it. I have prototype classes here https://github.com/rhooper/Adafruit_CircuitPython_RGBLED/blob/master/neopixel.py and https://github.com/rhooper/Adafruit_CircuitPython_RGBLED/blob/master/adafruit_dotstar.py that use pixelbuf. There's definitely some code I can clear out of pixelbuf, but I wanted to discuss that too ๐ There's currently 3 ways to have pixelbuf do write callbacks, and I feel like we should just have one way.
RGB LED Abstraction library for Circuit Python. Contribute to rhooper/Adafruit_CircuitPython_RGBLED development by creating an account on GitHub.
named classes should be fine. we can break anyone who does a tuple directly
@solar whale do you want me to mergein https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol/pull/16 ?
๐ ๐ ๐
The 3 (4) ways to callback:
- function + args + pixelbuf as a argument (I think this can go away)
- function + args + bytearray (This seems redundant)
- directly call neopixel_write (I think this should go away)
- function + args (no arguments added by pixelbuf - not yet implemented)
The direct neopixel_write was part of benchmarking, and it gives a small boost, but not enough to be worth the hassle.
kk, which is you preferred way?
I had thought about making it so Pixelbuf can be API compatible with Neopixel and returning it instead of a Neopixel instance.
I think the C one should be _pixelbuf and the python one pixelbuf
Yeah, probably a good idea. that's not a big deal to do. I haven't finished implementing the _pixelbuf code yet.
Oh, there's also two easter eggs in pixelbuf... a C implementaiton of wheel and a fill_wheel method. Probably not the right homes for them and should be off on smaller device footprints.
should be easy to move into a different module
I was driving 72+72+32 pixels with fill_wheel() yesterday and it was a little too fast.
that's a good problem to have
yeah, less cycles FTW.
I should have a 256 pixel dotstar next week sometime to see how it performs and/or test how many pixels i can drive before i run out of memory ๐
Since you know that'll be a thing ๐
๐
A future expansion might be to be able to back subsets of a pixelbuf with different devices.
Though the callback should make that possible anyhow.
maybe not that easily for dotstars.
start and end bytes.
why not just have multiple pixel bufs?
that's what i'm doing now, but it would be great to have one big virtual buffer for large arrays.
(and to add 2-d indexing)
ya, we can always have a muxing sort of thing on top
very_bright = AllThePixels([strip1, strip2, strip2])
๐
Should I move common code in adafruit_dotstar and neopixel to a base class, or should the duplication remain as we probably don't want to freeze both?
what common code?
some of deinit, __enter__, __exit__, __repr__, __setitem__ , __getitem__ and the various proxy properties.
Mostly it's just __init__ that's unique.
why can't PixelBuf be the super class?
Oh, hmm...... So PixelBuf would wrap the _pixelbuf stuff?
Much like the two classes already do?
why do you need a wrapper?
Subclassing a C class didn't behave right.
I can't remember which things were crashing.
I think dan saw something go by about this
The subscr stuff worked, I think properties misbehaved, and method calls were ok.
Dan and I did have a little chat about it but I forget where we ended up.
Being able to subclass properly would be the best outcome.
kk, for now lets do a Python superclass with the name we want
and it can wrap the C
once the C subclassing works we can swap out the Python wrapper
Yep, and then get a nice performance boost, and even ditch the callback code.
ya
here is my #circuitpython-dev2019 post! https://blog.adafruit.com/2019/01/04/scotts-tannewts-circuitpython2019/
What was your first computer? => my dad's Hyperion portable PC Compatible
My own first computer was a 286 I built from parts I bought from the PC rental store I worked for doing maintenance.
mine: Compaq something, something. which i quickly fried the motherboard on, because i just had to peek in the case and did so while on a carpeted floor.
๐คท
IBM something that my parents had to take a loan out to buy apparently. Further: My dad says they still have it. I have not seen proof of this though.
Dell Inspiron with a C2Duo running XP, possibly a newer version of tannewt's #1
i think i still have the HDD from the first PC i built. 528MB. so yuge!
I started with MSDOS, then went to DesqView on the 386, and eventually to Windows on a 486.
3.1. still the best version. ๐
3.1.1 WFW
Didn't need 3rd party stuff for ethernet and tcp/ip with that.
(well you needed the NDIS driver... but ...)
LOL A bot just told me off.
i do remember Winsock. ๐
word filter caught a certain sitting US president.
if Dyno was open source, i would gladly volunteer to touch up the filter routines.
I guess we're coming back to some of that approach with the AT-command IP.
ikr!
over 20 years later, old things are new.
I remember saying that this internet thing wouldn't catch on unless Microsoft gave away their TCP stack
@tidal kiln p0ng
@meager fog pIng
can you help the people with crickit hat and no i2s audio
im out of time today ๐ฆ
i thought i made the mute pin un-mute by default but i dont have one in front of me
they can solder a wire or cut the trace?
or set the pin high using gpio shell command
ok. i'll get them something so they at least have output.
setting high was left channel only
@prime flower fine with me.
First "computer" was a DIY relay adder-subtractor with a bank of lights but a very advanced telephone dial data input. Our school didn't have much except a donation of old telephone equip that was torn out of the 1920s era central switching building. Had to make do. First commercial computer was an Apple II.
https://en.wikipedia.org/wiki/Hyperion_(computer) was what I had at home. I had used the C64 and Apple ][ at school.
yah. that should work same.
the jumper is un-cut, so i'm guessing the unconfigured GPIO 16 was pulling it low
there's a pull up, so cutting to disconnect GPIO will do same
yeah i think GPIO16 is 'leaky'
please try it
if so we can easily get people going and ill revise guide
ok, i'll cut the trace on mine to be sure....give me 5....
๐
@meager fog first attempt didn't work. investigating...
Yes I'm aware of the similarity with FrequencyIn, but I need to be able to configure which edges to count on: rise/fall/both.
I'm starting to wonder if it would be better to use soft pin interrupts instead if we can just ignore the interrupt if the callback is already on the scheduler stack. This would prevent an interrupt from flooding the stack blocking other soft interrupts.
@meager fog nvm, rookie mistake (pwr'd seesaw, not pi), cutting trace works, audio both channels
is there a cp released for the nrf?
Deep sleep
I see the possibility for the eventloop to go into deep sleep when there's nothing to do. Awaitable objects that wants to be polled can signal the scheduler whether or not its I/O resource supports wakeup. If all I/O objects support it, the scheduler can go to deep sleep.
i only see .hex
really strange question but anyone know the baud register value of 9600 baud?
I'm getting 65326
i;m getting this error while building for the nrf
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
make: msgfmt: No such file or directory
make: *** [build-feather_nrf52840_express/genhdr/en_US.mo] Error 1```
msgfmt
message format ?
do you have all the submodules?
i ran the update
msgfmt is in gettext
I believe it's
git submodule sync
git submodule update --init --recursive
Mac?
I had some issues with gettext on mac
Try brew link โforce gettext
Or something like that.
it worked with --force
GEN build-feather_nrf52840_express/genhdr/mpversion.h
Creating build-feather_nrf52840_express/frozen_mpy.c
usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [build-feather_nrf52840_express/frozen_mpy.c] Error 2
make: *** Deleting file `build-feather_nrf52840_express/frozen_mpy.c'
Jonahs-MacBook-Pro:nrf jonahym$ make BOARD=feather_nrf52840_express V=2
GEN build-feather_nrf52840_express/genhdr/mpversion.h
python ../../py/makeversionhdr.py build-feather_nrf52840_express/genhdr/mpversion.h
Creating build-feather_nrf52840_express/frozen_mpy.c
python3 ../../tools/mpy-tool.py -mlongint-impl=mpz -f -q build-feather_nrf52840_express/genhdr/qstrdefs.preprocessed.h > build-feather_nrf52840_express/frozen_mpy.c
usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [build-feather_nrf52840_express/frozen_mpy.c] Error 2
make: *** Deleting file `build-feather_nrf52840_express/frozen_mpy.c'```
the next error^^^
and @ruby atlas thank you!
I find it quite hard to locate the correct uf2 for my board because of the length of the list expanding A LOT. It is awesome that more languages have been added! However, I would imagine that if a single person is downloading a uf2 they will probably be looking for their specific language.
I believe adafruit has a web developer working on a solution for this. If not I can try and help.
@marble hornet seeing how far i get in the build
python3 ../../tools/mpy-tool.py -mlongint-impl=mpz -f -q build-feather_nrf52840_express/genhdr/qstrdefs.preprocessed.h build-feather_nrf52840_express/frozen_mpy/test.mpy > build-feather_nrf52840_express/frozen_mpy.c``` are the args i got for `mpy-tool.py`
yeah, mine has the error there too
You: python3 ../../tools/mpy-tool.py -mlongint-impl=mpz -f -q build-feather_nrf52840_express/genhdr/qstrdefs.preprocessed.h > build-feather_nrf52840_express/frozen_mpy.c
Mee: python3 ../../tools/mpy-tool.py -mlongint-impl=mpz -f -q build-feather_nrf52840_express/genhdr/qstrdefs.preprocessed.h build-feather_nrf52840_express/frozen_mpy/test.mpy > build-feather_nrf52840_express/frozen_mpy.c
Looks the same to me.
oh wait
I have build-feather_nrf52840_express/frozen_mpy/test.mpy passed in as an arg.
what branch are you on?
switched branch and retrying after clean
switched to ?
I was on pixelbuf in my fork.
it was a few commits behind master
Builds OK.
try a fresh checkout and maybe try env -i PATH=$PATH make BOARD=feather_nrf52840_express -j12 to have a (mostly) clean env for the build?
something's not quite right with your build env.
@tidal kiln a few weeks back in the weeds, we discussed module-level vs class-level constants. where did we end up, decision wise on that? i can't remember...
i think it was "it depends"
@ruby atlas i'll give it a shot and tell you if it worked or not. eating dinner brb (mom's calling)
of course it was. ๐
did you see my issue? i just re-asked myself that same question recently
nope. looking at Debouncer...
those debouncer ones look like they could be module level and put in const()
that was my thought. they never change, nor should they, and only take up useless space per instantiation.
i don't think they are needed in the calling program
they appear to be used internally
they're class level, so all instances share
ahh...yes, i was down one level in my brains.
We are working on a downloads page that will simplify the process significantly.
@tidal kiln just had a thought. how does micropython.const() work on RPi? is there a stub in Blinka? just lazy enough that he didn't look
there is indeed. n/m. ๐
yep. super complex code ๐
Sorry about the delay but I found where the bug is at the start of my code there were the lines:
backlight = pulseio.PWMOut(board.TFT_BACKLIGHT)
splash = displayio.Group()
board.DISPLAY.show(splash)
That were left overs from one of the Demo code I used to test the screen,
I took out the majority of the screen code while I nailed down neopixel patterns with the intention of adding it back in later but left those three lines thinking set up code wouldn't cause problems (which I was wrong...
๐ sold out
@ladyada great, I have ordered it, may come by today or tomorrow.
@upbeat plover really not surprised. it's an epic board.
Agreed
Between the '840 feather & the grand central, I'm going deep into mad scientist mode for come up with some great projects to show them off.
more coming soon!
first run was small, and we're still working out yield - a 128 TQFP 0.4mm is no laughing matter
That is a lot of teeny little pins in a small space. Looking forward to playing with one!
As usual, I'm amazed by the Adafruit products.
I can't wait to work with the Grand Central
Once yields are up and I can buy many, it might become my go-to platform other than feathers.
Though I love the Metro too
OK, try #4 for this mini 3d-printed Metro stand. I flubbed my Feather stacker stand.
The more I think about it, the harder it looks. Do the solder stencil openings have to be fine tuned for that pin pitch? (probably) Does the solder thickness need to be adjusted too? (probably) Maybe the soldermask needs fine tuning as well. That's leaving alone the temperature profile and all that twiddling.
@meager fog I don't suppose future versions of diagrams like these https://learn.adafruit.com/featherwing-proto-and-doubler/downloads can also have metric? Not that it's hard to add a scale([25.4, 25.4, 25.4]) { } to my openscad code
0.7mm is breezy, 0.5mm is standard, 0.4mm is a challenge
roy, the diagrams are not really meant to be comprehensive - i recommend exporting from eaglecad directly if thats ok
Go ahead, call it 400ยตm. It sounds even more impressive that way.
i have to eyeball the dim's - its mostly so people have 'a scale sense':)
if that makes sense
and since we layout in imperial, the precision is lost otherwise
It does make sense. Though the feather doubler/tripler measurements were perfect.
I understand doing layout in imperial. Aren't most north american parts still in imperial anyhow?
I mean, heck, even in Canada, we build houses in imperial.
Attempts to get us to acknowledge metric for construction failed long ago.
Metric timber was laughable.
I ended up cheating for the openscad and used this scaling: scale([25.4, 25.4, 1]) so I could do layers in metric an the rest imperial.
Pixelbuf with the c wheel helper. 144 dot stars and 32 Neopixels
And with the fill_wheel() helper
I can't wait to see just how many pixels i can drive before i run out of memory.
I am also excited about that ๐
@meager fog Debouncer library is done: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer
@umbral dagger ok - next up - wanna revise the 3 examples that use it to instead use the lib
@ruby atlas Yeah, imperial (i.e. antiquated British... so ironic) will persist in some niches until the US switches and a few generations cycle.
@meager fog That's next on my list.
@ruby atlas can't you just use an arbitrary number to test memory. The RAM doesn't care if the blinkies are there... ๐
I for one would welcome metric lumber. The math and measuring is so much easier. Mathing @ 1/64ths of an inch is annoying.
@raven canopy There's nothing quite like interacting with SPI or neopixel_write to make sure you can do it.
I've already discovered that it's often best to manually call gc.collect() in some use cases, than to let CircuitPython decide when it wants to collect for performance reasons.
Not to mention the bigger the strip, the more sensitive to bugs they are.
@umbral dagger OOOOOOhhhh โค โบ nice, a debounce library! will these work with joyfeatherwing/tft featherwing?
@tawny creek It'll work with anything you can wrap a 0-arg, boolean function around (typically a lambda/closure). You can also hand it a digitalio.DigitalInOut object.
I recently picked up a Feather M4 and a TFT FeatherWing. I'm trying to figure out how to draw text to the screen in CircuitPython. What's the trick?
@solar basin nice! https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing?view=all#circuitpython
have you tried this example?
@tawny creek yeah, there's no text examples
It links to another article that talks about drawing text but I couldn't get that to work.
display stuff is being heavily reworked this month
you may want to kick back and wait till displayio is ready
maybe this issue is a good one to watch https://github.com/adafruit/circuitpython/issues/1337
Will do, thank @meager fog and thanks for making such awesome electronics ๐
๐
@raven canopy thank you!
hello ๐
someone here that can help me / give me some tips for optimizing a CircuitPython Library?
its a pixel lib that needs some speed improvments to be usefull for animation things..
i have reworked / added a variant that fits better with the daisy-chained nature of the TLC59711 chip..
but currently to set a single pixel in the buffer it costs 0.98ms. and that adds up really fast..
so with a small matrix of 8x16 pixel this needs ~124ms โ that is to much to make smooth animations ๐ฆ
@timber mango so it's __setitem__() that' slow. Some suggestions. Don't check the values for float, just assume int. Don't check range with assert. Look up the values in _buffer_index_lookuptable just once each. There's redundant code there. Don't fetch value[0] and value[1] multiple times: save the value in a regular variable. You're creating a list each time maybe value = list(value). Try to avoid that. Remove all the asserts
In general pre-compute as much as possible. Can you avoid those lookups if things don't change? Don't allocate storage (list, tuple, etc.) if you can avoid it.
@tulip sleet thanks for your suggestion!
i will try and optimize! ๐
is assert slower than an classic if ...?
in my timing measurements i get relative long times also for the bare minimum:
meassure timming:
pixels set:
'pixels[3] = (500, 40500, 1000)'
0.79ms per call
'pixels[12] = (0.5, 0.5, 0.5)'
0.94ms per call
'pixels[for 0..128] = (0.5, 0.5, 0.5)'
118.46ms per call
channel set internal:
'_set_channel_16bit_value(0, 10000)'
0.18ms per call
'_set_channel_16bit_value(0..2, 10000)'
0.45ms per call
'_set_channel_16bit_value(for 0..384, 10000)'
61.91ms per call
_set_channel_16bit_value is really bare:
buffer_start = self._buffer_index_lookuptable[channel_index]
self._buffer[buffer_start + 0] = (value >> 8) & 0xFF
self._buffer[buffer_start + 1] = value & 0xFF
the lookuptable is faster than to calculate the index every time (was my first version..)
so without all the conversion and checking i get to about half the duration -
but for user-friendlyness i think i will have to add set_pixel_16_bit_value__fast function...
so if someone want's all the nice checking he can use it.. (good for developing?!)
and then move to the unprotected _fastversion?!
is this a good idea?
I don't think having two versions of the same function makes sense
I think the idea of making it more user friendly as good, but I think having two versions would be more confusing
The energy you would put into explaining the different and why to use the different versions would be better spend just explaining how to use the faster version properly
At least that's my opinion
good point
hm - the float conversion could be really useful - but it also adds up:
'pixels[for 0..128] = (0.5, 0.5, 0.5)'
118.75ms per call
'pixels.set_pixel_16bit_value(0..128, 500, 40500, 1000)'
49.61ms per call
'pixels.set_pixel_16bit_value(0..128, f0.1, f0.5, f0.9) manual conversion'
59.37ms per call
'pixels.set_pixel_float_value(0..128, 0.1, 0.5, 0.9)'
60.94ms per call
but all in all iam at about half the time to set all pixels if i use the fast version ๐
so with 128 pixel i can get update rates of <16fps...
Hi folks - Is 3.x still the recommended stable version for writing guides? If so, will there be another release as @tulip sleet mentioned on this PR? https://github.com/adafruit/circuitpython/pull/1317#issuecomment-435700536
@tough flax Hi - I didn't bother with another release because you were the person who needed this and you were building your own custom releases anyway with different stuff frozen. However, if this is useful as a standalone, it wouldn't be hard to make another release.
@timber mango
is assert slower than an classic if ...
No, but why bother checking? If you're looking for speed just remove error checking and assume the calling program is doing the right thing.
Same idea about using floats vs ints. If ints a practical way to make it faster, then making the calling code do the calculation in ints
@tulip sleet I'm writing a guide that uses this - I'll be including instructions on which version to download (as well as a UF2 that I build from an official source). I just want to know what version to recommend. I thought 4.x was still bleeding edge?
@tough flax Assume 3.x for now. But if you need serial_bytes_available() for the guide, then I can make a release.
it's in 3.x, but it's past the last release
And @timber mango (and @tulip sleet) I've found in other languages that assert() or try/catch blocks are generally the same speed as if/else if the test succeeds, but WAY slower if the test fails (allocation of exception, capture of stack trace, etc.)
I'd love a 3.1.2 release if you could
@tough flax if it fails its fine if its slow for my case ๐ as in most cases the script will stop at this point and the user has to fix his bugs ๐
I've just done lots of tuning and removing try/catch that's used as logic flow is a common task
@tough flax I can get to a 3.x release in the next couple of days, np.
Great - thanks!
@tulip sleet hm yea you are right..
the only thing iam questioning at the moment is - CircuitPython 'easiness' vs ' speed'
so its way nicer to for the user to write something like:
pixels[3] = (500, 40500, 1000)
# or
pixels[3] = (0.5, 0.5, 0.5)
vs
pixels.set_pixel_16bit_value(
3,
int(0.1 * 65535),
int(0.5 * 65535),
int(0.9 * 65535)
)
the speed of this kind of thing is an issue. @ruby atlas is working on pixelbuf, a native (C) implementation of some of the low-level pixel code, which may or may not be applicable here. The M0 processors are just not that fast, with an interpreted (well, compiled to bytecodes) language on top of that, yes, you'll see slowness. Switching to an M4 board will help you, but if you are trying to do fast animation, there are lots of tricks you may need to pull to speed it up (and/or switch to C/C++).