@tannewt and @Dan Halbert from Adafruit, here to talk to us about CircuitPython.
GO TIME!
Would you two start us off by introducing yourselves?
woohoo
Who you are, what you do, and what you're excited to share with us today?
Hii its me ladyada! i'm the lead engineer and owner of adafruit industries! i love to do electronics and write firmware
I'm Scott, I'm the project lead for CircuitPython. I do core work in addition to organizing our awesome community.
I'm Dan. I've been on staff with Adafruit working on CircuitPython since August. We're having a wonderful time building CPy for you folks for your maker, educational, protototyping, and fun projects.
I'm excited to talk about how awesome CircuitPython is for beginners
Hello, I'm Kattni. I'm a Creative Engineer and one of the CircuitPython developers. I'm super excited to share how amazing CircuitPython is and how important the community is to it's development!
what is ETA for CircuitPython 3.0?
@Jani Turunen hoping to do it by pycon in May. We have a long list of open issues for it still
Fantastic. Welcome! Let's get started with the basics: What is CurcuitPython, and why was it created?
@Kattni as well
An extra hello to w00t(I'm phil, here for support, made hackaday 13 years ago, ladyada is my boss)
ok! first Q!
CircuitPython is a variant of MicroPython which is itself a variant of Python 3
We'll be at pycon US!
how does CircuitPython compare to the micropython project itself, and what's the process for upstreaming contributions?
@x Differences are documented here: https://github.com/adafruit/circuitpython#differences-from-micropython We don't actively upstream anything but all of our code is open source so upstream can merge it as they like.
Is the video live? I don't see Lady Ada's messages here.
https://www.youtube.com/watch?v=JH-b2Gk5gfU
Python is the most popular programming language, and has some really cool things built in to it that makes it easy to teach electronics
I have been using other microcontroller systems like PIC CCS, AVR and Arduino for a reallllly long time. but its challenging for beginners adafruit is a pycon 2018 sponsor
you have to set up an IDE, compiler, toolchain. What I <3 about Python is that all goes away, the code lives on the device. Its easy to edit and very fast to iterate
@pt awesome, are you going to have a booth this time?
and best of all *no more* BUFSIZE
we as humans are *bad* at BUFSIZE
:)
so thats what it is and why it was created
@ɖҿϝիɟթվ No booth, they take too much time
@tdicola and all for the OLED library (Adafruit_SSD1306/SSD1306.py) have had greeeaaaattttttt success using that with MicroPython and ESP32's
also thanks tobottom line: differences between CktPy & MicroPy??
the biggest changes we made to micropython is to attempt a unified API for hardware so new devices can implement the standard circuitpython API, makes it so we dont have to constantly update and rewrite drivers
;)
also added support for the SAMD21 which is a great chip for arduino-type projects
I think if you have a warehouse full of boards for sale, you want to make sure that you control the software for them.
little bit more memory and capabilities but not much more cost :)
Stephen, we're ready for the next question!
@bejecreimer : How close can you get to the hardware layer and still maintain python/cython syntax?
Let's start getting into the community's burning questions. This one is fromI understand that all aspects are being actively developed and appreciate the difficulties. Any issues with using CP for devices that have to run for weeks at time?
@bejecreimer Pretty close! We can do anything thats not time critical in Python and use C for the stuff that is. There is a separate trade-off in the API that we have to make for it to apply to all of the hardware we support.
e.g NeoPixels/WS2812B require special timing stuff, so we have a helper for that
We have implemented modules in C that interface to the microcontroller peripherals like USART, I2C, SPI, DAC, ADC, etc.
@shamylmansoor 's question: How good is Circuit Python for real time applications compared to C / Assembly?
That leads intobut they look just like regular Python. No extra syntax
The answer sounds like not so good
@Stephen Python itself is really bad but its ability to call out to C makes to possible. Python's advantage is the fast iteration time when developing code.
Wouldn't that be the same for all interpreter languages versus compiled languages?
Yes, that's why interp languages are great - they're easier on humans to write, but more work for the CPU to do
I am pro-making CPUs do more work
though python is not interpreted
remember it's a bit of a mind shift, you're writing code in a higher level for simplicity and ease of creation.. many things aren't time critical, like talking to a web service
but when it does get time critical you can do that too in C
and some stuff like parsing text is a lot easier in a higher level language :)
@James : What makes this a good starting point for getting involved with electronics, programming, and making things? why should someone choose this over other choices(arduino, makecode, javascript etc)?
MakeCode is the simplest, but larger programs get out of hand quickly. Python is really easy to learn. Also, criticially, we have a very fast turnaround because you can edit the code right on the USB drive that is presented by the board.
The higher abstractions of Python make it really easy to use more sophisticated data structures like lists, strigngs, and dictionaries.
personally, i find writing code in circuitpython *enjoyable* - i was debugging a gyro driver and doing it C was really tedious - a lot of compiling and re-uploading. it took about 1/3 the time with circuitpy given the instant-run and easy debugging output
like even someting as simple as print([hex(i) for i in databuffer])
that is *annoying* to write in C
or splitting strings, parsing, managing structures
python dictionaries instaead of a new struct/class constnatly being tweaked
What applications does CircuitPython excel at compared to a more common uC?
I learned Python almost entirely using CircuitPython. Using a Python environment does give immediate responses, however, using CircuitPython with these boards returns amazing results - flashing lights, sounds, moving parts, etc. It was compelling. And as has been said, the results are immediate.
it's nice in that you can learn python independently of hardware and electronics too, and that skill will transfer directly over to python on hardware.. so you can follow python programming books, tutorials, etc. to learn the language just on your computer.. then pick up a python board and you're already knowledgeable in the core language it uses
oh one of my new fav one liners, for clock with proper "0" padding... ("%02d:%02d:%02d" % rtc.datetime())
makes it easier so you aren't having to learn all three at once, electronics, programming and hardware
which is a lot to do :)
@tdicola Very good point!
Have been using arduino to teach kids electronics and programming
but I guess Python and Circuit Python seems like a good alternative
@tinkeringtech dotstars are smaller
https://github.com/adafruit/Adafruit_CircuitPython_BME680/blob/master/adafruit_bme680.py#L286 vs
even stuff like extracting raw data from a buffer, if some isn signed, char, uint16, its instant in circuitpython.https://github.com/adafruit/Adafruit_BME280_Library/blob/master/Adafruit_BME280.cpp#L356
Hi. Hi. I love CircuitPython and Adafruit's open creative learning. Great community around CP
I found that CircuitPython made it possible to learn all three at once. It made for an incredible experience. Especially with the Circuit Playground Express.
@md has been asking:
Let's start getting a little more technical. To ease us in, the questionbottom line: differences between CktPy & MicroPy?
@stephen @md the biggest changes we made to micropython is to attempt a unified API for hardware so new devices can implement the standard circuitpython API, makes it so we dont have to constantly update and rewrite drivers
we also auto-reload the python file after files are written to the mass storage device
CircuitPython has a very Pythonic syntax emphasizing ease of use for learner.
@Professor Fartsparkle 's question: Do you plan to do a larger Mega 2560'ish board for the SAMD51 in addition to your standard Feather and Metro footprints? Given the insane amounts of pins those ICs have.
our libraries try to be the same or strict subests of regular Python
@stephen MAYBE!
Python 3.6 f strings
:O
@stephen but we want to get SAMD51 solid first
@stephen but we want to get SAMD51 solid first
thank you for the rfm69 lib...any thoughts on LoRa?
Cool! Limor +1
the SAMD51 does - so there's a plan :)
but its ONLY a plan. i dont even have them schem captured. no ETA :)
@stephensb wants to know!
What about circuitpython boards with onboard wifi/ble - are there any available or plans to make them in the future?esp8266 does wifi and circuitpython right now :)
@stephen yep! ESP8266 right now works - i used it for this project https://learn.adafruit.com/circuitpython-totp-otp-2fa-authy-authenticator-friend?view=all
and nrf52 is in beta
Thumbs up for esp8266!
for BLE, we've got a beta 3.0 for nrf52
excellent. thanks
and we're working on the API for that - right now we have cilent/periph - central is still in progress
there's no driver for it yet but the nRF51 bluefruit friend can give you basic BLE peripheral support by talking to it over a serial or SPI protocol too
BLE/ESP32 CircuitPython?
@Bryan : The Adafruit Feather M0 Wifi also runs the SAMD21 chip, so I'm wondering if there's any docs related to running/flashing the CircuitPython env onto a Feather?
Next question by@Bryan we don't have a driver but you can load CircuitPython on that board using the M0 basic version.
it won't give you wifi, though
@ɖҿϝիɟթվ which/what no wifi?
It isn't really an either/or, both libraries are great. Both have made electronics education more accessible.
right, no wifi. You could talk to the wifi stuff but you'd run out of memory really fast.
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/tree/master/libraries/drivers
now's a good time to show off ALL OUR AWESOME DRIVERS!https://github.com/adafruit/Adafruit_CircuitPython_Bundle/tree/master/libraries/helpers
more drivers here*driver dance*
Not sure if this was asked yet, but, Is Circuit Python available on ESP32 Feather??
@mxwrench it's not
@mxwrench even MIcroPython for the esp32 is still in beta
Damn, I just bought one, and I don't do Arduino IDE.
@mxwrench it will come sooner or later, I think, but not in the next 6 months
@Ben Vinson asks: What is the performance boost over the SAMD51 (M4) vs the SAMD21 (M0)? Also, when the M4 is released, will it be the 1MB flavor and how much will be available for CP?
@Ben Vinson about a factor of 6. We're using the 512k one irght now due to availability, could upgrade later
Dan Halbert : M4 has hardware single-precision float, so it's much faster, maybe 10x at least.
(and DSP too, M4 is pretty nice)
and much more RAM: 192k forthe 512MB version, vs 32kB for M0
@tinkeringtech asks: have you seen problems with the UF2 bootloader approach as yet with certain PCs not enumerating the M0 properly? Is this the approach you will take for future boards?
We don't see enumeration problems. The Arduino IDE doesn't switch between the different COM ports nicely on Windows, but it's fine on other platforms. You have to switch manually.
Introduced cpx to middle school class today. Response was: How much does it cost? Where can I get one?
@John Postlewaite That's great!
we really like the UF2 because it's very easy to update the firmware
Dan +1
it really solves the drag-n-drop bootloader problems ive seen with other bootloaders
Really incredible info so far!
it simply isn't tractable to allow raw binary or hex dragging
sometimes it is easier to just use 'crow' ;)
croooooooow
@x : does CircuitPython have any roadmap for WebREPL support?
@x it works on ESP8266
@Felix : Will numpy or scipy be ported someday for CircuitPython?
Next from@Stephen Not any time soon. They are very large libraries
i gotta run in 5 minutes - but will hang out as long as i can
@David Glaude : Do you plan to have a "more" command on the CircuitPython REPL to be able to visualise code from the console?
Next islol
heh
i would like to hear 'more' about this lol
But the CP can move data off to be used by numpy and SciPy
@BrentR asks: Is support for asynchronous io in the pipeline for 3.0 or later?
Dan rocks
@BrentR not for 3.0, but maybe later. It's in MicroPython but turned off in our builds.
@Dan Halbert, that Q was for a professor who is using CirPy for his wedding's table-toppers!
Thanksso cool!
@x : have you thought about implementing a ++ & -- operation to CircuitPython I really miss being about to do something like "if i++ < 10:"
Another question fromthanks!
oh I hope not
@x If it's not in regular Python, we won't add extra syntax.
Jupiter would be really cool!
not unless you convince Guido
lol ok see y'all later!
@limor Thanks, have a good one!
@limor !
BYE@limor ! also, HI
thanks@Derek Parks I think there is a jupiter core for the regular micropython and for the micro:bit
i += 1 is the python way to increment by 1
Feather M0 and Circuit Playground, same Circuit python capabilities?
@x PERFECT form factor!
@mxwrench the "express" boards have much more stoarge space, so more libraries fit on them
ESP32 with custom compiled MicroPython firmware using Adafruits SSD1306 library, yay open source
@David Glaude question gets more into the Adafruit side of things: Is ESP8266 a secondary citizen of CircuitPython because you adafruit has competition on that where there is almost no competition on the M0 side?
AnotherI'm their competition for M0!
hah! Yes!
@Stephen @David Glaude thats not the reason. Is largely because it doesn't have built-in usb capabilities
You can run CircuitPython on the Arduino Zero or on the cheap Chinese M0 boards — I've done that
we do want to circle back to our wifi story for circuitpython but for now we're working on the M4 and nrf52 (with BLE)
@ɖҿϝիɟթվ oh! µGame is yours! nice work
@stephensb thanks!
PART 2 OF TRANSCRIPT: https://hackaday.io/event/34310-circuit-python-hack-chat/log/86933-circuit-python-hack-chat-transcript-part-2
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.