Latest / Talk Python To Me / #221: Empowering developers by embedding Python
Transcript
- 0:00How do we get kids excited about programming? Make programming tangible with embedded devices.
- 0:05Did you know that after kids learned to code with the BBC microbit, 90% of them thought that coding
- 0:12was for everyone, and 86% said it made CS topics more interesting? One person doing great work in
- 0:17this space is Nina Zakarenko. She's here to tell us all about her projects with CircuitPython.
- 0:22This is Talk Python To Me, episode 221, recorded June 24, 2019.
- 0:28Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:46ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter
- 0:50where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,
- 0:55and follow the show on Twitter via at Talk Python.
- 0:57Hey, everyone. Before we get to the interview, I want to quickly tell you about a new course
- 1:02we just launched. It's our first major Flask course, and it's called Building Data-Driven
- 1:06Web Apps in Flask and SQLAlchemy. This one's a deep dive into Flask. We cover things like
- 1:12routing models, templates, databases, and migrations, and even deployment and security. And we do
- 1:17all of this in the context of building a clone of the pypi.org website. Check it out over
- 1:23at training.talkpython.fm. If you're not sure if you want to choose Flask just yet for your
- 1:28web app, then give our 100 days of web course a look. We cover many frameworks and programming
- 1:34models in 25 four-day projects, so you get a super wide view of what's out there. Then you
- 1:40could pick Flask or Django or Pyramid or something else. Thanks for checking it out. Now let's get
- 1:45to the interview. Nina, welcome to Talk Python.
- 1:48Hi, thanks for having me.
- 1:49It's great to have you here. You've been on Python Bytes, but not Talk Python before,
- 1:53so I'm really excited to talk about some of the really cool stuff you did at PyCon, at
- 1:58some of these other Python conferences, and with hardware and embedded Python and a lot
- 2:03of cool stuff you're doing.
- 2:04I'm really glad to be here, and we're recording a special episode from Portland for my home office.
- 2:10That's right. Yeah, we both live in Portland, so doing it live, it's going to be great.
- 2:13So before we get into embedded Python and circuit Python and all these sorts of things, let's just
- 2:19start with your story. How did you get into programming in Python?
- 2:21It's a little bit of an embarrassing story how I got involved in programming in the first place.
- 2:26I was lucky to develop an interest from a young age. So when I was about 11 or 12,
- 2:33I found out about the band Hanson. You remember that?
- 2:37Yes, yes. I remember Hanson. The boy band, right?
- 2:39Yes. And I really didn't like them, and I wanted everyone else to know. And so I figured out HTML
- 2:47and figured out how to put up a Geocities site so I could put some stuff on there, some animated GIFs.
- 2:53Geocities, people might not even remember Geocities, right? Those were early days. If you just had a
- 3:00website, people were impressed. It didn't matter what it was.
- 3:02Yeah, it was like free single-page web hosting. And I think it really kind of changed the landscape
- 3:09of the internet, right? It made programming, even simple things like HTML, something that was
- 3:15accessible to a lot more people.
- 3:17For sure. So you had this thing against Hanson.
- 3:20Yeah.
- 3:22All right. How did that get you to programming?
- 3:24There weren't really a ton of good resources out there. There wasn't GitHub where you can just go
- 3:30and look at somebody else's source code. And so I just started out by right-click,
- 3:34view source, pages that I liked, and figuring out how they did it. And then figuring out how
- 3:39HTML was structured and all of that. And that kind of started my curiosity. So I did go a more
- 3:46traditional route and went to school for computer science. And I've been in engineering ever since.
- 3:52Yeah, that's really awesome. So how'd you get into Python from there? Because Geocities and
- 3:57HTML and vSource, that's all just the web brand and stuff.
- 3:59There was some period in my life where I called myself a full-stack developer,
- 4:03but I was always that half-drawn horse full-stack developer.
- 4:07Yeah?
- 4:07Yeah, where I just naturally gravitated more towards back-end programming than front-end.
- 4:13So I learned Java in school and then I did enterprise Java for a really long time and
- 4:20worked on some really boring software.
- 4:23Yeah? A lot of forms over data and data entry and all that kind of stuff?
- 4:27Yeah.
- 4:27You know, financial software. I worked on software for satellite control computers when I worked at HBO.
- 4:34And I didn't really kind of lost touch with software being fun, you know, or software kind
- 4:39of having creative purposes. I would just go to work and feel drained. I didn't really know much
- 4:44about open source or the open source community. And at one of my jobs, I was doing my enterprise Java
- 4:52thing. And we had started using Python for a little bit of scripting and for the API. And so I started
- 5:00dabbling in that. Had the opportunity to go to PyCon. So my first PyCon was seven years ago.
- 5:05And I was just kind of dreading it, you know, I was like, I'm going to be a noob in this thing and
- 5:11I'm going to get made fun of, or people are going to call me out and it's just, it's going to be so
- 5:15horrible. And then I showed up and I was just overwhelmed with how friendly the community was.
- 5:22Yeah. I had the same experience, you know, just when I was getting into Python, I thought,
- 5:26you know, it was rough. And you said you came from Java, like I came from C# and
- 5:30I was really good at it. And I'm like, I'm going back to being like a true beginner,
- 5:34like where I'm just going to make all these stupid mistakes. And, you know, people were super
- 5:38supportive and friendly. And I really thought it was a special place, right. And just made me want to
- 5:43get into it even more and so on. Yeah. I came back from my first PyCon and I was like,
- 5:47how do I do this more? Because people were, you know, they weren't just kind of friendly to me and
- 5:53welcoming to me. They were really generous with their time as well. So one of the first sprint
- 6:00projects that I worked on as someone that I had met, who is an engineer at Google, you know, instead of
- 6:04sprinting on a big, fancy open source project, just sat with me and helped me talk through some of the
- 6:10issues I was having with my own code. And I was just, I mean, I was floored, right?
- 6:14Yeah. Yeah. Why is this person who's like such a high end developer messing with my stuff, right?
- 6:18Yeah. But they were so, you know, happy to do it.
- 6:20Yeah. That's awesome. That's definitely kind of epitomizes what the Python community is like and why so
- 6:25many people stay, stay and love to work there.
- 6:27And I try to pay it forward, you know?
- 6:29Absolutely. And I definitely do think you do. And it's worth pointing out that you gave the closing,
- 6:34was it the closing keynote?
- 6:35It was.
- 6:36At PyCon?
- 6:36Yeah.
- 6:36Yeah. So you were basically, you stressed out the whole PyCon.
- 6:39Yes.
- 6:40Because at least for me, like we were talking earlier, like it's, it's hard to relax if you're
- 6:45giving conference presentations and stuff until they're over. And you know, if you're the last
- 6:49one, you've got to just like hold your breath off, PyCon. But it was a great presentation. You
- 6:53talked about some really cool ideas about making programming fun again and personal and maybe
- 7:00creative and not necessarily just for closing JIRA tickets or whatever, right? So nothing
- 7:07wrong with that. Like it's great to do programming as work. And a lot of times it is fun, but a
- 7:12lot of us have jobs where it's not exactly the reason we got into programming, right? So it's
- 7:18cool to do really useful stuff or really playful stuff, I guess, rather not useful stuff, maybe
- 7:23even. And so one of the themes of your talk that I wanted to start off with and discuss with you is
- 7:29you said like software doesn't have to be serious. What's the story of that?
- 7:32Not a lot of people know this about me, but now they will. When I was in high school, I was just
- 7:38totally goth, you know, just had dyed black hair. I had a lot of piercings. And when I graduated
- 7:46college, you know, I was like, nobody is going to give me a job if I look like this.
- 7:50Yeah. I can't work at IBM. Like where's the formal dress code of this place is not going
- 7:56to match with me, right?
- 7:56Yeah. Okay.
- 7:57I didn't know anything about startups. I didn't even really know anything about
- 8:01how to go out and get a job after I got my degree. And so I just kind of toned it down and also got a
- 8:08really dry job in the financial sector because they were the first ones to take me out to a nice
- 8:13dinner. And I was like, whoa, you know, so I just kind of fell into it without really knowing
- 8:19what I was getting myself into. And I just, you know, I didn't have kind of the time or the energy
- 8:25really to do a lot of coding on the weekends or do a lot of coding after work. And it wasn't until I
- 8:31found areas that I was kind of really passionate about for other reasons, you know, not just
- 8:37tutorials or quizzes or whatever that I started spending a lot more time on it and kind of getting
- 8:43really interested.
- 8:45Right. The stuff you do in the financial place is not a super fun thing to take home and work on,
- 8:49right?
- 8:49Yeah.
- 8:49So you got to find something else. Yeah, that's cool.
- 8:52So I showed you, you know, this headdress, this LED kind of headdress that I built with,
- 8:57you know, flowers and it's really beautiful. And I worked on that for hours, you know, just...
- 9:02For this whole show, everyone, I'm going to basically have to be like the narrator since
- 9:06a lot of this stuff has a visual component to it, right? Like it's, oh, you push this
- 9:10button or we plug in this device and what does it look like? How big is it? So I guess I'll
- 9:15start by describing the headdress. It's like a, I don't know, it's probably like a big circular
- 9:20fan type headdress and it's probably fans out about a foot or so. And it's got all these LEDs
- 9:27that are going and it's just, it's super cool. And so that you built with Arduino, right?
- 9:30That's right. So that does not run Python. I use something called the FastLED library.
- 9:34Yeah. And that was just about really just animating LEDs, right? And so there's kind of a,
- 9:39it's actually a big thing and it's pretty omnipresent, right? It would definitely stand
- 9:45out at a party, but it's not a huge programming thing, right? It's not like super interactive
- 9:49in that sense, right?
- 9:51It's not interactive, but there is a push button. So there's six or seven patterns that I programmed.
- 9:56Okay. Yeah. So yeah, there's some interactivity to it. Okay. Awesome. All right. So you did that
- 10:00and you're like, Hey, this is embedded stuff. This is pretty cool. Sort of designing
- 10:04things with Python. And that's definitely got to be a lot easier these days, right? There's a lot more
- 10:10stuff out there, a lot more little boards and devices you can get, right?
- 10:14Yeah. This field is, you know, at least for Python is still very, very new. So all the software,
- 10:20all the devices, you know, there's a lot of excitement in that space and things are
- 10:24kind of moving pretty quickly.
- 10:25For sure. So I guess maybe the headdress you described maybe falls under art. There's also
- 10:31animations, but like actual graphical animations people could play around with. Have you seen
- 10:35this, the programming music with Python, like the Fox dot stuff before?
- 10:39No, I haven't.
- 10:40Oh my gosh. yeah. Maybe I'll put a link to it. It's just, there's some really cool stuff people
- 10:45are doing with like live performance music with Python. And so there's just all these really,
- 10:50really great ways that are, you know, very far away from people's jobs.
- 10:54Yeah.
- 10:55That's you play with code instead of, you know, just take your work home with you,
- 10:58which I think that's great.
- 10:59There was a conference here in Portland over the weekend called Teardown Hardware Conference.
- 11:03And Scott Shawcroft, who is the maintainer of CircuitPython, he did a demo of the Game Boy.
- 11:10He kind of hacked a cartridge to run CircuitPython on an original Game Boy. And his demo was all
- 11:17playing tones, right? So, you know, depending on what bit was set or wasn't set for a particular
- 11:23register that would vary the length of the tone that was played or the pitch. And I just, the whole
- 11:29time I was thinking like, I really want you to be a CircuitPython chip tunes, you know, DJ.
- 11:33Yeah. Yeah. That's awesome. That sounds like so fun and tune it on the Game Boy. That's pretty
- 11:38wild, right? That's not even intended for it. I feel like the Nintendo stuff is pretty locked down.
- 11:43Cool. Cool. So, you know, I guess let's start this conversation with like, how do I write code
- 11:50in Python and run code? So if I were to go to my Mac and type Python, I'd be running CPython.
- 11:55But when I think of embedded programming, often people say, well, you have to use C to do this,
- 12:02right? But there's a couple of options. Like you mentioned CircuitPython before that, or sort of
- 12:06parallel and started like as a, started that project as well as MicroPython. And then there's probably
- 12:12other options that I don't know about. Like maybe you could put Python on an Arduino or
- 12:16who knows, something like that. Maybe talk us through the options and like why you would choose
- 12:20one or another. Some of the kind of Arduino options, you can just run, you know, straight Python on there.
- 12:26And it's just CPython that we all know and love? I believe so. Yeah. But the downside is,
- 12:30you know, the devices are a little bit bigger. They're a little bit less lightweight.
- 12:33Use more battery, probably. Use more battery. And they're kind of geared towards a more advanced
- 12:38audience. Okay. MicroPython. I actually haven't done much work with MicroPython. I don't really
- 12:45have any of the devices that run it. So I don't have a micro bit or anything like that. But that was the
- 12:51original Python for kind of these, you know, devices and CircuitPython forked from it, maybe about three
- 13:00years ago. And it differentiates itself by aiming to be the fork that's focused towards learning.
- 13:07So it's not, you know, maybe the fastest or the most optimized, but it's the one that's going to be easiest
- 13:13for beginners to pick up on and use. And that's important because it can be super frustrating with some of these
- 13:18things. They're, they're, they're kind of glitchy. Like I'd only done mostly web development and server
- 13:22side programming and stuff for a long time. And recently we did some mobile development for my
- 13:28courses and man, I just felt like, wow, life is a whole lot harder for some people than others. And
- 13:33I kind of get that sense, like watching you work through all your devices, like they're really cool.
- 13:37And they, they do work with their, they all take like a special little setup or like, it's a little,
- 13:42a little tricky to get started, right? Not hard, but like, you know, you got to find the right volume
- 13:47and all this one's not connecting and just like that kind of stuff, right?
- 13:50Yeah. You know, I mess with mine probably more than most, but the, yeah, the goal for these
- 13:55CircuitPython devices is that you just, you plug it in and it shows up as a drive. And, if you're
- 14:01not, you know, messing with it, like I am, or kind of plugging in a bunch at once, it does work
- 14:06relatively well. There are a ton of guides on Adafruit for a lot of things that you might want to do.
- 14:13And they're also really good about releasing helpful libraries.
- 14:16Okay. Like little Python libraries you can use and stuff.
- 14:19Yeah. Like, these LED strips are in Adafruit land. They're called NeoPixels, but they're just
- 14:25WS2812, LEDs. So they have libraries for filling all the NeoPixels on a particular device. Like,
- 14:34the, CircuitPlayground Express has, you know, the built-in ring. So a lot of kind of helper methods
- 14:39for things like that.
- 14:40That's really cool.
- 14:42This portion of Talk Python To Me is brought to you by Ting. Let me tell you about Ting, a new mobile
- 14:46service available in the U.S. that's targeted developers and other technically savvy folks.
- 14:51First of all, their average customer only pays $23 a month, but they're no discount provider.
- 14:56Their service runs over T-Mobile's and Sprint's fast nationwide network.
- 15:00If you don't use that much data because you're usually on Wi-Fi, like many of you are, then Ting will save you a ton of cash.
- 15:06But don't worry, you can still use as much data as you like for just $10 per gig.
- 15:10One mobile feature I use all the time is tethering. And with Ting, you get unlimited tethering at the
- 15:16same data rate with your account. $6 a month for a phone line, $10 a gig, $3 a month for text if you
- 15:21usually chat over iMessage or WhatsApp. Think about it, no contracts and super clear and fair billing.
- 15:27Visit python.ting.com, that's python.ting.com, and check out their savings calculator.
- 15:34Enter your usage and see exactly what you'd pay. Use that link and you'll get a $25 credit to try
- 15:39them as well. That's python.ting.com or just click the link in the show notes.
- 15:43Maybe that's a good place to talk a little bit about some of the devices we might start with.
- 15:50We'll dig into the, you got a bunch here we're going to talk to you. They're going to be really
- 15:53fun. But you know, everyone who attended PyCon got in CircuitPython Express. Is that what it's called?
- 15:58CircuitPlayground Express.
- 16:00CircuitPlayground Express.
- 16:01Yeah. And maybe that gives people a good idea of just what's possible these days, because how would
- 16:06you describe the size of that thing? It's like, I don't know, five centimeters across, two inches,
- 16:11something like that, across probably.
- 16:13About two inches.
- 16:14Yeah. And, you know, maybe describe all the stuff that is on this little tiny,
- 16:19super thin device here.
- 16:21The cool thing about this, I was showing, Michael, I was showing you some of my other projects,
- 16:26like something that I built at a teardown workshop and it involved a lot of soldering.
- 16:30Yeah. Hot irons and maybe not connecting the right thing to the right. It's pretty intimidating,
- 16:35actually, if you haven't done it before, I think.
- 16:36Yeah, it definitely is. And not yesterday. I've gotten, I've gotten a lot better at it,
- 16:41but definitely when I was, you know, first starting out, I've gotten, you know, like little burns here
- 16:45and there. So you do have to be kind of really careful. You have to think about, you know, polarity of
- 16:49things. Am I putting it in the right way? Am I using, am I using the right components? Even
- 16:54breadboarding, you know, there's kind of some complication to it. So the thing that I like
- 16:58about these Circuit Playground Express devices, it has kind of everything that you need to just get
- 17:03started conceptually on one board. So it has both inputs and outputs, right? So inputs being things like
- 17:11there's two programmable buttons on here. There's a switch that you can program. There are some sensors
- 17:17on here, like there's an accelerometer, there's a temperature sensor, a few other things. And then
- 17:23the outputs are the ring of LEDs around it.
- 17:27And you probably can connect other stuff. Like, could you connect a speaker or something to it?
- 17:31So there is a tiny speaker on it.
- 17:32That's awesome.
- 17:33And then you can use the, there's kind of these inputs and outputs along the sides as well that
- 17:38you can connect to, you know, you can hack up a NeoPixel strip or something pretty easily with just
- 17:44alligator clips.
- 17:45Yeah. So it's like a circle and there's maybe 10, 12 little punched out rings on the outside and you
- 17:52can connect stuff and control like lights and stuff with that. Right.
- 17:54There's some inputs in here, both analog and digital.
- 17:57That's super cool. And that whole thing costs like what? $25. It's not super expensive, right?
- 18:03Yeah. I think these are $25, $35.
- 18:04Yeah. So if you want to get started, this is probably a good one because it has a bunch of
- 18:08built-in sensors, you don't have to like try to attach them and so on. That's a pretty good option.
- 18:13Another one that looked interesting, you know, is not really in the realm of what you've been
- 18:19working on, but maybe other people would be interested in is there's a Pi Gamer, right?
- 18:23So if you're interested in like doing little games with like Pi Game, that's another good
- 18:27option. And it's more, but it's like $20 more. It's not like, it's like 49. There's a starter
- 18:33kit for $59. Like these things are all really approachable for folks. Right. And I feel like
- 18:40these types of devices would be really good for kids or people who are getting into programming
- 18:46who are, don't fit the, I don't know, the traditional, just plow through the technical
- 18:51bits until like you get there. I feel like so much of traditional programming is taught
- 18:56with like extreme delayed gratification, right? Like, okay, you're going to take a course on
- 19:02programming and this semester you won't really do anything interesting at all. So you're
- 19:06going to work really hard all semester and come up with nothing. Maybe the end of next
- 19:10course after this, you'll have something that's cool. And like, really, that's how it goes,
- 19:15right? Like, here's how you do a loop. Here's what a variable is. Here's how the memory works.
- 19:18Here's a heap and all that. Like you've got to plow through that in order to get to something
- 19:23like where it actually is creative and fun on the other side. Whereas like this kind of stuff,
- 19:28right? 10 lines of Python, plug in a USB to your computer and you've got cool stuff happening
- 19:34already, right? So I feel like it's a much more approachable, like early win, get into program.
- 19:39Then once you're really into it, you're like, okay, well, how do I do this looping? Because I want to
- 19:43make it cycle or whatever. I think it's, it's a much more natural way to approach learning programming.
- 19:48I think so as well. Yeah. I, all the code examples that I used in my keynote, I try to make them be,
- 19:53you know, each one just kind of building on the next. There's just something, you know,
- 19:57magical about holding something in your hand and having it do something right. That just,
- 20:01like you said, that kind of immediate reward, immediate gratification. And I think whatever
- 20:08we can do in our industry to get, you know, not just kids, but even just, this is fun for adults,
- 20:13right? Yeah. Yeah. Yeah. It's, it's super cool. Just get more people interested. There's tons of
- 20:18little projects that you could do with this. I mean, if you're into gardening and you could do IoT,
- 20:21like plant monitoring, all kinds of stuff, right? Like it's, it's pretty neat. I love it.
- 20:26I'm still a hobbyist. Yeah. I like that. You don't have to be an expert to use a device like this and
- 20:32kind of get the basics down and get the concepts down. You know, I'm not an electrical engineer and I
- 20:37never will be, but I can still do a lot with something like this. Right. Right. You're not mapping out the
- 20:42actual circuit or whatever. Right. But yeah, that's really cool. And it seems like some
- 20:46super fun projects that we'll talk about. But before we get into the actual steps of programming,
- 20:51let's just maybe talk real quickly about the BBC micro bit, because you quoted some cool stats
- 20:57from there at the end of your keynote. I've had a topic on it before on the show. And, you know,
- 21:03it's a really cool story where the BBC funded giving a little device, kind of like what we're talking
- 21:08about to what grade was it in all the UK? I don't remember.
- 21:12Like late elementary school, early middle school, something like fifth, sixth, seventh grade,
- 21:16something like this, right? Yeah. Like 11, 12 year olds.
- 21:18Yes, exactly. Okay. So yeah, there's some really cool stats. If you want to tell us about that.
- 21:22Something I really like about this project that they did is they did kind of an exit survey,
- 21:26right? So they surveyed kids kind of before and after. And some of the numbers that came out of this
- 21:32were 90% of the kids after they got to use the micro bit thought that coding was for everyone.
- 21:39Right. Because a lot of people feel like coding for either super geeky people or super smart people,
- 21:45or maybe the intersection of those. I don't know. Like it's, it doesn't feel like, oh yeah,
- 21:49everyone can just do this. Right. It feels very like you got to know the magic and there's,
- 21:54it's just too hard to get into a lot of times. I feel maybe that's a little bit less these days.
- 21:59I mean, when it was like C++ and assembly, it really felt, or Java even, it felt like,
- 22:03you know, this is not something you just walk up to and get a job in, or you become proficient in.
- 22:08Even kind of when I first got the hardware stuff on my radar, you know, a lot of the projects that
- 22:13are coming out, I just, I wasn't really kind of particularly interested in them. Right.
- 22:18Yeah.
- 22:18It wasn't until I started seeing, you know, projects and builds and guides and tutorials
- 22:23that were doing things that matched my interest more, matched my aesthetic that I recognized,
- 22:29you know, that it was something that I could try as well.
- 22:31Yeah. It's awesome. Like build something you could wear or like make something awesome for Halloween.
- 22:35Right. Something like that. That sounds really fun. Yeah. So another stat, 86% of the kids who went
- 22:42through it said computer science is a topic that's more interesting to them afterwards.
- 22:47Yeah. Yeah. I think so as well. Right. You know, like you said, kind of mixing those things in
- 22:52little by little, right. You know, looping control statements, if else, and then seeing it happen.
- 22:58Yeah, absolutely. The visual aspect. And then I think also just the learning just enough. Right. And so I
- 23:03guess we didn't mention this at the top, but it's worth pointing out that the micro bit ran
- 23:08micro Python at the time. Actually, they started out in the historically trying to do some other
- 23:13way to program it. I don't know if it was like in C or it was in, they're trying to build their own
- 23:18little operating system for it or something, but it wasn't Python and micro Python until it got a
- 23:24little ways down the road. They're like, this looks hard. You should use micro Python. And they went for
- 23:27it. So that's really good. Yeah. Yeah. And then the last one you said was very near and dear to your
- 23:33heart. Yeah. 70% of girls said that they would choose computer science as a subject option after using the
- 23:39micro bit. That is super cool. I think it really, really speaks to like the first one, like a lot
- 23:45of people find it more interesting or they thought it was for everyone. And of course, girls would feel
- 23:50that way as well. Right. Like it's, it's a fun thing to work on. And like a lot of these projects we're
- 23:54going to talk about are, you know, super interesting for girls and boys. Right. But definitely, definitely
- 24:00interesting. So let's talk a little bit about the overall flow of like, what does it look like to
- 24:06program? One of these things, right? Like maybe I go and order the circuit Python express,
- 24:12uh, circuit playground, sorry. And, and I get that. And then, well, now I have this thing and it's cool,
- 24:18but what do I do? Right. Like, how do I get started? What are the steps? These are Arduino compatible.
- 24:23So there is a mode that you can go into where you can just write straight Arduino for this as well.
- 24:28Okay. So it's not limited to just circuit Python. So depending on when and where you bought your
- 24:35circuit playground express, it might either already have circuit Python loaded up on it,
- 24:39which is great. You'll plug it in and you'll see a circuit Python drive. If you don't, it's pretty easy.
- 24:45All you need to do is check out the Adafruit website and there's instructions for putting
- 24:49this into boot letter mode and you basically just drag and drop a file and then circuit Python's
- 24:54available. Okay. Yeah. And if you pick yours up at PyCon, circuit Python's already on there. So
- 25:00easy peasy. Yeah. Super easy.
- 25:02Once it's available as a drive, you will see either a main.py file or a code.py file. I believe code.py is
- 25:10the standard that they're moving towards. The really nice thing about these devices and circuit Python
- 25:16in general is with Arduino, you would have to write your code and then there's a compile step and there's
- 25:24a step where you'd have to load it onto your device. And sometimes it wouldn't transfer correctly or it
- 25:29wouldn't be recognized. And so there's just kind of a lot of waiting and fiddling in the process.
- 25:35With circuit Python, all you need to do is if the code.py file is not there, you just, you make it,
- 25:42you type your code in, you save it, and then it auto reloads on the device.
- 25:46Yeah. That's cool. So basically the programming effect is I just edit this file and then when you
- 25:53hit save, it reruns it. Either it's good and it runs or it's going to crash or whatever. And
- 25:57we'll talk about debugging them in a little bit, but yeah, you just, it basically just auto refreshes.
- 26:03I mean, kind of like Flask or something you're doing web development, you make a change, it detects it
- 26:06and it just goes, but it's just on the device, right? So you don't have to like turn it on or start
- 26:11Python. You don't have to do any REPL thing. You just, you edit a file like by virtue of powering it,
- 26:17it's trying to run that file. And then it just watches for changes, I'd guess, something like that.
- 26:21The important thing here though, is you do want to use a known good micro USB cable that has both
- 26:27data and charge. A lot of cables don't. And so point of frustration for a lot of folks is they're
- 26:34using a cable that's just for charging. The drive isn't being recognized.
- 26:38Like that $3 one you got at Target or something, right? It's $3 because it probably doesn't carry
- 26:43the data or whatever.
- 26:43Right.
- 26:44Yeah. Okay. Yeah. So you got to be real careful about that. But other than that,
- 26:48like you basically plug in a micro USB thing, then regular USB to your computer and then it's up,
- 26:53you have to find, find it as a volume or a drive, right? So you got to go and hunt that down.
- 26:58So on Mac, if you have your finder open, you know, it'll just show up there on the left-hand side.
- 27:03Yeah. And that's easy. And it's probably similar to Windows Explorer. It probably just shows up as
- 27:07another like attached drive or something.
- 27:09I believe so. I actually don't use a Windows computer. It's ironic, right?
- 27:13Yeah. Don't you work for Microsoft?
- 27:14I do. Yeah.
- 27:15You work on this code PY file. I guess maybe it's pretty much straightforward. You import some of
- 27:21the libraries that maybe CircuitPython provides so that you can program things or maybe something
- 27:27from Adafruit. So like the regular standard library doesn't probably have something for talking to
- 27:33LEDs.
- 27:33Right.
- 27:34Right. But this probably has a bunch of stuff like that you're going to work with.
- 27:36Some of the libraries are kind of baked in. So on the Circuit Playground Express, there's
- 27:41Circuit Playground Express library that makes it really easy to work with the buttons, for example,
- 27:46and some of those sensors on the device, you know, the switches and all of that. So for that,
- 27:51you just have to import it. Some of the external libraries, like the ones for working with, you know,
- 27:57additional NeoPixel strips or some of the things that you can, you know, kind of extend and plug into
- 28:03this need to live in a library folder.
- 28:06Okay.
- 28:06And you can just find those dependencies on CircuitPython.org.
- 28:10I see. So if I want to have some sort of external dependency, that's possible?
- 28:14Yeah.
- 28:15Yeah.
- 28:15Do I pip install it? Do I download it and copy over? Like what's the,
- 28:19what's the mechanism? Like I just copy into this libraries folder?
- 28:23Yeah. You just copy it into the libraries folder. There's definitely some additional work that can be
- 28:29thought of with packaging. You know, there's no good way of pegging a dependency to a version,
- 28:35for example, but the project is open source. And they will gladly.
- 28:40Exactly. PRs are accepted.
- 28:41Yeah. They'll gladly accept your contributions in the space.
- 28:44Yeah. I can imagine that they would. Like you said, it's early days, right?
- 28:47Yeah.
- 28:48So it's, it's wide open. I feel like it's really growing quite a bit. A lot of interest
- 28:52is developing here and a lot of, a lot of different angles, like the education space,
- 28:56people are makers, all kinds of stuff.
- 28:58I think the key here is, you know, it's not just for kids. People look at some of these devices and
- 29:03they're like, Oh, this will be fun for my eight year old, you know, but it'll be really fun for you
- 29:07too.
- 29:07For sure. You can definitely do some, some cool things. You know, one of the things that I find is actually
- 29:11a challenge, maybe because I'm good at programming. I don't perceive that as a challenge,
- 29:15but just my assessment of like looking at this space, like what is challenging. The programming
- 29:20is a little challenging, but I feel like knowing what extra things go with my device. Like what if
- 29:26I want, you know, like strips along the wall that light up when it watches me walk by, or, you know,
- 29:30it just says, you know, to text me and like, well, Greece welcomes me when I'm home or welcome to our
- 29:35house or whatever it says. Right. Like if I wanted to do something like that, like I just look at all
- 29:39the stuff I could go shopping for at crowdsource or, on adafruit.com or, and I'm just like,
- 29:46there's a bunch of stuff here. I'm not sure it's even compatible with this thing I want to get.
- 29:50Like, how do you address those kinds of things?
- 29:52So I've gotten, kind of a lot better about figuring out what parts or components I might
- 29:57need and how, how things work together. But until that happened, I would just look at guides online
- 30:03that had incorporated some aspect of what I wanted to do. And then I would just kind of deconstruct
- 30:08that and kind of pick and choose and figure out ways to put those things together. So there's guides
- 30:14on Adafruit. There are guides on Instructables. I just met a really cool maker who does a lot of
- 30:20wearable stuff for an Arduino based magazine, Sophie Wong. Okay. Yeah. She, she makes really cool.
- 30:26She had this led jacket. She does kind of cosplay. So she brought this helmet, like led helmet that
- 30:33she made for astronaut costume. That was just amazing and incredible.
- 30:36Oh, wow. Yeah. Yeah. I can imagine the cosplay stuff. It's really got a lot of,
- 30:40a lot of cool options actually. You should check out her guides. cause her led jacket was powered
- 30:45by one of these circuit playground expresses. I rode over here on my motorcycle, right? And I just saw
- 30:50yesterday on YouTube, this guy who had built a helmet like from Tron and had these led lights all
- 30:57over it. It had this like, sort of one of these type of chips and batteries on the back.
- 31:03And you could do some like super cool stuff with that as well. Like have that light up way right
- 31:07at night or yeah, it's not really, there's just a lot of cool little projects you could just take on.
- 31:11Right. My only piece of advice in that space is you want to build things incrementally. So you might
- 31:17have, you know, this kind of crazy idea of, you know, yeah, this grand vision, but it's, you'll have a
- 31:23much easier time and you'll end up on a happier path. If you start with something much smaller scale and
- 31:30either really understand how all the components work first written and how they work together
- 31:35before you take on a really large undertaking. Yeah. Yeah. Even on small things, right? Like
- 31:40write one line of code, see it run, write another line of code, see it run, because there's not a
- 31:46whole lot of debugging or like high end tools to attach it to analyze it. Right. It's kind of like
- 31:51print statements. And, you know, we should also talk about that. you know, if, if I like try to figure
- 31:57out what's going on, I do a print statement or something like that, I'll probably be a little
- 32:00disappointed on the output at first. Right. If I don't, don't like find a way to connect to it.
- 32:04All the code is running on this little device and you won't see any output. Right. It has no screen.
- 32:10And it's, as far as it's concerned, it's its own operating system. It doesn't care about your Mac or
- 32:14your windows or whatever you connected it to or any, cause it might not be connected to anything.
- 32:19Right. If you want to see any debugging output on this, you can either use something like the
- 32:24mute editor. So that's an editor that's good, not just for beginners, but for folks who are just
- 32:31starting out with hardware. Cause there's just kind of buttons for all these things. There's one button
- 32:36that says open serial console and that's where you would go to see your print output. Right. So it just
- 32:40listens for the serial output and it just prints out whatever it sees. Right. Which is, so these
- 32:45things, when you connect them, they basically appear to your computer, like modems. Is that right?
- 32:49As a drive.
- 32:49As a drive. Okay. Yeah. So you connect to them and you get the output and whatnot.
- 32:54That's cool. I guess another, you know, so we talked about the circuit playground express,
- 32:58another one that's a pretty good one and that's self-contained, right? So knowing what I need to
- 33:02get for that, I can do a lot of interesting stuff. Just that one little thing in a power core,
- 33:07power data cord. There's also a pie gamer, which is kind of cool. A little screen, a couple of buttons
- 33:11and a controller.
- 33:12There's a pie badge. I have one right here.
- 33:14The pie badge is super cool. It's got some buttons and a screen, like two sets of buttons,
- 33:19like an AB button and then like the four arrows and a little, a little screen on it. That's,
- 33:23those are both really cool. And then, I don't know about this one. You probably can tell us,
- 33:27but the pie gamer comes with a starter kit as well with a battery and a speaker and a little box it
- 33:33goes into. So, you know, for me, I'm, I'm kind of, I'm at the super early stages of this stuff. So I'm
- 33:37like, all right, starter kit. Does it say starter kit? That's good for me. I'm going to try that
- 33:41maybe and then see what else I got to get. I believe the pie gamer is going to be in the
- 33:46ADA box that's shipping right now. Okay. Yeah. So if you're subscribed, you should get a fun surprise
- 33:51in the mail. Oh, how cool. How cool. Yeah. It's some of these things are hard to get ahold of. They
- 33:55keep selling out. Yeah. So I guess that's a good sign. Yeah. The, this thing, the pie portal,
- 34:01it's been a pretty hot seller. Yeah. So let me describe the pie portal. So the pie portal is this,
- 34:07let's say three inch by two inch touchscreen. And it looks basically just like a touchscreen from the
- 34:12front. There's almost no other circuitry you can see. And I guess translation, what is that like five
- 34:17by seven centimeters? And yeah, it's just a little touchscreen that you can program with CircuitPython,
- 34:23right? The cool thing about this one, it also has internet connectivity. Yeah. The internet connectivity
- 34:28is missing from the Playground Express, right? Yes. And that would be so, it's like the one thing,
- 34:34like a little wifi something. Can you get an adapter to plug into it that works? I don't know. I haven't
- 34:38thought that one through. I haven't tried it either. So I guess you got to decide what am I trying to
- 34:43build? Does it need internet connectivity? Right. Right. Right. Do you want to do something IOT
- 34:47related? Right. Right. If it's IOT, then it probably needs that. This portion of Talk Python To Me is
- 34:54brought to you by Rollbar. Got a question for you. Have you been outsourcing your bug discovery to your
- 34:59users? Have you been making them send you bug reports? You know, there's two problems with that.
- 35:04You can't discover all the bugs this way. And some users don't bother reporting bugs at all.
- 35:08They just leave, sometimes forever. The best software teams practice proactive error monitoring.
- 35:14They detect all the errors in their production apps and services in real time and debug important errors
- 35:19in minutes or hours, sometimes before users even notice. Teams from companies like Twilio,
- 35:24Instacart, and CircleCI use Rollbar to do this. With Rollbar, you get a real-time feed of all the errors,
- 35:31so you know exactly what's broken in production. And Rollbar automatically collects all the relevant
- 35:36data and metadata you need to debug the errors so you don't have to sift through logs. If you aren't
- 35:41using Rollbar yet, they have a special offer for you, and it's really awesome. Sign up and install
- 35:46Rollbar at talkpython.fm/Rollbar, and Rollbar will send you a $100 gift card to use at the Open
- 35:53Collective, where you can donate to any of the 900 plus projects listed under the Open Source Collective
- 35:59or to the Women Who Code organization. Get notified of errors in real time and make a difference in open
- 36:04source. Visit talkpython.fm/Rollbar today.
- 36:09I really like the screens here. I mean, the LEDs are cool and they're fun, but you have a lot of
- 36:14flexibility of doing fun stuff. So one of the projects you were showing me earlier before we
- 36:20started talking on the recording is the Python 2 death clock. So I talked about, you know, legacy Python
- 36:26and how we're finally moving past, right? Past Python 2, I think. But a while ago, someone made something,
- 36:33I think it's pythonclock.org or something like this, where it's just the countdown until the end of Python 2.
- 36:40Yeah.
- 36:41Right? And so you've got this cool little app that you built on one of these. Yeah. And it's,
- 36:46man, it is beautiful. Yeah. You want to just tell us about it?
- 36:48Yeah. So I wanted to make my own desktop Python 2.7 countdown, you know, so I could just keep an eye
- 36:54on it. Yeah. Didn't have to have a browser tab open. Come in the morning, sit down. You're like,
- 36:59oh yeah, it's 190 days now. Yeah. 190 days, four hours, 31 minutes. Right on. The fun thing about
- 37:06this is I really wanted to kind of use the touchscreen capability here. And so I wanted my Python 2.7
- 37:12countdown timer to match my mood. Okay. Right. So there's a kind of a bunch of different themes that
- 37:18you can flip through with the left and right side of the touchscreen, you know, light colored
- 37:23background, dark colored background, there's different fonts. So, you know, whatever mood
- 37:27you're kind of feeling like that day, more modern, more abstract. That's the version of the Python
- 37:332.7 countdown.
- 37:34Yeah. That's super cool. So you just touch the screen and it cycles through and it's just constantly
- 37:38counting down the time there. Yeah. So tell us about programming that.
- 37:42So this is interesting. This is kind of where I bumped into some of the limitations and the quirks
- 37:50of a device like this. So there's no real time clock on this. Right. Okay. So you have to go and
- 37:57fetch the time from the internet. Because it just doesn't, it's just, it's like Grandhog day for it.
- 38:01It doesn't know what time it is. Once you kind of unplug it, you know, unplug it back and it doesn't
- 38:05know what time it is. And it can kind of keep track of the time for a little bit, but then eventually
- 38:10the clock will start to drift. So you want to fetch the time from the internet. Yeah, just refresh it.
- 38:14Okay. Every once in a while. It has Wi-Fi. So it's, it's a big deal. Yeah. The other thing I haven't really
- 38:18kind of figured out how to do in the longer term, this works just fine on a home network.
- 38:23You provide your SSID and password and just a secret stop UI file, but it doesn't really work
- 38:29well with captive portals, you know? So if you're at a conference or something and there's a lot of
- 38:34sign-in steps, having quite kind of thought that through soon, you do kind of have to, you know,
- 38:38tether your phone or something else. But yeah, all the graphics are kind of lower level. So
- 38:43the backgrounds that you see there, they're all, I believe, 16-bit bitmaps.
- 38:48Yeah. And you have a video of this that people can look at. So we'll put that in the share notes
- 38:52that people can check it out and watch it going and see what it's like. So that'd be cool.
- 38:56I'll try to share the repo and then a blog post of kind of explaining all of the, all of the code
- 39:01ready by the time.
- 39:03Yeah, sure. That would be great. So there's some interesting challenges to programming this,
- 39:07right? It's not just like, you know, playing with the terminal or even with like PyGamer or Kivy,
- 39:12where you program in some high-end graphics thing like OpenGL or something like that. Like,
- 39:19there's not like a graphics card in the traditional sense, right? Like, so even getting text on the
- 39:25screen is a little, it requires not hacks, but it requires like funky techniques, right?
- 39:29Yeah. You have to port whatever font you want to use into a bitmap font. Yeah. So just kind of a lot
- 39:34of downscaling. I don't remember how much room is on this, but it's enough to kind of get you going
- 39:39for most basic projects, but you can't, you know, drop a uncompressed video on here or something like
- 39:44that. You know, you'll run out of room. Sure, sure. And you have to do interesting optimizations
- 39:48potentially. Like if you're going to animate the, say the numbers, right? Maybe you have to like pre
- 39:53pre-allocate all the font representations for 0, 1, 2, 3 and things like this, right?
- 39:59Yeah. You can kind of optimize by saying, you know, which characters are you going to be using
- 40:04in the course of your program? Load those from the font. Yeah. So you have to think about some things
- 40:09when you work on these super small devices that maybe we might just overlook, right?
- 40:13That's pretty cool. But yeah, it's, it looks great and we'll put the video of it up. It's,
- 40:17it's going to be fun. So maybe we could, you have a whole bunch of hardware, big, small screens,
- 40:24no screens, lights, no lights hanging around here. Maybe we could just talk through some of
- 40:28these devices and some of the cool little projects or things you might be doing with them.
- 40:31Yeah. I can kind of start from smallest and work my way up. So this here is a Trinket M0.
- 40:39Yeah. So this is maybe a quarter inch by one inch, something like that. So two centimeters by like
- 40:46one, maybe. Teeny tiny. Yeah. Very tiny. Kind of, you know, about the size of a, of a U.S. quarter
- 40:52and pretty basic as well. And, you know, to be fair, I do have a lot of Adafruit devices here.
- 40:57I'm a fan. Yeah. But there are other devices out there that do run Python or, you know,
- 41:03MicroPython or even CircuitPython. But I will kind of talk through what I have in front of me and,
- 41:08you know, what I use for my projects. So this is kind of nice because it does have a micro USB
- 41:15for programming. Yeah. It's really nice that it just plugs into like, Hey, I have a Kindle,
- 41:19so I'm just going to grab that or whatever. I just use that cord or I have a certain type of
- 41:23Android phone. Maybe it just takes that. So there's just like a, you know, a handful of small
- 41:27or a handful of inputs and outputs here and then, you know, mounting holes. So if you're really kind
- 41:33of tight for space, this is a good option. That's super small. Yeah. It doesn't have a port,
- 41:37you know, that JST port for something like a light poly battery or, you know, different kind of battery
- 41:43closures like the CircuitPlayground Express has, right? And that kind of plugs in there.
- 41:47So this is a micro USB only. And then this right here is the Gemma.
- 41:53Okay. The Gemma is really like a quarter or something like that or so. Yeah.
- 41:57This is what was included in the PyCon swag bags last year.
- 42:01Right. The 2018 one.
- 42:02So this was like the dip your toe in the water of the IoT before the CircuitPlayground one.
- 42:08Or programming hardware because this also doesn't have any internet connectivity on it.
- 42:13Okay.
- 42:13The nice thing about this form factor is it's great for
- 42:16Sobel electronics and wearables, right? Okay.
- 42:18So it's got these big pads on the sides that you can use to
- 42:21run conductive thread through or conductive paint, right?
- 42:26This thing is super tiny. It's like really about the size of a quarter. It may be thinner
- 42:30than a quarter except for it's got his little power thing bumping up there.
- 42:33Right.
- 42:34You could probably make some really cool Halloween costumes or something for, you know, like a parade.
- 42:39Yeah.
- 42:39Or if you're giving a talk, right? Like you've been known to have some pretty cool devices that like
- 42:44you've like secretly worn into the conference talks when you're giving them, right?
- 42:49I used Gemma MZero's for my Python powered earring.
- 42:52Yeah. That's awesome.
- 42:53That I'm holding right here. I will turn them on. They're bright because,
- 42:56you know, they're meant for being worn on like a conference stage so that folks can see me in the back.
- 43:02For sure.
- 43:02But these are really, really fun.
- 43:04So they're like big ring. It's a big ring of LEDs that are animated. And then like an inner little
- 43:09light thing as well. And then this little tiny circular board that we just talked about is back
- 43:13there with a battery stuck to it. Yeah.
- 43:15Doing all the magic to make it actually happen, right?
- 43:17I did have to do quite a bit of soldering, you know, to get everything to work here. There's
- 43:22three layers of LED rings. So the kind of these, you know, individual neopixel rings.
- 43:29And you'll see that each one of these has pads on the back here, a data in, data out,
- 43:34a ground and a power.
- 43:36And did you have to solder these?
- 43:37Yes.
- 43:38Okay.
- 43:38You can see they're kind of small and unwieldy. So, you know, it was a fun little project,
- 43:42but something a little bit more complicated than, you know, a Circuit Playground Express,
- 43:46for example.
- 43:46It requires actual hardware aspects of like building hardware a little bit, right? Like you've got to
- 43:53connect stuff and whatnot rather than just like pure programming to the thing.
- 43:56Just some soldering skills. This project was based on a guide by a really cool maker. Her
- 44:01name is Becky Stern.
- 44:02Okay.
- 44:03And so her, her original idea was, you know, having this Gemma with kind of one LED ring. And I wanted
- 44:10to have more LEDs, you know, cause always just, I just always want to have more LEDs. So I added
- 44:16more in there and then wrote my own custom Python code.
- 44:19Yeah. That's really cool. You know, another one that you were showing me that I thought is pretty
- 44:23cool was with the Pi badge. So with the Pi badge, I have to describe a little bit. It's,
- 44:28it's got a little screen. The screen is maybe one and a half by one inches, maybe a tiny bit larger
- 44:33than that. And it's meant, it does have buttons and stuff, but it's meant to be worn as an actual
- 44:39badge at a conference, right?
- 44:40Yeah.
- 44:41Like instead of like just the printed one or whatever.
- 44:43Yeah. It's what I'm wearing in my Twitter profile picture.
- 44:46Okay. Really cool. And so you've, you obviously have the screen to put like your name.
- 44:51Hello, my name is Michael or Nina, whatever you want to put there, but you could also do other
- 44:56stuff. And you know, at PyCon, we have this like certain color of badge means I'm willing to be
- 45:03in photos or I'm not willing to be in photos. There's a couple of other things you can get like
- 45:07sticker, like stickers, little like, cloth ribbons that go under and that indicate a few
- 45:12things. But you had this really cool idea of, of taking a Neo pixel lanyard, the actual like
- 45:20rope thing that this hangs on and lighting that up based on how you're feeling now or how you want
- 45:26interactions right now, rather than blanket. I don't want pictures or blanket. I want to talk
- 45:31to people or I don't, but you know, like right now I'm busy, please don't talk to me or our,
- 45:35Hey, I'd love to talk to you. Come on over. Right. So tell people about this project. This is cool.
- 45:39So the nice thing about this pie badge, it does have, you know, kind of mounting holes,
- 45:43but then you can also use them for just a clip. Right. Right. So you can easily wear it around
- 45:47your neck. And my coworker, Tommy, I hope I pronounce his last name right. Tommy Falgao. He
- 45:54did this really cool build of a Lego badge holder with kind of this Arduino based LED badge lanyard.
- 46:02It just looks awesome. I'll send you a link on Twitter for you to share with your listeners.
- 46:07And I saw it and, he kind of did some IOT stuff and he wants to make it internet connected,
- 46:13but you know, the pie badge is not internet connected. And so I thought, you know, how can I
- 46:18make this fun and useful just as a wearable? And I think I would label myself as an expovert,
- 46:26you know, at conferences. Yeah. Describe that to us. I think a lot of people who know me casually
- 46:32would find it hard to believe that I'm very introverted. And so I do like meeting people.
- 46:37I love talking to people, but at some point I need to kind of just, you know, run away and recharge and
- 46:43have, have quiet time. Or I slowly kind of get crankier and crankier. You know, I've seen you at
- 46:48conferences and it's like, there's always a crowd of people talking to you. So it's wonderful, but it also
- 46:54is draining, right? Like, I mean, when I go to PyCon by the third day, I literally have lost my voice
- 47:01because while I love talking to people, I just, at some point, like my body breaks down and just says,
- 47:06no, you're not taking any more of this, right? It's so cool. I love that people want to come
- 47:11and chat with me and I never want to be rude or turn someone away. So there's always this conflict of,
- 47:16you know, I need to do some self-care, right? Right. Or just, I got to be ready for a meeting
- 47:21or presentation in 15 minutes, right? Like I was at the booth at PyCon getting ready to do a live
- 47:27presentation. So I was sitting, sitting kind of next to this little, pop-up stage in the expo
- 47:33area. And I was like, literally trying to get the demos ready. And someone's like, Oh, Michael, I'd love
- 47:38to meet you. Hey, I was going like, Hey, it's really great to meet you, but I really need like five
- 47:41minutes because we're, I think we were doing a live Python bytes recording. I'm like, I really have to
- 47:45figure out what we're talking about in five minutes. Right. So it was just times like that at
- 47:49conferences where it's like, you know, just, you would love to be able to like signal that.
- 47:53Yeah. Yeah. So I'm going to use the pie badge for that and a, an led strip. And there are,
- 47:59I don't want to say proprietary, they're not proprietary, but there are some kind of data
- 48:03out ports on here. They use a three pin 20 millimeter JST clip. So you just kind of have to
- 48:09find and buy the right one. Right. It's not like you just plug in micro USB or something, right?
- 48:13I have a few here. I saw Scott Shawcraft, the circuit Python maintainer. He, you know,
- 48:20works with Adafruit. I saw him in Seattle early last week and I was like, please bring me some of this,
- 48:26you know, odd looking adapter. So it kind of looks like the, you know, these, we'll talk about powering
- 48:32your projects a little bit later. It kind of looks like these LiPoly, you know, JST connectors.
- 48:36There's just one more pin. Right. These little white three pin connectors. Yeah. Uh-huh.
- 48:40So the battery just has two, you know, red and black, ground and power. This has three,
- 48:45cause there is a ground and power and also data. Okay. So you can just plug one of these right into
- 48:50the Pi badge. And then I'm going to do a little bit of light soldering and just solder my led strip to
- 48:56the end of this, which, which means, you know, I can easily disconnect it. There's not a lot of
- 49:01wiring or anything like that. And that's just going to run through a lanyard clip. Yeah. And then this
- 49:05connects to the NeoPixels. Yeah. That's going to connect to the NeoPixels. And so I'm going to be able
- 49:09to kind of adjust and say, you know, instead of, do I want my photo taken or not? It's like,
- 49:14well, maybe if my badge lanyard is red, I can also, you know, update the message on the Pi badge here
- 49:20saying like, now's really not a good time to talk. You know, maybe yellow is like only if you really
- 49:26need to. And then if my lanyard green come up and chat, I'm happy to. Right. Or it's rainbow colors
- 49:33and blinking or just something obvious. And I think that's, yeah, that's super cool. So the
- 49:37lanyard basically is like a ring or like a strip of like super bright LEDs. Right. So like not just the
- 49:45little badge will light up, like your whole lanyard will like actually have colors and communication.
- 49:50That's cool. I'm so grateful for to Tommy for this idea. And he's actually going to be productizing
- 49:57his version of the LED lanyard badges so that you'll be able to just go and buy a kit from him.
- 50:04Yeah. Cool.
- 50:05Yeah. I think so as well. I'll probably be documenting my build on this and trying to,
- 50:10I'm so bad about, you know, I like getting in the zone and building these things. And I'm really bad
- 50:15about stopping to take pictures and then document. Right. Right. Because along the way,
- 50:20you almost got to rebuild it a second time. Yeah. And just document it the second time through.
- 50:24But I will share a link with his tweet and his product. I think it's going to make conferences a
- 50:29lot more fun. But these are just the same kind of individually addressable LEDs that are on the
- 50:36surface of the Circuit Playground Express. They're just kind of in a strip form.
- 50:40Yeah. Yeah. This looks super cool.
- 50:42And this project is going to involve a little bit of sewing so that I can get my badge clip on there.
- 50:46I love it. I would love to see it. I mean, it's going to be a little bit tricky
- 50:50just in terms of like getting conferences to offer it as, because it'll cost some money, right?
- 50:56Yeah.
- 50:56It won't be as cheap as just the paper, but if they could do it, it would be so cool, right?
- 51:00Yeah. I would love to see that at some point in the future.
- 51:02I mean, they did give them out in the swag bags, the Playground Circuit Expresses.
- 51:07Yeah.
- 51:07Circuit Playground Express. It could just be, well, it's not in your bag. It is your lanyard.
- 51:13Yeah.
- 51:13Right. And it has a little screen. So it's not really that big of a stretch, I guess,
- 51:17on that regard.
- 51:18No. The current iteration, you know, it is a little fragile. So you have to treat it carefully.
- 51:24Right. Or, you know, these strips, especially ones that don't have any casing on them, they're pretty
- 51:29bendy here. And so if you break, you'll see in between each strip, there's, you know, the powered
- 51:34data on the ground. So if this breaks or disconnects, then you lose, you know, you lose connectivity
- 51:40to the rest of the strip.
- 51:41It's like Christmas lights.
- 51:42Yeah.
- 51:42Yeah.
- 51:43Kind of.
- 51:44It's also, you know, I haven't, I've been thinking through some ways of wearing it,
- 51:48but I haven't figured out a way to make the length adjustable, you know, without damaging
- 51:52the components inside. So.
- 51:53So there are some challenges and maybe, and maybe it's not all strip, right? Maybe there's
- 51:58just like two parts that light up or something. And then there's like just a gap. I'm sure
- 52:02you'll figure it out.
- 52:03Yeah, that could work. That's always kind of the fun thing about, you know, the prototype
- 52:06or the first build is like, how do all the pieces fit together? You know, despite your
- 52:11best intentions, things don't always fit or look or work the way that you expect them to
- 52:16or would like them to.
- 52:17It's a really cool idea. And it's, it's one of these sort of practical things and it definitely
- 52:21fits in with the style of stuff that you're doing. So I think it'd be cool. So I guess,
- 52:25you know, we have the bag stuffing volunteers at the conference. Now there'll be the lanyard
- 52:31building and programming thing that's the day before, right?
- 52:34I bet those volunteers are not too thrilled by that idea.
- 52:38No, that's gotta be a lot of work, right?
- 52:39Mm-hmm. Yeah.
- 52:40Cool. All right. Well, you got a few other things. You want to just quickly maybe tell
- 52:43us about those?
- 52:44So we talked about the Circuit Playground Express. I think the only thing I haven't shown you
- 52:48so far is this.
- 52:49So this one you got from this recent conference, you were just at the teardown.
- 52:53I built this at a soldering workshop. And so this is a custom board. It's designed by Thomas
- 53:01Hudson. He's local to Portland. He works for OMSI. So he does kind of a lot of electrical
- 53:07work for them.
- 53:07OMSI is a really cool like industrial and science museum here in town.
- 53:12I'll share a link to his GitHub here. It's actually on the back of the board.
- 53:16Oh, how cool. The GitHub is on the board. I love it. Yeah, yeah, yeah. That's really cool.
- 53:20And this comes from, it has a crowd supply on it. And I don't know much about crowd supply,
- 53:25although I've just recently seen a few things here. And it seems like there's a ton of this
- 53:29kind of stuff available. What is that place? Do you know?
- 53:32It's kind of like a Kickstarter, but for hardware projects.
- 53:34Yeah, Kickstarter is specifically focused on these types of things. There's some really
- 53:39cool stuff there. Okay. So.
- 53:40I believe crowd supply sponsored this workshop, which is what allowed us to walk away with these
- 53:46boards.
- 53:46Sure.
- 53:47So we just kind of started out with the boards here and then all of the components, you
- 53:51know, I hand soldered on in this workshop, which was pretty fun. But this is based on the
- 53:56NRF 52840 reference board.
- 54:00So this is something that Thomas designed and it has Bluetooth connectivity on here.
- 54:06A couple of LEDs, a couple of buttons.
- 54:07A few buttons. And he put a bunch of kind of examples on online on his GitHub as well. So
- 54:14this is going to be kind of an interesting reference board. And, you know, it shows you that if you
- 54:18have the skills and the knowledge, you can build your own devices that run CircuitPython.
- 54:23That's really cool. So there's probably a whole ecosystem instead of tooling around actually
- 54:28designing the boards. Like if you want to have a board created, right?
- 54:32This is not in my realm yet. It is something I'd like to learn this year.
- 54:36It's super cool. It may never be in my realm, but I admire it. I share it's really cool.
- 54:41One thing I do want to come back to before we run out of time though, is we talked about the
- 54:47serial stuff with print, the mu editor, but there was another tip that you gave about actually getting
- 54:52a REPL for the Python running on, on these embedded devices. So, I tell people real quick about that.
- 55:00I think mu is a great project. I personally don't use it. I tend to write all my code in VS Code. I
- 55:07really like the Python extension day to day. So I'll just have a side by side terminal open there. I'll
- 55:13use screen to connect to the serial console.
- 55:15And then you can get the print statements there instead of using mu.
- 55:18You can see the print statements there. And then if you press, I don't remember if it's control C or
- 55:22control D, there's a nice kind of helpful hint when you start your REPL. If you hit one of those
- 55:28keyboard combinations in your serial console, you'll just get kicked into a REPL that's running on this
- 55:34device.
- 55:34Yeah, that's really cool. So you kind of cancel out of it and it just drops you into the REPL a little bit.
- 55:38Yeah.
- 55:38And you can kind of run stuff to stuff out. The nice thing about the PI portal or the PI badge that has
- 55:44the screen on there is your REPL will be displayed on the screen.
- 55:47That's super cool. I love it.
- 55:49I can show you a little demo of that. But Scott, who I've mentioned a few times, he has one of those
- 55:54IBM. I don't remember the model, but you know, those like really clacky old school IBM keyboards.
- 55:59Yeah, the mechanical ones. Yeah, they're probably beige.
- 56:02It's very, it's the beigest. So he has one of these PI portals just stuck onto a keyboard and you can
- 56:09like type in the REPL on this really old school IBM keyboard.
- 56:12Wow, that's crazy. It probably just has serial input or something straight into it, whatever the
- 56:16keyboard does.
- 56:17He brought that whole contraption to PI Cascades.
- 56:19Okay. Yeah. How cool. That's awesome. And you also had some advice on how to exit out of screen.
- 56:26There's a funny joke. I feel like some of these things are a little tricky. Like,
- 56:30so if you want to generate a random string, obviously there's ways to do Python. But another
- 56:35way is to put a first year computer science student in front of them and ask them to quit,
- 56:40save and exit. Right. I feel like screens a little bit like that. Like there's a series of combinations.
- 56:45You got to hit just right and it'll like let you out of it and stuff like that.
- 56:48The important thing about screen is you have to press control A, which is kind of the leader key. And
- 56:53then to quit, you press K. K for kill.
- 56:56Cool. So let's touch on a couple other things really quick. So we talked all about CircuitPython
- 57:00and programming in Python and people like Python, but maybe they're using this in an educational context or with younger kids or just people who are not programmers yet. So there's also a thing called Microsoft MakeCode. That's pretty cool. You want to tell people about that?
- 57:15The nice thing about MakeCode is there's just this online based emulator. So you don't even have to have access to a device.
- 57:24Actually, that's maybe the coolest part of it, right? Is that, yeah, it comes with a Circuit Playground Express emulator. So you can play around a little bit and decide if is this for me? Is this interesting? Then you get the, then you order the $25 little thing.
- 57:38It's a kind of a block based editor, you know, like a scratch like editor. So really good for kids, really good for conceptualizing. They've done a lot of really interesting partnerships with Cartoon Network, for example. So there's a lot of, you know, Steven Universe is a really cute cartoon, not just for kids. Personally, I love it. I watch the whole series. And so there's a lot of Steven Universe projects that you can build on MakeCode. And then the code that you generate, it's portable. So if you do have a device, you can run it on there. If you don't, you can run it in the emulator.
- 58:08You can also export it as JavaScript. Okay. And in the future, JavaScript, huh? Maybe even Python. Maybe. That'd be awesome. Okay. No commitment there, but maybe. That'd be awesome. Yeah. I do think it's really awesome that it comes with an emulator. Can you get like CircuitPython running on the emulator? Do you know? Like if you don't have a device and all the stuff we talked about, could you make that happen on the emulator that comes with MakeCode? I don't believe so. Okay.
- 58:38Maybe someday. But yeah, if it outputs Python, that's kind of good enough. Eventually, if it ever does, right?
- 58:43There is a group of interns working in Vancouver for the Microsoft Garage program that are doing some really interesting things with CircuitPython and VS Code.
- 58:53That sounds really fun. What is Microsoft Garage?
- 58:55It's kind of like a hack space, right?
- 58:58Right. Like a maker space type of thing.
- 59:00Maker space, yeah.
- 59:01Okay.
- 59:01So they have access to, you know, electronics and devices and, you know, kind of the stuff that you would find in a typical maker space.
- 59:09And they're particularly focusing on the Circuit Playground Express. So I'm really interested in seeing their project.
- 59:15Oh, that's super cool. Super cool.
- 59:17So I get the sense from sitting here with you with all these cool things like, oh, I got one of these and I tried this here and I got this cable and, oh, have you seen this LED strip? How much fun this is.
- 59:25But also how it would be much better to have that experience with other people who have these things. If you want to get into it, it probably makes a lot of sense to go to like meetups or maker spaces or other things like that where people are doing these kinds of things.
- 59:39What advice do you have for people to like find other people doing this?
- 59:42Yeah. So meetup is a great resource. If I lived in Seattle, I'd be going to Hardware Happy Hour.
- 59:48Okay.
- 59:49Scott comes with some of his projects that Wearables Maker I was telling you about from Teardown, Sophie Wong. She attends as well. That seems like an incredible community. Just at Teardown for the first time, I went to Control H makerspace here in Portland.
- 1:00:03I haven't been to that one.
- 1:00:05Just the friendliest group of folks, you know, really nice space. They have cool hardware. You can talk about joining, but, you know, meetup, local makerspaces. I think they're both fantastic avenues for getting in touch with some folks.
- 1:00:19Who not only have these devices, but are open and willing to share. The lucky thing is, you know, if you live somewhere remote, you really don't need these resources. The guides online, you know, there are tons of YouTube videos.
- 1:00:31Yeah, the YouTube videos. I suspect YouTube is pretty good.
- 1:00:33I keep meaning to make my own. So maybe one of these days that'll happen. But, you know, I do kind of have a lot of devices and a lot of toys, but I didn't, you know, go out and buy these things all at once. Kind of worked my way up to it.
- 1:00:46Yeah, that makes a lot of sense to start that way. I guess you could always, if you live in a place that doesn't have a meetup port, you could start your own, right? Like meetup.com is free and easy to use. Or even just create a virtual one, right? Like there's some virtual meetups, you know, that'd be pretty cool as well.
- 1:01:00So yeah, it just seems like this is the kind of stuff that's more fun when shared. You kind of discover like, oh, you use that kind of nectar and you use it this way. That's really cool. I'm going to try that, right?
- 1:01:10I think so as well. Adafruit has an online show and tell that's remote, you know, live stream sort of thing. So I haven't joined yet, but I keep meaning to.
- 1:01:18Yeah, yeah. That sounds like a real fun one. All right. I guess we should wrap things up with a hashtag.
- 1:01:23My coworker, Lena Hall, she's in the big data space. She gave me this idea for my PyCon US keynote. She told me to find a hashtag that hadn't been used yet.
- 1:01:33You found a good one.
- 1:01:34I found a good one. So it's hashtag Python hardware. So if you are interested in what the Python community is doing with hardware, if you want to share your own projects, if you want to talk about people that you're learning from or people that you're teaching, check out Python hardware on Twitter.
- 1:01:52I've seen some activity after Python. So we had a flurry of posts and it did kind of drop down a little bit, but I really want to keep the hashtag going.
- 1:02:00Yeah, let's keep it alive. And we'll obviously podcast listeners out there can use it and share little videos, pictures of what they're working on, their projects or GitHub, whatever, right? Like that'd be great to like bring that together.
- 1:02:11Please do. Whenever I'm having a bad day, I'll go and look at that hashtag and be like, how can I be frowning right now when, you know, there are all these excited people doing these cool things with Python.
- 1:02:21Inspired from your talk, right?
- 1:02:22Oh, not just your talk, but now I'm blushing.
- 1:02:25No, it was a good talk. And I actually linked to your Python keynote as well. It has a lot of pictures of what you're talking about here.
- 1:02:31I'll try to post some pictures as well that will link to some of the show notes around it. But yeah, you know, this is really fun. Thanks for sharing all the stuff that you've been up to.
- 1:02:40Yeah, thanks for having me.
- 1:02:41You bet. Now, before you get to go, two quick questions. I kind of know the answer to this first one after watching work. But if you're gonna write some code, what editor do you use?
- 1:02:49I'm a fan of VS Code, especially for this workflow in particular. Something that, you know, folks don't know is these devices are, they are trustworthy, but you don't want to have the only copy of your code loaded on here.
- 1:03:02So you do want to have a copy locally, you know, preferably version controlled and get or in GitHub. And so the nice thing about using VS Code for this type of programming is I'll have a workspace, right?
- 1:03:14So one of my workspace folders, to back up a little bit, a workspace kind of allows you to organize different folders, just kind of in one common area and work across them as well.
- 1:03:25Right, even if they're not within the same parent or something.
- 1:03:28Yes, yeah. Which is really great. So I'll have my, you know, CircuitPython folder, which is nice if the device is plugged in in there. But I'll also have my local folder in that same workspace. And that's the one that's version controlled and everything.
- 1:03:41And if you have multiple devices plugged in at once, that's also very nice. My original editor that I loved was Emacs. And so I use VS Code with Emacs key bindings.
- 1:03:52All right. Yeah, that sounds really good. And you just copy the file over to code.py whenever you want to run that code. That's great. And then notable PyPI package or other library, I guess you can use in this case, like stuff that's cool that helps you, you know, maybe do some CircuitPython.
- 1:04:07There's no PyPI package that I'm thinking of. But one of the awesome Adafruit employees, her name is Katni. She writes a lot of guides. So she wrote a lot of the code and reference material that was on your Circuit Playground Express at PyCon.
- 1:04:23So I would say check out her repositories for just really good ideas for how to get started with a lot of these things. And then the next is kind of a call to action for Brian Oken, because he was having a chat with Scott about the future of testing on CircuitPython. So maybe, maybe...
- 1:04:42pytest extension, maybe, Brian.
- 1:04:44Maybe, yeah.
- 1:04:45Yeah, the gauntlet's been thrown down. So now he's got to do it.
- 1:04:47Yes, Brian. Please do.
- 1:04:49Perfect. All right. So people want to get involved in CircuitPython and Embedded Python, all this stuff. Where should they go? What should they do? Like, what should you leave them with?
- 1:04:58Yeah, so CircuitPython.org is a great resource for kind of downloading stuff, getting started. GitHub.com slash Adafruit slash CircuitPython for the repo. There's also a Discord that's full of really friendly folks. And the community, just like with Python, is what makes this really, really special. So get involved if you can.
- 1:05:19Awesome. Well, thanks again, Nina. It was great to talk to you.
- 1:05:21Thanks for having me on the show.
- 1:05:22You bet. Bye.
- 1:05:23This has been another episode of Talk Python To Me. Our guest on this episode was Nina Zakarenko, and it's been brought to you by Ting and Rollbar.
- 1:05:31Ting is the fast, mobile network, custom-built for technical folks. Use their savings calculator to see exactly what you'd pay. Visit python.ting.com to get a $25 credit and get started without a contract.
- 1:05:44Rollbar takes the pain out of errors. They give you the context and insight you need to quickly locate and fix errors that might have gone unnoticed until users complain.
- 1:05:53Of course. Track a ridiculous number of errors for free as Talk Python To Me listeners at talkpython.fm/Rollbar.
- 1:06:00Want to level up your Python? If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 1:06:07Or, if you're looking for something more advanced, check out our new Async course that digs into all the different types of Async programming you can do in Python.
- 1:06:15And, of course, if you're interested in more than one of these, be sure to check out our Everything Bundle. It's like a subscription that never expires.
- 1:06:23Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top.
- 1:06:28You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
- 1:06:37This is your host, Michael Kennedy. Thanks so much for listening. I really appreciate it.
- 1:06:42Now get out there and write some Python code.
- 1:06:43We'll see you next time.