Python is one of the primary languages for IoT devices.
With runtimes such as CircuitPython and MicroPython,
they're ideal for really small IoT chips.
Maybe you've heard of the Circuit Playground Express,
BBC Microbit, or the fancy Adafruit Clue.
They aren't too expensive, ranging from $25 to $50 each.
But for large groups such as classrooms,
this can still be a lot of money.
Moreover, getting your hands on these devices
can sometimes be tricky as well,
as they often go out of stock.
With an extension for VS Code called Device Simulator Express,
you can have instant access to all three.
Virtually, of course.
This cool extension adds a visual emulator,
as well as the native interactions,
such as buttons and temperature sensors.
Get your IoT on without a real device using VS Code today.
Let's meet the most recent team behind this project.
Andrea Ma, Syed Amusa, Vandy Lee, and Kevin Nguyen.
This is Talk Python to Me, episode 272,
recorded July 2nd, 2020.
Welcome to Talk Python to Me,
a weekly podcast on Python,
the language, the libraries, the ecosystem,
and the personalities.
This is your host, Michael Kennedy.
Follow me on Twitter, where I'm @mkennedy.
Keep up with the show and listen to past episodes
at talkpython.fm,
and follow the show on Twitter via at Talk Python.
This episode is brought to you by Linode and Talk Python Training.
Be sure to check out what the offers are for both of these segments.
It really helps support the show.
Speaking of Talk Python Training,
have you been thinking about taking one of our courses?
We're participating in the latest Humble Bundle deal
for Python developers,
along with a bunch of other great educators and tool developers.
Until July 22nd,
you can get $1,400 worth of Python goodies,
including three of our popular courses,
for just $25.
Yeah, Humble Bundles are crazy.
That's $25 for our three courses
and all those other things combined.
Just visit talkpython.fm/humble2020.
That's talkpython.fm/humble2020 altogether,
before July 22nd,
to take advantage of this offer.
Now, let's get to that interview.
Hi, Saida, Andrea, Kevin, Vandy.
Welcome all to Talk Python to Me.
Thanks for having us.
Thank you for having us.
Yeah, it's great to have you all here.
It's going to be fun with five people in this conversation.
And we got a really cool topic to talk about.
MicroPython and CirclePython is really big these days.
And I think it's opening up a new realm of programming.
And what you all have done
and the project you're working on
is going to be really excellent
for helping people around the world
take better advantage of that, I think.
Awesome.
Yeah.
We were hoping to kind of make learning Python
and learning IoT a lot more accessible
and available to people around the world.
So yeah, we'll get more into that a bit later.
Yeah, absolutely.
I mean, getting hold of these devices,
they're not very expensive,
but they can be hard to get a hold of.
And if you're talking about a classroom
with 100 kids,
then all of a sudden it is expensive, right?
Or a school with different classes and so on.
But before we get to all that,
which is going to be really fun to talk about,
let's just do quick introductions around here.
Andrea, do you want to start first?
Yeah.
So of course, my name is Andrea.
I'm currently a student
at the University of British Columbia.
I'm studying computer engineering.
I'm originally from the Canadian prairies.
I'm from Saskatchewan,
but I came here for school.
And yeah, right now I'm still an intern at Microsoft,
interning with the Coalition,
which makes Gears of War.
And yeah, I guess I'm currently just interning
at different places to kind of get a grasp
of what I want to do in the future.
Well, those sound like some really fun areas
to get some experience in, actually.
Yeah, it's really fun
to just kind of get different perspectives.
I mean, every time I go to a new internship,
it's just like a whole bunch of new stuff.
And I learn a lot, which is awesome.
Awesome.
Yeah.
So, how about you?
Yeah.
So, my name is Zayda.
I'm an undergraduate student at SFU.
I'm studying data science right now.
And I was a PM intern at Microsoft last semester.
Yeah.
And mostly my coursework revolves around data analysis
and data science, business.
And I have a little bit of background in design as well.
So, yeah.
I think after my internship at Microsoft,
my passion for PM has increased.
And hopefully, my full-time career
will be in that as well.
Yeah.
It's cool.
Yeah.
It sounds like you're studying a lot of neat technical areas as well.
Yeah.
Vandy, how about you?
Hey, I'm Vandy.
I'm a third-year computer science student
at the University of British Columbia.
And currently, after finishing the Microsoft Garage internship,
I'm interning at Splunk on the machine learning team right now.
Oh, yeah.
Cool.
Checking out, getting into all the logs and all that good stuff.
Yeah.
Right on.
Kevin, how about you?
Hi, everyone.
My name is Kevin.
I'm from Montreal.
And I'm studying at Pre-Technic Montreal.
So, just like the others, I'm interning at various places like Microsoft.
I'm currently interning at AWS, working on cloud technologies,
which I find very interesting.
And, yeah, pretty much it.
I love software engineering.
That's why I got into the field.
And I'm very excited today to share about one of our most fascinating projects.
It's super fascinating.
But before we go to that, so you did this internship at Microsoft
and you're doing an internship at AWS?
Yeah.
Well, I'm not at the same time.
Like, I'm doing one.
No, no, no.
I know.
One and then the other.
But that's still, like, I was just going to say,
that's a really cool experience to have before you've even graduated.
That's a lot of background you're picking up there.
It definitely is.
Like, I'm currently in quite a lot of both places.
Yeah.
I mean, they're both very different.
But, right, those are two of the tech giants.
So, quite cool.
Now, you'd mentioned, several of you, the garage projects at Microsoft.
And I know you all had this intern relationship with Microsoft.
And who knows, maybe you'll go back and work there as well afterwards.
But just what is this garage thing?
I've never heard of this.
So, oh, sorry.
Go ahead, Asia.
Go ahead.
Oh, okay.
Yeah.
So, the garage program is pretty much.
So, unlike a regular internship where you jump into an existing project,
a garage internship encourages the interns to group up and start and finish a project.
In our case, we continued on existing garage project.
But it's just mostly focused on interns kind of leading their own projects.
I see.
So, instead of working on like, yeah, we're going to add that other button to Excel,
you guys get to create something new and original and see what direction you could take it, right?
Yeah.
I mean, the ideas itself are backed by sponsors.
So, in our case, our sponsor was the VS Code Python team.
So, the ideas aren't thought out by us, but like, we're given kind of the ideas and support from like,
people actually from Microsoft in the industry.
So, it really fosters kind of this startup mindset kind of.
But I feel like we're also given like, a lot of support from the coaches that they give us and just like,
overall, the people in garage.
Anyone else you want to add to it?
For me, looking at weighing down at the other internships I've seen, this one is more intensive.
You actually see the whole product lifecycle from start to finish.
There's a lot of, you know, uncertainty when we're actually dealing with what we should do next.
And I think the garage program gives us that liberty to make those decisions and kind of figure it out on our own.
If we have any questions, we can ask them.
But it gives us a lot of space to kind of think creatively and kind of collaborate as a team
and come up with the next steps of the project.
And again, we have their support if we're heading up in the wrong direction.
They're there to kind of push us back.
But the program is very unique.
It's not like where you jump into an existing major product and you just add one or two features.
You're working on multiple features at the same time, conducting a lot of user testing,
going back and forth with sponsors.
So, it's a lot of work.
It's very intensive, but we learn so much within that four-month span.
Yeah.
It's very, like, what makes Garage very unique and special is that it's very empowering.
Like, making decisions as interns, decisions that sometimes CEOs make that are, like, data-driven,
looking at the telemetry and making the right product decision.
That's really empowering.
That's what makes Garage completely unique.
And I don't think you can find anything like that in the whole world.
And sorry to add to that with the data as well.
Sometimes there is no data and we have to create our own data by creating surveys or talking to others in our customer base.
So, sometimes we have nothing to work with and we're put out there to, you know, figure it out,
which I think for us, all four pushed us and actually showed how capable we are working in this field
because we had no idea before this internship on how to do certain things.
And after this internship, we learned so much that I never imagined that I would learn.
Yeah.
Well, and, you know, it's also worth pointing out that the thing that you guys worked on, it is now out.
I can go over to Visual Studio Code and pull up the little marketplace and type device simulator and it's right there.
It's not just some theoretical project you get to work on or whatever, but you actually are working on something that is shipping to people and they're using and they're trying out.
Yeah.
And we were really lucky in that we were picking up an existing project that was already kind of live.
So, during our internship, we actually made updates to the extension and kind of got to see the user telemetry from that and kind of like user feedback.
And like if we made like a mistake, then we kind of like knew pretty much immediately.
So, I feel that like with other projects that weren't launched yet, they didn't really have that instant feedback, but we were able to get that, which is really cool.
Right.
If there was some kind of bug or whatever, you would know immediately because reports, right?
Yeah.
Yeah, exactly.
Yeah, that's both great and stressful.
You said like it's not like theory.
It's very like, you know, like it's shit.
And we really felt the truth of it once we got teachers and students contacting us through emails or GitHub when they wanted to fix bugs.
And like we felt that we had a real impact.
Yeah, absolutely.
So, let's really quickly before we talk about the device simulator, you know, a lot of people who have been listening to the show for a while, they know that I've had the folks come talk about CircuitPython.
I've had people come talk about MicroPython and whatnot.
But there's a lot of people who maybe didn't catch those episodes or they, you know, they're newer to the show.
One of you all just sort of tell people what CircuitPython is and how it's the same and different than, say, Python if I go to my Mac or Windows and type Python.
So, the CircuitPython library, it's a fork of the MicroPython library made by Adafruit so that it could work on like the Adafruit microcontrollers.
So, it's pretty much just like a version of the Python library that could just like work on those like microcontrollers.
But the way that we did things was a lot more just kind of writing like simulation libraries.
So, it didn't really work as low level as like they usually do when they make a microcontroller.
But, yeah, that's kind of like the gist of CircuitPython.
Yeah, it's incredibly, it runs on incredibly small devices.
Like one of the things we're going to talk about is the CircuitPython Express.
What's the name of that little circular?
CircuitPython Express.
That's right.
And so, that thing is like a $25 little device and it has buttons and it has lights and has all sorts of other stuff in addition to just the little chip on it.
So, CircuitPython runs on really small things, I guess is the point.
Yeah, like I think that it's like really cool how Adafruit has so many of these like microcontrollers where like all of these like LEDs, buttons, sensors are all built into it.
So, you don't need to like hook it up as you would with like an Arduino, for example.
So, like it gives new learners like a lot more to work with in terms of just like seeing how one thing interacts with another thing without really worrying about like, you know, damaging their products by hooking up things wrong, which is like something that was really daunting to me when I first learned microcontrollers.
So, yeah.
Yeah, yeah.
No soldering irons necessary to get started, for example.
Yeah.
This portion of Talk Python to Me is brought to you by Linode.
Whether you're working on a personal project or managing your enterprise's infrastructure, Linode has the pricing, support, and scale that you need to take your project to the next level.
With 11 data centers worldwide, including their newest data center in Sydney, Australia, enterprise-grade hardware, S3-compatible storage, and the next-generation network, Linode delivers the performance that you expect at a price that you don't.
Get started on Linode today with a $20 credit, and you get access to native SSD storage, a 40-gigabit network, industry-leading processors, their revamped cloud manager at cloud.linode.com, root access to your server, along with their newest API, and a Python CLI.
Just visit talkpython.fm/linode when creating a new Linode account, and you'll automatically get $20 credit for your next project.
Oh, and one last thing.
They're hiring.
Go to linode.com slash careers to find out more.
Let them know that we sent you.
Another thing I wanted to ask you all at the beginning, I get a lot of questions from folks, how to get into programming, how to get into Python, how to get maybe a first job or an internship.
Any of you guys have good advice?
Sounds like you've had pretty good success finding internships.
The first thing I would do is attend meetups or small little networking events that discuss any topic in technology.
It can be Python, it can be public speaking, it could be anything, just to get a means of being comfortable in the tech space.
It doesn't have to be super technical, but meeting like-minded people, I think once you get comfortable with that, then you can go to the next step and maybe start programming small little projects.
But I think the first thing is to meet people who are in the same field, like-minded people, and you can discuss certain passions and then go from there.
That's the first thing that I did, and it really helped.
And I actually went to the, I think it's called the networking night before the internship applications opened in September.
I'm not sure if you guys were there.
I didn't see Andrew or Vandy, but I was there at Microsoft, and it was basically talking about the Garage program.
And that's where I met so many people, and we talked about what school they came from, what projects they were working on,
kind of getting the gist of who's out there, you know?
So that's the first thing that I would do.
I definitely agree with what Sayida said.
My biggest advice would be to honestly get out there, get out there, meet people, program with them.
How I got into it is with a hackathon.
Even though I didn't know coding, people were ready to take me by the hand and teach me how to code and bring me onto their team.
And yeah, I think that's a good way to start.
Very cool.
And to add to that as well, I think two things that as interns we've learned, and I've actually carried that on today, like in my school years and when I graduated,
at Microsoft we learned to have a growth mindset and to fail fast.
And one advice I would give to students who are trying to break into technology or break into this field is to adapt those two mindsets.
It's okay if there's something that you're not aware of when you're in a hackathon or there's some kind of technical question you're not aware of how to solve.
It's okay.
Fail fast.
It's all good.
Figure it out and have that growth mindset and you'll learn from there.
Once you're comfortable with that uncertainty, you'll be able to progress and actually be more comfortable in the tech space.
So that's another advice I would give to people who are trying to break into this field.
Yeah, that's good advice.
Yeah, I'd like to add to that.
I think that the growth mindset and the fail fast mentality is really helpful.
Personally, whenever I'm helping someone with programming and they're all like, oh, I made this mistake and this mistake and this mistake.
I'm like, yeah, I made those mistakes too.
I made them a thousand times.
Whenever anyone's getting into programming, it's natural to totally not know what's happening and just to feel super lost.
But it's kind of like making those mistakes and just kind of taking that time to learn is really necessary.
And just being patient with yourself and just not being so hard on yourself when you make mistakes, I think, is a really important part.
Yeah.
Yeah, I agree.
I think that feeling of being lost or not knowing what to do when you're new, I think it feels like, oh, I don't belong here because I'm other people seem to know and I don't.
But as the more you get into it, just feeling kind of lost and unsure, like that's just part of the way it goes in technology.
And you just keep going.
Yeah.
Like it's pretty easy to kind of find yourself in that mindset where you feel like you're as caught up as everyone else, especially when everyone throws like throws around terms like ML and AI.
And it's like, oh, a database and like you don't even know anything about technology, then it feels like, oh, I'm not, I don't belong here.
But it really is just like a process to learn.
And it's like no one should ever really feel discouraged or ever feel like they're not the type to be in this field, you know?
Yeah.
Yeah, sure.
All right.
Let's talk about this idea, this project that you worked on.
You can go to Adafruit and you can buy some of these devices.
Is everything that you're simulating now, Vandy, is everything?
That you're simulating available in physical form from Adafruit or are there different places and different devices?
Everything you can simulate on the simulator is also doable on the actual hardware and device.
And we have three devices that you can play around with on our simulator.
We have the Adafruit Circuit Playground Express, the BBC Microbit, and then the Adafruit.
Okay, cool.
So the BBC Microbit and then the two from there.
And, you know, I had gone to Adafruit.
I was going to get some cool device for a project with a friend and we were going to build that.
And then, you know what?
This part was not available and this thing was back ordered.
And who knows when this other thing is going to be available.
And what I really like about what you guys have built is you can go from, hey, I want to try out this little IoT thing to I'm trying out that IoT thing almost instantly.
You don't have to wait for it to be in stock, for it to be shipped, for everyone to get one, right?
So tell everyone about the device simulator in VS Code.
What's the main idea?
What does it do?
Yeah, it's pretty funny that you say that.
Actually, when we were coding for the Clue, it was actually sold out as well.
And we had to contact Adafruit to get some devices from them because we couldn't buy them, actually.
And so the extension, what it does is it simulates the, like you write code that would normally work on the hardware, but you can run it in our VS Code extension and it will do the same thing as it would do in the hardware.
So if you say, like, turn the NeoPixel to the color green, you can run it in the simulator, which is directly like embedded into VS Code.
And then the simulators, the device on the simulator will also turn the NeoPixel to green.
And then you can even say you have a lot of fun with the simulator and you actually want to get a device.
And so like when they come back in stock and you buy one, you can also use our simulator to deploy your code to the device and see it work on both the simulator and the actual hardware.
Yeah, and I was really surprised when I first saw it because it looks really good.
Like you've got the code and CircuitPython, you have like code.py or main.py and it's just the one file to get everything started.
But then in a split pane, you have the Circuit Playground Express and it's like this big, nicely rendered, realistic looking replica.
And it's much bigger, right?
It might even be better to program on the simulator than the tiny little device because you've got it like big screen right next to your code.
It's beautiful.
We did a lot of user testing to make sure that the UI was applicable to all our customers.
And anytime we team up with an update, I would like schedule a user testing and we would ask them questions on how it's looking after they've done some programming.
And they'd give us some suggestions like, oh, hey, can you make the simulator bigger?
Like, can you adjust the size?
So far, that feature is not there yet, but we had in our backlog and we wanted to work on it.
But we made sure that we were advocating for what our users wanted to ensure that once the final product was pushed out, they would be happy with it.
So I'm glad you really liked the interface.
So it shows that we did it.
I was really surprised when I saw it come up because it looks exactly like the Circuit Playground Express.
It has the buttons.
You can click on it, you know, click on the picture and it's like you're clicking on the buttons.
It reminds me a little bit of like an iPhone or an Android dev experience where you've got an emulator there.
Like you run it and the thing is there and it looks more or less like what you're working with.
But like I said here, it's bigger and bolder and maybe even better than the real thing in some ways.
Just to add to that, like it's not only visually appealing, we kind of improved it to make it very practical as well.
That's why there's a lot of accessibility features that you could tab and switch between those buttons.
There's also keyboard shortcuts where you can click and you can see some direct feedback, direct lights happening on the UI.
Right, right.
So you've got that.
You can click under your mouse, but you can also assign keyboard shortcuts for like pressing the A button or the B button or both at the same time and things like that.
Yeah, it's quite nice.
Okay.
So maybe a nice way to help people understand sort of what the flow looks like here is maybe we could just talk through like a really simple getting started demo.
Like what are the steps of getting started?
Yeah.
First, you will obviously need VS Code, the code editor, and then you'll have to have Python installed as well.
And then you can go into the extensions part of VS Code and search for Device Simulator Express and then install it.
And then once you have it installed, there is a little page that like a readme that you can read through.
The gist of it is that to use the extension, you have to go through the command palette, which is through Ctrl-Shift-P on Windows and Apple-Shift-P.
Yeah, that's pretty common for Visual Studio Code, right?
So people who are familiar with that, they're used to just hitting Command-Shift-P or Ctrl-Shift-P or whatever it is, right?
And so basically it plugs into that same infrastructure, right?
You pull up the command palette and there's like not quite a wizard, but there's like an onboarding flow.
Yeah.
And then so usually what I tell people is to check out the Getting Started page, which is like a little web page that we packed in there.
And it tells you you can select the device you want to use.
And it has like little code snippets that you can copy and paste into the simulator to like test things out.
And then once you want to really get started, there's like a new file command that'll load up a like a very short template.
And it'll open up the simulator for the device you want on the right side.
And then you can at the top, there's like a comment with like, like usually a web page where you can click to also see more code snippets, which you can copy and paste as well.
And then like once you have some code, you can, there's a big green play button on the right side under the simulator and you press it.
And then your code starts to run on the simulator depending on what your code says.
And then we also have under the simulator, there's like a toolbar and it has a bunch of icons and some, and they usually describe what it says.
Like there's a temperature sensor.
So you can adjust the slider to simulate different temperatures in case like your code says, if the temperature is less than 25 degrees Celsius, like change the NeoPixel to green.
Yeah. Turn blue or something or red if it's above it or something like that.
Right.
Exactly.
Or like change the text even.
Yeah. Cause some things are easy, like push the button, but change the temperature.
How do you do that?
Right. So you've got like a little slider.
Yeah. So all these inputs and stuff, they're available on that right-hand side.
So you just write the code.
Like if you know how to write for any of the CircuitPython stuff, it's just that, right?
Yeah. And it's pretty neat.
Cause like, imagine you're writing code for the actual device and you want to know if it works.
Let's say like you want the micro bit to say something when it's over 30 degrees Celsius.
But so what are you going to, are you going to like take the micro bit and then microwave it or something?
It's a, in case it's a winter day, you know?
Yeah.
Yeah, exactly.
Yeah.
Super cool.
Andrea, where are some of the other sensors that you have in the Circuit Playground Express there or some of the other devices even?
Well, I'll talk about the other devices first.
So the devices that we added were like the micro bit, the BBC micro bit, and also the Adafruit clue.
So initially our garage project was to work on like the micro bit for the entire term, but we were able to get that done quickly.
So we were able to just take on the clue, which is a bit more daunting because it, I'm not sure if everyone knows, but the clue is pretty much just like a micro bit, but it has like a 24 pixel by, I was sorry, 240 pixel by 240 pixel screen.
And it can have like slideshows, it can draw shapes, and it's just like, it's really cool.
But at the same time, it's like, oh, how are we going to do this?
You know, it has its own.
Yeah.
It's one thing to go from 12 or whatever it is, LEDs that turn on and off to like full screens with animation.
Yeah.
So it's like, it even had its own like built in like kind of like console, like terminal that, or that had print statements and stuff.
So we had to deal with like, like getting the text working, working and everything.
So eventually we were able to use some of the drivers already like provided by Adafruit and kind of like make our own like custom base code for that to work on.
And then, yeah, we're able to get that working.
But like the clue has like a lot more in terms of just like sensors, like it has, like I'm just looking at it right now.
It has gyro acceleration, like temperature pressure, and it has like a Neopixel right at the back too.
So it really just has like a lot.
It's pretty much like, as we said, as we would often say, it's like a micro bit on steroids.
So yeah, that was like really cool, but also like a really daunting task to have.
But yeah, going back to like the sensors on the CPX, Kevin, do you want to speak on that?
All right, sure.
Well, like I'm not going to remember like each of them, but there's motion sensors, which is pretty cool.
Like if you shake it or all of those, we can detect it.
And it's also possible to simulate it inside our extension.
We have temperature.
Venni, do you want to list the other?
Yeah, yeah.
I think there's an IR one, but I don't know all of them.
Yeah, I haven't tracked them out.
The light sensor temperature, the Neopixel, the motion sensor.
The IR one isn't in the simulator, but it is on the actual device.
Yeah.
Right.
So what I think is cool about this is you basically expose almost all the functionality of these little devices on there in order to play with them and whatnot.
Yeah.
Again, apologies for like us not knowing all of them.
No, no, it's fine.
It's been a while since we looked at it.
But yeah, it has like the different LEDs, push buttons, slider switch, 10 Neopixels, light sensor, motion sensor, acceleration, shake, temperature.
And yeah, yeah, I'm just reading off of the readme right now.
But yeah, that's kind of it.
Yeah, so I think it's really neat.
And you've got these three different devices.
The clue sounds the most interesting, but maybe not the first one you would start with if you were like a true beginner and whatnot.
But maybe just talk to you about how like maybe teachers or people in education might use this.
I think for teachers, I think that we initially started with a micro bit and teachers who are trying to teach Python or just micro controllers in general to their students,
they would use our extension to kind of get the basics of the code and then just deploy it to the simulator.
And if we have the devices in the class, we'd also deploy it to the device as well, the actual device.
We also have a feature called getting started.
So if teachers and students are very new to this whole VS Code extension and Python in general, they can install the extension and then just go to the getting started page.
And we give them step-by-step instructions on how to get started with the basic codes on like Hello World.
So that's pretty much it for that.
If you were a teacher and you had a class of students, instead of saying, how do I get my school to buy 20 clues or Circle Playground Expresses or whatever,
you can just say, we're going to install Visual Studio Code.
It's free.
Install the Python extension and we're going to install the device simulator.
All right, kids, now we can have class and we can play with these ideas, right?
Yeah.
And also like if they're not able to install VS Code itself, this is also available on VS Code online.
Oh, it is.
Okay.
Yeah, that's cool.
It was Andrea was able to, like the team was able to get it from working on the online version.
So I think-
Nice work, Andrea.
Yeah.
If I correctly remember, it was Andrea, right?
I'm not really sure.
I was given that task.
Yeah.
Okay, cool.
I don't want to-
I was working, I was actually working on two projects during my internship.
So I was in between two teams.
So lots of information, but basically if you have an Azure subscription, then you can get the VS Code online and the extension works there.
So yeah, students can just kind of log in online and start with the extension.
And I think we also have, we also made step-by-step video tutorials.
We gave that to our sponsors, basically on how to install the actual VS Code all the way to the extension, all the way to deploying a sample code.
Yeah.
Step-by-step exactly on how to do it.
And so if teachers ever needed that, we do have that package ready.
And I think it's for our sponsors.
So depending on which project or which teachers are using it, they can always reach out and get that package.
Yeah.
Okay.
Yeah.
Very cool.
Vandy, one thing that seems interesting to me is like, on one hand, we, in this education scenario, we could have a bunch of kids with these devices, or we could have them using Visual Studio Code and the simulator.
But in the end, like kids really like having the physical thing that does something.
So it might make sense to have like a teacher get one clue and one Circuit Playground Express, all the kids work on the simulator, and then they each get a turn with the physical device.
What do you think?
Yeah.
I think that's like the best way to do it because let's say you code something awesome and you have it on your screen.
But like at recess or something, you want to show other kids in different classes.
And so if you can deploy what you did on the simulator into the device and like walk around and show it actually light up and show it change state depending on like if you shake it or if light is shining on it, that would be super cool.
And I think that's a perfect way to use our simulator and also like have the device on hand.
And with our simulator, there is like a feature where you can deploy straight to the device with the click of a button.
So yeah, so you connect the device to the computer and you work on a simulator and then you just push a button.
Yeah.
What device does this really go to?
You pick it and then then it's on the device just as if you just deploys it, right?
Yeah, exactly.
Nice.
Kevin, anything else you want to add to this whole education story?
What are you seeing people doing?
Yeah, definitely.
Like the example you just talked about shows that our extension is not mutually exclusive of having a device.
like we think is really like adding to the experience of having, let's say, a microcontroller.
So you said before, like we make it easier to deploy.
But in the end, especially for kids, they're very visual people.
They want to see it on live.
They want to hold it in their hand and show it to their friends.
And that's where like it all goes in together.
Our extension makes it easier to code.
It's a little bit practical.
And they transfer the code to the microcontroller.
And then we have like a full kind of like circle going around here.
Yeah.
It's quite cool.
Yeah.
Another thing I wanted to add is that one of the goals of our simulator was also just to be able to program microcontrollers on the go.
So I could see that our extension would help if the teachers had to leave the microcontrollers at the school.
But the kids wanted to work on like certain homework assignments, you know?
Oh, yeah.
And like, yeah, yeah.
So then they could just like they could work on that at home.
And then when they get to school, they could upload it onto like the onto the actual device.
So, yeah, it's like it's a or even if like they just like they just have limited resources, you know, it's I feel like just having it on the go is really convenient.
Yeah.
And like I said, also, it's it's not just about not having the money for the devices like they go out of stock and you can't get them anymore.
Right.
So this is really, really cool.
Yeah.
Now, one thing I want to talk about with the experience you all have here that I think is pretty cool.
So we've got the simulators.
You write the code and then you have the ability to interact with the sensors of the simulator through like sliders and whatnot for like say temperature.
Put it on the real device, checks the real temperature, whatnot.
But if you're writing some code and it's not doing what you would expect, you said turn it blue and it turns red or just does nothing.
You're trying to figure out why.
It'd be cool if you could debug it.
Right.
Definitely.
It's one of the features we spent a lot of our time on.
And one of the features we're the most proud of is we integrated the VS Code debugger with our extension.
So it gives a real like industry experience for people wanting to learn and brings it up to the next level.
You can start with it, but you can also learn and become advanced with it.
As we know, a debugger is used in the industry and that's very useful for young developers and students to learn.
I think debuggers are, I think they're underused most of the time.
A lot of people just write code.
They just do print statements.
They're like, or they just spend a lot of time staring at it.
You know, put a break point.
See what the value of that variable is.
Why is it going here?
Right?
No, it's a string seven, not the number seven.
I get it.
That's why it's not equal.
Things like that are really obvious in a debugger.
If you print out the string seven, it looks a lot like a regular seven.
Yeah.
And I think that like integrating something like a debugger for like people who are just starting to learn is like super, it's super important because like as someone who has used print statements for like a lot of debugging in the past, it's like if I was more used to using a debugger and if that was like kind of like my instinctual choice a lot of the time, then maybe I'd drift more towards it.
But just because I'm so used to just like my first strategy, which was print statements, it's like I just keep going back to print statements.
So yeah, having the debugger there and just like kind of just overall, like even having the extension, like having the simulation as a part of VS Code, it just really helps like young developers kind of like get a sense of what they actually use in the industry.
Yeah.
And you can put a lot of cool, you can like level up on a lot of the stuff of say like the Python extension, right?
So if I type, you know, string dot and I get a big list of stuff that I can do, right?
That's really cool.
You get all the autocomplete and all the code formatting features and all the stuff that VS Code does already just for MicroPython, CircuitPython.
Yeah, we spent like a considerable amount of time and like to make sure that like the autocomplete and everything was working with like our library so that like it could help out a lot.
But definitely like having like the IntelliSense help from like the actual like Python people was super helpful.
Yeah.
Yeah, that's awesome.
That's pretty complicated stuff.
So what's the sort of ML story of the autocomplete on VS Code?
Is that IntelliCode or something like that where it predicts?
Do you guys know this, what I'm talking about?
Yeah.
So we actually didn't do like too, too much in terms of just like digging into the whole like IntelliSense stuff.
But essentially, we just applied what the Python extension people had on our library.
So essentially, the IntelliSense applies to any like it will look in any directory that you tell it to.
So we just we just structured our code so that it would give the correct results.
And then we pointed to our directory if I were to simplify it.
Yeah.
Very cool.
See that one thing I heard when I was looking through here was certain things like Vandy said the IR sensor is not available in a simulator, but it is in the real device.
And also heard that, oh, you can go over to MakeCode and do some stuff there for some of the more advanced scenarios.
What's this MakeCode thing place?
So MakeCode is basically a building block software.
It's basically drag and drop.
You can kind of look at certain functions and then you drag it and then you put another block inside and it would kind of work with that function.
So it's a very basic way of coding, but it's a very good stepping stone.
Okay.
My simulator express is basically the next step after MakeCode.
It's more like industrial like software programming.
So yeah, MakeCode is very, it's a very basic way of understanding coding, but it's a very good way of just introducing yourself into the programming world.
That's how I started actually in grade 10.
I started using a building block software to learn programming.
Okay.
Yeah.
Really cool.
So it's the more visual style and then like you kind of graduate to writing actual Python code.
Yeah.
Okay.
Yeah.
That's quite cool.
Maybe we could talk a little bit about how you all built this, like digging inside some of the implementation.
How did you build it?
What's going on inside?
Like how's this thing work?
Me and also like Vandy, we worked more on like the Python side.
So on the actual device, how it would usually work is the, speaking more on the Adafruit side first.
So then they would have Python drivers that would work on the CircuitPython library.
So the device itself would run CircuitPython and then it would have these drivers to connect to like the LEDs and just like the sensors.
So that like when you say like CPX and like, and then sensor, it would actually be accessing that value.
Right.
So then how we essentially did it on our side is it would just run on regular Python, like Python, like 3.8.
But we would kind of make our own simulated library that instead of communicating with the hardware, it communicated with a front end that was written in React.
I see.
So you almost write just a really simple Python layer that just when they say light up the LED, instead of going down to real hardware, you're just like, all right, how do I communicate that over to JavaScript or something like that?
Yeah.
Essentially.
So it just, it would send a JSON file just like with all of the new values for all of the, for like the LEDs, for example.
And then like the front end would send back like a new JSON with the sensor values and stuff like that.
So it would just be communicated like that.
But most of the state would just be stored on the Python side within the Python object.
Yeah.
Okay, cool.
And people who don't know, Visual Studio Code is basically a huge JavaScript application, right?
Yeah.
Like the front end, yeah, was made using like TypeScript and like the VS Code API.
And I didn't really, other than like working with virtual environment stuff, I didn't really work that much on the front end.
It was mostly Kevin trying to like wrangle that mess.
I, yeah, every time I had to work on it, I was like, oh, how do you do this?
Exactly.
Yeah.
It's all Electron.js and TypeScript and all that kind of stuff, right?
So Kevin, you were the one who had to make it flash on the screen.
Yeah.
Yeah, exactly.
I worked a lot on the actual UI and what you can see, but also kind of like the part that interconnects the Python side with the UI.
And the central piece at the end is the VS Code API, which makes it easy to communicate between those two blocks.
Yeah.
Yeah, that's cool.
All right.
Any notable packages or libraries that you guys used out there in this thing that you thought were pretty cool?
Well, like I'm going to say that like the VS Code API is pretty cool.
Like it is at the end, like a package in the library that we use.
And I might be a little bit biased, but that's my opinion.
Yeah.
On my side, like for Python, we didn't really like per se import a lot of packages.
We kind of like mocked a lot of the Adafruit packages, like the slideshow one, display shapes, display text, bitmap font.
Like, so just kind of adapting those for like our own use, like I found that they were like super interesting and that like, I don't know, it'd be super cool to like work for like Adafruit and actually write these because it's like, it seems so fun.
But yeah, just like overall and like even the underlying libraries that are made using C, when I was trying to transcribe them into Python, it was like, oh, this is like, this is really cool, you know?
Yeah.
It seems like a super fun project to work on.
It definitely, it has, you know, like five star ratings on the marketplace, which is really good, right?
You all must be proud of that.
Very proud, yeah.
Yeah.
Yeah, we worked really hard and like we wanted, we're always like really keen and trying to like fix the things that like the users are having troubles with.
Like, for example, when we entered like the internship, like a lot of the users were, well, like not a lot, but like some users were pointing out that it was kind of cumbersome to always have the dependencies download to like their main interpreter.
And we found that, yeah, like the dependency download step would fail for a lot of people because like it was kind of complicated.
Like it would download the packages to a certain like local folder and then just set the program to look at like that directory.
So then we kind of repurpose that so that overall when it does a setup, it sets up its own virtual environment and then sets up our dependencies there.
So it's a bit more like isolated.
And also, yeah, we were able to enable users to use their own virtual environment and set up on their own virtual environment if they wanted to.
So definitely iterating on like people's feedback was like an important part of the internship.
Yeah.
Yeah, I'm sure.
Yeah.
We always had that in our user testing, like at the bottom, last thing to test user flow.
The way they open the extension, obviously, and how did they enjoy that experience?
And we found that, again, what Anker mentioned, the dependencies, it's a bit tedious to see like sort of pop-ups and all that.
So we always ensure to refine that flow to make it optimal.
Yeah, it seems like a really nice experience.
Super cool.
So I do want to ask you all one final question.
And whoever wants to jump in, just jump in.
So I see you have these three devices, the Clue, the Microbit, and the Circuit Playground Express.
One area that seems like it would be really cool is there's a lot of companies out there making IoT things that have an API that people might need to program.
Maybe they program it in Python.
And if I'm going to work with that company, let's say I make tractors and I've got a little IoT thing you could program to, I don't know, control the tractor or whatever.
Is there a way that, say, that tractor manufacturer could make a virtual addition to the device simulator so that people could try it out and play with it and use it, get their API working, and then actually get a tractor or whatever, a car that self-driving, whatever they want to talk to, like that device.
Could you plug other devices in?
So currently, we don't have that.
When we were starting the project, it was an idea that was pitched to us just by another intern, like, oh, maybe you could make it more extendable to support different microcontrollers.
But in that task, there's just kind of a lot to unpack for a start, kind of see what the best UI is for these manufacturers and just kind of how they prefer to do this and that.
And that in itself is like a pretty big and daunting project.
And kind of since like, we're not really in the internship anymore.
And we are kind of like we have our own things for now.
I think it isn't on our schedule, but it would definitely be something that could help out like our extension to be more useful to like different industries.
I think it would definitely take it from education to broader IoT for sure.
Yeah.
I think what's awesome, though, is that all the code is open source.
And so like, if a company or if like people wanted to bring in like another device, they could check out the GitHub repository and make a pull request.
And like, if they're really keen on it, add another device that they want to see in the simulator.
Yeah, cool.
I think it would be neat.
But obviously, it's a lot of work, right?
It's not just plug in your API here or whatever.
But it still would be cool.
I think that it would be really cool and really interesting to work on.
But at the same time, like when I when I think about it, I think about kind of like all the user research that they want to do first in terms of like how they want it to actually work, because it could work like in multiple different ways.
So just like having that plan first, like, yeah, I think that it'd be super important, like even more important than it ever was before.
So, yeah.
Yeah.
Cool.
All right.
Well, I guess maybe that's a good place to start wrapping it up.
I know that you all did this as an intern project and you're on to degrees, new jobs and whatnot.
But where do you see this going in the future?
Either from, you know, if you guys were to contribute more or maybe the next garage intern group picks it up and runs with it.
So about like next interns picking it up that we're not sure and we can't really confirm it.
But since it's completely open source, anyone can contribute to it.
Like myself, I still contribute even though I'm not doing internship anymore.
And it would be definitely nice to have more and more support and more support from the Python community.
And we could grow that extension way more.
Some things like the ideas you just suggested would actually be possible on a technical side, but we would need more people working on that to make it happen.
Yeah.
Yeah, for sure.
Yeah.
Like personally, I'd contribute more if I had more time.
Like on my side, I'm mostly kind of looking at bug fixes and seeing like how we can kind of just keep it like sustainable.
Just because we kind of have our own things, whether it be internships or classes, it's not really easy for a lot of us to contribute as much as we used to be.
Maybe you all could go on a podcast and tell other developers about it and then they could also maybe pick it up and do some contributions.
Yeah.
That's right.
All right.
Well, let me just ask you all one question.
I normally ask two questions, but since there's four of you, I'll narrow it down to one each.
So if you're going to write some Python code, what editor do you use?
And you may all be biased given your focus here, but nonetheless, I'll ask you anyway.
Andrea, you want to go first?
I like VS Code.
Like I'm not just saying that because I'm still at Microsoft and that we made a VS Code extension.
But actually, like one of the reasons why I picked this project is because like I actually did use like VS Code a lot with Python before.
And I thought it's like, wow, they can put a lot in like a pretty lightweight editor.
So I was like, yeah, it's like we actually get to work with the team that does this.
That's so cool.
Yeah, that's pretty cool.
Yeah, like mini fangirl moment.
But yeah, I go VS Code.
Vandy, how about you?
Yeah, I'm going with VS Code as well.
Okay.
I just love the experience.
Well, and now you have stuff built into it that like VS Code is partly your code.
So that's cool.
Yeah, yeah.
Awesome.
Ciera?
I would go to VS Code as well.
I think that's the first editor I used in my first university.
And until today, I have good memories for it.
So I think I would continue with that.
All right.
Awesome.
Okay.
Final call to action.
People want to try this out.
They want to play with it.
Maybe use it with students.
What do they do?
Well, if they want to use it with their students, I guess the first thing to do would be to download
it.
But yeah, just like as Syeda said, there are packages that we made in order to kind of like
guide learning and just kind of like going through our getting started pages and looking
through even like existing code that's like on the internet for like the CPX microbit or
the clue.
Most of the time it'll work.
Like I know that for the clue, there's code in the actual Adafruit clue GitHub repo.
And you can actually put that on the put that on our simulator and it'll work.
So just kind of like I'd say just to download and play around with it and kind of like get
the vibe first and kind of like see where to go from that.
Yeah.
And I think the first the first thing when you download it, definitely don't get intimidated.
Read the readme page like carefully because there's so many commands there that can help
you actually get to certain pages.
Because I remember when we were doing user testing, we worked with some people who didn't
have any experience with VS Code.
So opening like the command palette, they're like, how do we do it?
I'm like, it's right in the readme.
It's right there.
So just maybe look at that first.
But definitely don't be intimidated by it and just, yeah, have some fun and fail fast.
You won't break anything.
So it's okay if you write some bad code.
It's no problem.
But if you break something, then let us know if we have a bug.
Yeah.
Let us know so we can help fix that.
Yeah.
Awesome.
All right.
You guys want to add anything else or what should we call it?
Call it good.
I could add one more thing.
Like the tech world is becoming more and more forgiving.
And like we want everyone to participate.
So, you know, like learning and breaking things is completely okay.
And have fun.
That's pretty much it.
Awesome.
I just, I also wanted to add something just like right at the end.
Overall, like personally, my experience in Garage was like really awesome.
And we were able to get like a lot done.
But this was also because like us as a team had like a really good dynamic.
So just like, I don't know.
I just wanted to shout out just like the team for being awesome.
And just like the coaches and everyone else in Garage for being, for just like making it
a great experience.
Because it's like definitely this is like a team effort.
And I wouldn't have gotten like anywhere close near like our end product if it was like,
you know, just me.
I agree, Andrea.
A hundred percent.
I think the team dynamic that we had, the support we had from the sponsors, from the Garage team
was really, really helpful.
Got to learn so much in the span of four months.
I'm glad that our product is so impactful that till today people are using it.
And it's basically with the help of the whole team.
It's a whole team effort.
Yeah, very cool.
So I guess final thing before we call it a wrap.
If people are out there and they're like, this Garage internship sounds awesome.
How do I get to it?
Like, how would they find out more for next year, next time around?
I would look out in the careers page for the postings for the Garage internship.
There's also a page, a type in Garage internship at Microsoft.
And you'll see a good explanation of what it is.
There's some videos that they've made on what people have been doing in the internship.
And also, I would follow Microsoft Vancouver on Facebook.
And they would post like an event.
Because I went to the networking event sometime, I think if I'm not mistaken, September, October.
I think it was September.
Okay.
And you can register and you can actually go for an information night and network with other people
who are applying for the same role.
All right.
Very cool.
All right.
Well, thank you all for being on the show.
It was really great to have you here.
A lot of fun and congratulations on the project.
It really looks genuinely useful.
Awesome.
Thanks for having us.
Thank you so much.
Yeah, you bet.
Bye-bye.
Bye.
This has been another episode of Talk Python to Me.
Our guests on this episode were Andrea Ma, Syeda Musa, Vandy Lee, and Kevin Nguyen.
And it's been brought to you by Linode and us at Talk Python Training.
Start your next Python project on Linode's state-of-the-art cloud service.
Just visit talkpython.fm/Linode, L-I-N-O-D-E.
You'll automatically get a $20 credit when you create a new account.
Want to level up your Python?
If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
Or 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.
And 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.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play,
and the direct RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.
Bye.
you
Thank you.