 Next presenter is Paloma Foltly, who's going to tell us about how to build terrible robots. Please make her welcome. I am a relatively new Python programmer. I started last year and I'm already giving talks on it, so I must be really good at this. So I went to school for way too long learning how to build robots and I basically just did everything in C and I thought this is the easiest language. It makes so much sense and everything is clear. And I could never learn Python because that's too hard and people who are smart learn Python. And I thought that because people were doing such really awesome, interesting, complex things with it that it was going to be way too hard for me to learn and I would never be able to do it. And then I started learning Python and I realized that C is really hard. So I wanted to talk to you a little bit about why I think Python and MicroPython specifically is pretty great and why you should use it and also how you should build terrible robots. So just quickly, how many people really enjoy robots here? Okay, great. Good number of hands. How many people want to actually build a robot themselves? Okay, awesome. That is a similar number of hands, which is better than the last time I gave this talk because there was a lot of hissing when I mentioned any hardware. So this is much better than that. So the first question is why? Why do you want to build a terrible robot? I want to build awesome robots, not terrible robots, and I want to do it the right the first time and never make any mistakes and it's going to be perfect. That's probably not going to happen with your first robot. And I really think that you should build really terrible robots that are useless and bad because it is really interesting and fun and you learn a lot. So terrible robots are hilarious. You may recognize this lovely lady on the left, that's Simone Yatch, and she is the self-determined queen of shitty robots. And so these are the kind of robots that she builds and my personal favorite. So that was probably really hard to make and she had to learn a lot about motors and about sensors and about actuation and then she built something so useless and wonderful and it makes me so happy. So building useless robots helps you build really great robots. So if you learn how to use those motors, then the next time you want to incorporate motors on your project you already have the code, you already know how to work with it, and you already know how to hook up that motor. So I really think that spending time just tinkering around and hacking around with this hardware will actually let you build something really great. So I have several steps here to teach you how to build the terrible robot and the first one is to embrace failure. And nobody really teaches you how to build or how to embrace failure. Like they don't teach you what to do to embrace that. Absolutely no one teaches you how to do this. They don't teach you anything about how to learn from your mistakes or your failures. And so all of you are flying blind and have no idea what to do. So you have to embrace failure, right? You have to learn from your mistakes and you need to kind of get excited about failing, look forward to it, see it as an opportunity to learn more. So set impossible goals. Say that this is my robot and it's going to fly around the room and it's going to find the person who's fallen asleep during my talk or is currently checking social media that is not on my social media tweeting at me, hey. And it's going to target them and shame them, right? That's an impossible goal. But maybe I can make one that just points and laughs at you. Reward risk taking. So anytime you try something ridiculous and just be proud of yourself and say like, hey, but I tried something, I at least went out there and attempted to do something cool and enjoy the chaos and learn from it. So all the insanity that ensues, don't get bogged down by it. Like get excited by it. And so like when I was in college learning to build robots, there was this insane competitive atmosphere that if you weren't doing well, you were a plague and no one should talk to you because you're going to bring everybody else's GPA down, right? And so failure felt like, if your project failed, it felt like you personally were a failure. And so nobody helped each other and nobody worked together to do anything collaborative. And that makes terrible robots and not like the fun terrible, like actually really bad terrible robots. And so if you do these steps, you can actually change that culture and have a really positive relationship with your work. So step two is lower the bar, right? So if you have this amazing idea for a robot, but you say, but if I can just like turn on the microcontroller, we have had a success today. If you do that, then like you're already on your way. So building robots isn't hard, but meeting your ridiculous standards is hard. It's your standards, right? Like what even is a robot? Is this a robot? I think so. But you know, maybe before this talk you didn't think so. And recognize that everything worth doing is worth doing poorly. A lot of people say like everything worth doing is worth doing well. No, it's worth doing really bad and then a little bit better the next time and learning from what you do. So you may be saying, how do I actually get started building a terrible robot? You told me a lot of moral and philosophical things here, but I would like to go home and build a robot. So now we're going to switch to that portion of this talk, which is where I give you some useful skills. So step three, you're going to make it think. This is where I think all of you will be very happy and comfortable. It's writing code. It's working with what you want that robot to do and planning that out. Here's some lovely microcontrollers here that range from really simple block programming up to really complicated programming. So this is usually what I say should be a great intro programming. Like Make Code is a really great block programming language and Arduino is fantastic. There are semicolons, so I'm sorry to do that to you today. But about last year, I started working with MicroPython, and I really love MicroPython. It's really great for fast iteration. There's a low barrier to entry, and a lot of the stuff you already want to do in Python is implemented. Now, so this is built off of Python 3, which I hear we are fans of here. And so MicroPython is built to be run on really basic systems. So 256k of code space, 16k of RAM. It can work on tiny little machines. And it's great. And you can have instant evaluation and feedback with the RAPL, which is read, evaluate, print loop. So it's like a terminal window. You can type stuff. It says, like, got it. Or that's not Python. So today I'm going to be talking about CircuitPython, which is sort of built off of MicroPython. It's built by Adafruit, for Adafruit boards. It's really lovely, and it can work on way beefier boards. And it encompasses more of what Python 3 is. But it has a limited chip set that it works with, so it won't work with every board that you want to. But if you get boards from Adafruit, they're super well documented and supported. So there's some information here. You can look at it later when you watch this back. Hey. So, oh, and now I'm going to switch to actually show you some of that code. So this is my terrible robot. I love it, dearly. This is Comfort Bot. And, oh, come on. Are you going to work for me today? Hey! All right. We're so happy today. Okay. So inside here is a Adafruit Metro M0 Express. You can come check it out after this at the Micro Park. So you want to hang out with me there and play around with this robot, please feel free to. So I'm in an editor called Mu. You can do this in a lot of different editors. This is just the one that Adafruit says is best. So I said, let's do this. And then you can do all of your coding in here. And the nice thing is that when I plug this in, it will definitely work no problem. Hey! So this is that beautiful R-E-P-L we were talking about. And so if I press Control-C, we can actually type code into here and say, hey, what is 2 plus 2? It's 4. All right. Great job. So the really cool thing about this is that all of that Python is being executed on that microcontroller, not on the computer. And I can actually do things like, say, help modules and see what's in here. So these are all the modules that I have currently running on there. And I can import them. And if I can remember what the function is... Okay. We're not going to do that one because I don't remember it off the top of my head. But so you can run code on here. A lot of it is in... I link to the Adafruit step-by-step tutorials, which is really great. I mean, it wouldn't be great if I showed you an LED blinking because it's inside the box. So just imagine that an LED is blinking at you and it's very impressive. But so the nice thing is you can write all this code here and execute it. And when it fails, you can run in and see actually which part is failing. So I decided that for this wonderful presentation, I would show you this beautiful robot that I made. It's very useless unless you like validation and positive feedback. So this is Comfort Bot. It comforts you when your code fails. So... Okay. Oh, I'm so sorry. I didn't mean to offend you with that. Okay. I will do that later. So basically, when I write some code, right, everything's going to try accept loop, which I'm sure all of you are really happy about. Because this is the best way to write your code. But if I throw some garbage into my code, so the nice thing is you just click Save. It saves it on the robot as if it's a USB drive. Like if you look on here, you can see Comfort Bot is just a regular USB. You can click and drag your code onto there. You don't need anything special. You can just use it normally. You can download code and just throw it on there like a thumb drive and it will actually execute it assuming you name it code.py. So there's some security for you. You have to have the right name for your file. Really sophisticated. So... Oh, it's so tiny. There we go. Okay. So... If I... Thank you. I agree. So the nice thing about this is that it is also very indicative of what my talk is about, which is that it is encouraging you when you fail and encouraging you to try again. Because you're actually excited when it fails. It prints out the exception that garbage is not defined. And then it, like, comforts you and pats you on the back. So if you want to see how that was done and take a look at the insides, I'm happy to show you later. It's very sophisticated and difficult. So... And very impressive. Don't worry about it. So... What I've done here is that I made it do stuff, which is step four. So you decide on your outputs. Now, I don't have enough time to talk you through all of the ways you could hook things up and exactly how voltage works and current and different communication protocols. But I will happily talk to you about it at the micro park. But so you decide what you want it to do. You hook that up, power ground signal. You're good. And then you tell it when to do stuff. And that is going to be basically sensors. And it's going to say, when this thing happens, do this thing. And those are also really simple to hook up, power ground signal, right? It's not hard once you kind of learn the basics. And so I really think with some very simple tutorials you can get to a point where you're doing this and able to have this cathartic experience. So... I had all these thoughts and feelings and decided to do something with it. So at my university I started a program called the hackathon because I like bad puns. And because I wanted to encourage my fellow university students to have the support that I did not have when I was in my robotics classes. And I decided to build a like 12 hour hackathon where you had to build a robot and you were going to fail. So we gave them actually closer to 10 hours. And we... Because they also had to present their ideas. And this is the presentation from the winning team which we will get to in a second. But we gave them a prompt. We gave them tons of support. We had workshops throughout the day to teach them how to hook things up. We had bingo cards of failure modes. So... So if you let out the magic smoke you're like... If you put way too many LEDs on that you got a bingo sticker. For some reason if you put a bird on it you got bingo stickers, right? So we had some amazing, amazing submissions. And the prompt for the very first year was your computer is not secure. Build a robot that makes your computer secure. Um... And I mean some honorable mentions are the robot that would beep out messages to make your computer feel more secure. Um... It would uh... It would say things like you always choose the best decision. Uh... And you have great battery usage. Uh... Things like that. Um... And so we had all sorts of them. One person was trying to hook up a car battery to try to like smash a hammer on your fingers if your password was wrong. It was pretty crazy. Um... But this is the team that won. Are you tired of people stealing information off your computer? Introducing Product Name Featuring Advanced Alarm System And Dangerous Spending Blades Ouch! Your laptop won't open when it's locked. Easy to unlock when you have the password with a convenient remote control. Hustle Free Working Then when you're done working it's simple as pressing a button so thieves can't get to it. So this is my favorite. Limited Supply Call Now So this is fantastic. I love it so much. Um... Because they had to learn so much to do this. Like a lot of these people working on this had never worked with a microcontroller before. They brought in an IR like remote because they had one for their LEDs at home and they wanted to learn how to use it. And they worked really hard all day to figure out how to make these things work and they just built something ridiculous. And so we gave them a trophy made out of a plunger of spray-painted gold and gave them a bunch of action figures on it and then we gave them a nice little bag of goodies so they can go home and keep building ridiculous things and embrace the learning process. Nobody shamed them because what they were building wasn't going to be profitable or because what they were working on wasn't going to be perfect on the first try. Everybody was like, oh, that's hilarious. And so they actually still do these today and have a wonderful time and it's a really great tradition that's down at UCSC. Um... And so I really encourage you to kind of take this, you know, you can do it at home, have a party with your friends, kind of create an environment where this kind of like exploration and play with hardware is embraced and accepted. So I encourage you to go for it. Um... Here's some of the references that I used for this presentation. Feel free to hold here for a couple seconds if you want to take a picture. Okay, cool. And the next slide is some other really great resources that I think are awesome for building your first robot. So if you would like to talk to me about this, I would be happy to let you play with it and try to write code and see if you need comforting on your coding skills. And I really appreciate you hanging out with me for today. So thank you.