 So, hello everyone. I'm Katny and welcome to CircuitPython. So, today we're going to be doing a workshop. We're going to be learning about CircuitPython using a board called Circuit Playground Express. We're going to talk about what CircuitPython is, why you might use it. I'm going to tell you a little bit about the community built up around CircuitPython, and then we're going to go through some getting started stuff, and then we will actually get into live demos and coding while you guys are coding along with me. So, what is CircuitPython? It is at its base a derivative of MicroPython, which was Python that was written to run on microcontrollers. Microcontrollers are tiny computers, basically. It's a chip on a board that has pins and lots of things you can attach to it. And for the most part, previous to this, you could run C and you could run Arduino, that sort of thing. But there was no Python that did work on microcontrollers until really, until MicroPython came along. So, we decided that we had slightly different goals. MicroPython is a much lower level programming language. CircuitPython is a higher level programming language. Our goal is to lower the barrier to entry for learning programming and electronics. And that means that there are some features that may be available through MicroPython that are not available through CircuitPython because our goal is to make it easier for you to learn and get started with Python on microcontrollers, and that's like the whole deal. So, there's an amazing support of community built up around it that if you have questions, they have answers, and it's a super great place to be. So, I already covered its design for learning and lowers the barrier for entry. So, why would you use it? Well, if you're new to programming, it's a great place to start. It's actually how I started. Everything I know about Python I learned through CircuitPython initially. If you want to get your project up and running quickly and you want to be able to iterate on your project, it's super easy because you plug the board in, your code is right there, you change your code and it automatically runs. So, there's no compiling, there's no flashing, that sort of thing. It all just works immediately. You can update your code live. There's also a serial console and a REPL. The serial console is where your print statements or error statements are printed to, and so if you are confused about what's going on, your board's not doing something, you can take a look at that and it'll tell you, hey, you're missing this library or you had an extra space on this line or something like that, and it's right there for you. There are a lot of sensors and other types of hardware, drivers, peripherals, and that kind of thing that all have CircuitPython libraries, so there's a lot of hardware support as well. There's Python, of course you want to use it. And the great thing is it's open source software on open source hardware. Every one of these boards is open source. The schematics and everything about them are available online, so if you wanted to take them and build your own or build a derivative thereof, it's totally available for you to do that. So, the Adafruit CircuitPython community, we embrace open source to the furthest extent that we possibly can, and it's very important to us. So, everyone's welcome. We have a Discord server where we've sort of created a massive online maker space and we have over 9,000 members now. Usually about 1,000 people are online at any given point in time. There's a lot of different channels and you can choose one that makes the most sense for whatever you have going on. There is a CircuitPython channel. We also have the forums and we have GitHub. A lot of conversations happen through GitHub issues, either on the libraries or on the CircuitPython repo itself. And CodePlus Community Equal CircuitPython is sort of our tagline and really it's the case. Without the community, the code is nothing. So, we try to get people to contribute and be part of it and that's a very important thing to us. All right, so here's the thing. Don't worry about this right now because all the content, the main content we're going to be using is actually already on your board. But all the content used in this workshop will be available through this repo. I will post this link again later if you want to see it because there's extra content there in case you want to explore a little further and that sort of thing. So, if you do run into any issues with finding the stuff on your board, let me know and we can pop this back up and you can go there and get the code. All right, so here is the first thing that you guys need to do. We're going to be using an editor called Mu which has the serial console built in. If you are on Mac or Windows, you can go to this link and download the package and just install it and in theory it should just work. If you are on Linux, however, you have two options. I put this in here. This is a more advanced thing. If you want to put it in a virtual environment and you know what that is, that would be one way to do it. If you don't know what a virtual environment is, I would hesitate to go there and I would just do this. All right, so how are we doing otherwise? Pretty good. Who has it installed? Does everybody have? All right. Yeah, let's take it home. Okay. Hold this and download and you can take that. Let's rest this there. When were you there? 7 to 10. Oh, really? Yeah, I think so. Or 7 to 9 maybe. I recognize the chart. I was like, I know what that is. I have boxes of like crates of them. What am I going to do with it? Work charts, yeah. I was in Michigan, Partridge Creek, yeah. Right? I was ready to be done when I was down. Okay, so does everyone have the editor installed as far as we know? All right, we're going to do what mode you want to be in. You want to choose the Adafruit Circuit Python mode. And it should look a bit like this. So the getting started with Circuit Python is super simple. You plug in your board to your USB. CircuitPyDrive shows up. You want to have a file on there called code.py. CircuitPython looks for that file. And when you change your code on that file, it automatically reloads it and runs it. So anything you add to code.py gets run. So if you add a bunch of random things, it won't run, for example, because it's trying to run a Python file that can't run. But if you add your Python code to code.py, and let's say you have it set to do, I don't know, to blink an LED and you want it to stop blinking that LED, all you have to do is take that code out and hit save. And it stops doing the thing that it was doing because it reruns that file as soon as you save. And you can connect to the serial console and the REPL. The REPL is available to you just the same as a Python REPL is, where you can do code line by line. The thing about it is it's ephemeral. So if you, whatever code you're running in there, it's not saved anywhere. So it's really good for testing something because maybe your code.py isn't working right and you want to see exactly what line it's failing on. You can run your code.py line by line through the REPL, but as soon as you leave the REPL, all that stuff isn't saved anywhere. So if you are working in the REPL and you want all that saved, you have to make sure to copy and paste it out. The REPL is a great way to iterate through stuff quickly, but it means that you need to be aware of the fact that it's not saving that file anywhere. It doesn't save to like an output. So circuit Python code basics. You're going to have an import statement at the beginning that imports the libraries you're going to use. You're going to have any kind of setup lines where if you're using a library for something specific, there will be the setup. And then you're going to have your main loop or your main code and it may involve a while true loop. I will explain all this when we actually get to coding because the Circuit Playground Express Library, which is what we're going to be using, does all the setup for you. So there is no setup to do except to put this import line in your file. Now, you all have on your board a code.py that contains this line. It's a place to start. There's a couple ways that you can follow along with this workshop. You can either use that file and copy and paste from other files on your board into that file, or you can rename code.py to something else and then as we go along, you can rename each file to code.py and it will run that file. So two different ways. The way that you open files in Mu is you hit load and you're going to go to the Circuit Pie Drive and yours should look like this as well. And I already opened code.py, so if I try to open it again, it's going to tell me that it's already open. But you can open that code.py file and that's what you'll see. When I did open it, it had an extra line in it. It's possible that they all have extra lines in them. If the import is on line two, you can put it back on line one is fine. So the first piece of code we're going to look at is Blinky. For Circuit Python, our Hello World doesn't involve print statements. Our Hello World involves blinking LEDs. So there is a tiny red LED located on your board. It's on the opposite side of the USB cable from the little green LED that should be on right now. And what's going on here is we're importing time-time is a built-in library and we're importing the CPX library. Now we have our while-true loop and I don't know how many of you have worked with Python before and how many of you have not. Okay, excellent. So I'm going to actually explain what this does. A while-true loop basically means forever do all of the things indented underneath this line. So this says forever do these things and what these things are is we're setting the red LED to true and what that means is we're turning it on and time.sleep means we're going to pause for 0.5 seconds. Then we're going to set it to false which means we're going to turn it off and then we're going to pause again for 0.5 seconds and what that does is it has the effect of making the LED blink. So I'm going to open up Blinky and I am going to copy and paste it into the thing and first of all, before I do that, let's get this board up. So I am going to go here and I'm going to hit save and the red LED starts blinking. So go ahead and load up Blinky and copy and paste it or change the name through your file manager to code.py however you'd like to do it but this is what you should be looking for is a little red LED blinking. So let's go on to the next one. As we get into more complicated stuff we'll spend a little more time on it but these ones take less time. So now what we've done is we've changed it to button B and we say if button B, red LED is true so it's on and else means otherwise. So if button B it is on otherwise turn it off. So the code is basically saying if you're pressing the button, make the LED be on but if you let it go it turns off. So now this is you having control over whether or not that LED is on. So my LED goes off because I haven't done anything yet but if I press button B it's on but if I let it go it's off. So now I can make it blink as fast as I want as fast as I'm capable of pressing that button. Let's go ahead and take a look at the next one. So you'll find that there's a switch on the board. It is actually a toggle switch and it's not a power switch and what this code is saying and we're getting a little fancy here because so far we have had something equals true and something equals false and we separated them out. Now you notice this line says red LED equals switch. What does that mean? When the switch is to the left it returns true and when it's to the right it returns false. Now this, if your switch is to the left means that the LED is true because it's on because this equals true. So we got a little more complicated with the code. So go ahead and you'll see what I'm talking about if you load it up, put it on, and see what it actually does. The switch on your board? Yup, I will do that as soon as I... Yup, it's down near... So it's directly below like if you go all the way down almost to the bottom below the USB cable. So right now my switch is to the left. If I move it to the right, the LED, which is here, there we go, turns off. So that's what this code is doing is each time I move the switch it changes what it's actually setting the LED to. And this is... as you get further into learning Python you want to simplify your code as much as you possibly can. And this is a way to simplify code because otherwise this would have been four lines of code instead of one, minus the comment, obviously. I'll select a bunch of lines of code and comment them all or uncomment them all. You know, I don't think that feature is there. I know. It's meant to be like a beginner learning editor. I don't think that feature exists, unfortunately. I think you can do it in Sublime Text and I'll copy it out of the editor. Yeah. I can do it in any number of editors that I... You want something in your own hand? I'm going to use the third BB-edit thing to add them in Sublime. I need to add a comment. I want to have the hash mark. All right. Has everybody got a switch going? So, now we're actually going to use the Serial Console. Not everyone. Not everyone of these pads. There are seven of them that are labeled A1 through A7 that are touch pads. They're capacitive touch responsive. So, what this code does is it says, if you touch A1, print this out. So, to see this, we're going to open the Serial Console, which is here. And it should open a little window at the bottom of your editor. Like so. And there shouldn't be anything in it at the moment because we haven't added any code that does anything with it, unless you're running into errors, in which case you've got a lot of stuff. So, I am going to load that file. All right. So, now you'll see this. I want to show you what this is because if you have the Serial Console open and you save your file, you're going to see this. It does not mean that an error has occurred. This is actually, when it reloads, it provides you with a trace back, which is essentially telling you the last thing the code was doing when you saved. So, right here, the last thing my code was doing was whatever was on line five of code.py. And that's fine. This is totally normal. This is what you'll expect to see when you save a file with the Serial Console open. So, don't be alarmed by that. So, now that I have this code here, I'm going to touch A1, and it prints out to the console. So, there's the time.sleep is pausing because if that wasn't there, you would touch it and it would just spam it super fast. So, we add a little pause in there so that you can actually get away with touching it once and have it only show up once instead of just showing up a bunch. And the reason for that is the next bit. So, everybody got that before I move on? I clicked on the Serial button. It is writing. All the other games are working. It is writing. Okay. Did you try restarting the editor? I'm trying to set it to work. Well, it's supposed to happen automatically with this. That's exactly how you would do it if you weren't using this editor. But it should just see it. If you had the editor open before you plugged in the board, sometimes it gets unhappy. Restarting it didn't do it or it's going. Okay. What version of Windows are you using? You both need drivers. Okay. Do you want me to find them? Okay. So, Windows 7 and Windows 8 both use drivers. Windows 10, do not install the drivers. It lets you and then ruins your day. All right. So, next, we're going to do this for every touchpad. This is a little Python thing that you can just sort of stick in your code if you intend to put more code there later. I used it because, as you can see, doing this seven times doesn't fit on the screen. So, we're going to do a separate if statement for each one of these and it results in the same thing. The code itself has it in there seven times. It's just an iteration basically on the thing we just had, except it includes all of them. So, I'm going to save that. My code reloads. Last thing it was doing was looking at line 7. And now, if I touch any of them, it prints out that I'm touching it. Everybody got it? Still working? Yeah. Have you ever heard of case where it locks on my computer that I plug it in? My mouse only puts freeze up when I plug it in. Did you try it on a different USB port? Yes. Oh, no. Give me another board. Here, I'll just give you this. Here, trade me just the board. Okay. Try it with another board. Can you hand this back to Carl, please? Yes. Thank you. You're just hoping that the board just got crafted? Oh. The one's from Adafruit. Good. It's just in Windows 7, but they weren't working. Okay. That's what I did too. Is it working now? No, still locking up. Really? Windows 10 should play nice. All right. So, this board has a speaker built into it, which is this little black box here. And what this code does is it plays a tone twice, two different tones. So you may or may not be able to hear this, but it plays two tones. Now, you'll notice this is not in a while true loop. It's because that is the most annoying thing ever when you save it, and it starts playing those two tones repeatedly. And the only way to get it to stop is to put a syntax error in your file or delete the file. So, we have left out the while true, and this just means it's running once. So it looks at code.py, and it says, oh, I'm going to play these two tones, and then I'm done. Hurts. Yeah, so this is middle C, and then this is D. And you can do whole scales and that sort of thing. I believe there are lower and upper limits. You can only play a tone so low and play a tone so high. But, oh, no it doesn't. Thank you very much. So this is the duration in seconds. This play tone at this frequency for this number of seconds, and that is what that code says. Thank you very much. I'm going to tell everybody this. So, here's the thing about the REPL 2. I'm going to press any key to enter the REPL as this says. I have no tones. The reason is when you have these three little arrows here and you are inside the actual REPL, your code.py is not running. So if you have it in the REPL and you made changes to your code.py, nothing will happen. It will save your file, but it won't run the code. So you want to take a look at that serial console. If, you know, you're trying to do it and you know you saved it as code.py and you know it should be running, check and make sure you're not in the REPL. And to leave the REPL, as it says here, use control D to reload. And now I have tones again because it's running my code.py. All right. So next we're going to look at start tone and stop tone. Notice that this just has a number. It just has the frequency. Start tone means that it's starting this tone when you do a thing. Now, start tone doesn't stop. There's no duration. So it will continue unless you tell it not to with stop tone. So you always want to pair these two somehow. Unless you really just want to make a lot of noise. So in this case, we have an if, an elif, and an else. And elif is else if, and it basically means otherwise if. So if we press button A, start a 262 tone. Otherwise, if we press button B, start a 294 tone. Otherwise, stop tone. So this means that while I'm pressing those buttons, it is playing that tone. But if I'm not pressing those buttons, it stops that tone. So now you can press the buttons and make sound. All right. There are LEDs, other LEDs, RGB controllable LEDs on this board. And they are in a ring around just the inside of the touch pads. So we are going to light up NeoPixel 1. That's not what I wanted to do. All right. So this code is saying, because this is RGB code, which is red, green, blue for those of you who may not know. It's saying light up pixel number one at 50 green. Now these numbers are 0 to 255. That is how you tell RGB code to work. That is the range. And the reason that I have it set to 50 is because these things are blindingly bright. And the next piece of code I'll show you another way to control brightness. So one way to do it is to simply set your color number to a lower number and that it only lights it up with that much. This is how you talk to an individual pixel. As you say, pixels with brackets and you give it the number. Notice, though, right? We lit up number one, but it's actually number two. Why is that? Because Python starts counting at zero. So this one here would actually be pixel zero, not pixel one. That's a pretty standard thing with Python. And definitely with this kind of hardware is your first thing is always going to be your zero thing. Everybody got a green LED? All right. So now we're, instead of addressing just one, we're addressing all of them by doing a fill. But what we've done first, if we set brightness here to 0.3, which is 30%, it is a number between zero and one that you can set brightness to. And that is the other way to control it. So notice I've set it. This is red, green, blue again. And I've set red to 255, which is the maximum amount of red. But I've said not really. It's actually only 30%. So this is another way to do it. So fill always has two sets of brackets. The reason, the complicated reason for this is, is that fill actually takes one argument. And the argument is the entire set of numbers. So you have to have the double parens for this to work. Otherwise, if you don't have that extra set, it thinks you're trying to give it three items. And you're not. You're only giving it one. And that one item is made up of three items. And there we are. So you have red, green, blue. But say you want purple. You can mix colors by putting numbers in multiple places. And there's no camera in the world that does well with LEDs. So I apologize for the fact that that's going to be blurry. So now we've got equal amounts of red and blue. Red, green, blue. And that produces a purple color. You can do any color of the rainbow this way by setting different values for red, green, and blue. And that is what produces different colors for the LEDs. So I could do a cyan here. And that's how you dress all the LEDs at once. And if you put all colors equal, it is a white, although it is a sickly blue color of white. But it does produce a white-type color. And on your own time, feel free to set them all to maximum and take away the brightness line and see what I'm talking about. All right. So now we're going to start combining all the things that we've covered working towards combining them all together. So first we're going to do this piece of code with the buttons and the LEDs. So the pixel code supports what's called slicing. And slicing is a way of taking a set of things and doing something with only part of them. So what we're doing here is if button A, we're going to do something to only the first five LEDs. And if button B, we're going to do something to the second set of five LEDs, so half and half. For the slicing to work, it has to know how big of a slice it is. That's what this code is saying. It says, hey, by the way, I'm talking to five things. Same thing here. And the else is saying we're going to turn the LEDs off. So if the button's on, the first five are red. If the button's on, the second five are green. Otherwise, nothing's on. Notice that the slice uses brackets for the RGB. It's, again, because the slice is looking for a particular type of data. And that's what it goes inside brackets. And it's doing that one argument, so you want the parens as well. And again, we're setting the brightness down a little with this one as well. So now, if I press the buttons, which it's hard to see, half of the LEDs light up or the other half of the LEDs light up. Both at the same time. Both sets of LEDs light up. It's the way the slicing works. Plus, I think it's the fact that it's an LF statement. So it's doing things in order. That's why it does it only one direction and not the other. I think in theory, no, it still does it. Yeah. It's just the fact that it's cycling through the way the order that it does it. You also know when it reloads now. It's not just looking at code.pi. It's looking at this. This is the library, neopixel.pi. This is the library that's used for the pixels. So your trace back is now far more complicated because it's actually looking at multiple libraries now. And it tells you that. And the cool thing about that is if there's an error, it will also show you the last place it looked in the library. So you have multiple places then to look for where you're running into errors. All right. So now we're going to use the touch pads to turn on the LEDs. We're also going to be printing to the serial console so you can see which ones you've touched. But if you're running into serial console issues, you'll now have LED responses to show you what you've touched. Notice I've got my little dot, dot, dot here. That's because there's a lot of code. There's actually a lot more in the file itself. So let's go ahead and load that up. I'm sorry? We're on the board. The files are on the board. They're numbered. So if you look at the code.pi, all the files are there. Yeah. Do you still have one of the ones from the class? No. I just gave it back. So there's also, there's also, I was going to say, there's also a GitHub repo where everything is located, which is, no, no, it's all good. I think it's, what is it, PS1 2018? This is the repo URL. Okay. Yep. So we're on 12 now. All right. So I've given this a lot of different numbers. It's sort of just my iteration on what a rainbow might look like. And so we have a different statement for every touchpad and it lights up all the pixels of certain color. And then the time dot sleep again is there so that it's not just spamming through everything really quickly. So notice though that we did not actually do an otherwise turn off. There's no else here. So those LEDs are staying on and they will stay on no matter which one I press because we didn't tell it to turn it off. That wasn't part of this piece of code. So we use time in this one. So we imported it. We've got our brightness setting there so that we're not blinding ourselves. And the thing about using brightness instead of using lower numbers, I use lower numbers here because I'm using mixes of them to make like an orange or a yellow. But your color depth at, you know, the redness of the red, it's the most red it can be at 255. So if you set it to 255 and then set it to 30%, you're going to still have that very red versus if you set it to 50, you're losing some of your color depth. So it makes it harder. If I wanted to try and keep these both low enough without setting the brightness, my orange or my yellow would look a little weird. So that's why I did it that way where you set all your colors but then you set the brightness separately. Everybody got colors? It's a sticker. I think it might be. I believe it is. I think you can actually clip alligator clips to it and use it as a capacitive touch thing even. All right. Yeah. They work fine but I get some kind of error in the serial thing. Like every single one, it throws different errors. They all look kind of weird. Can you scroll back up maybe? No, of course not. Of course I wouldn't let you do that. No, I'm saying of course it would have deleted everything that we needed to see. I'm giving it crap. Okay. Yeah, I'm not sure why it would. Unless it's because you're adding code to already existing code. Is that what you're doing? I was trying to like a different editor but I couldn't. It does work fine with the others. Yeah. But maybe it's not in yours. If you have time afterwards, I can actually show you how I do this. Oh, no, that's not an error. Oh, it's not? No, that's just how when it reloads on its own, at times it'll do a reload exception. It's just part of the soft reboot. The trace back? Yeah, the trace back is just telling you the last thing it did when you saved it. Okay. The last thing it was doing was looking at line 52. So that's not an error. That's just what it does when it reloads. It's telling you exactly what it was doing when it reloaded and it's telling you that it did reload. Okay. Those are like the two things that it does. And when there are errors, it'll show you the last thing it was doing and it'll say like syntax error line 22. Right. And then you'll know there's a syntax error on line 22. So it basically gives you the same information that it would give you if you had an error when you don't. So that's irrelevant to the editor. That's something that if you're using just a serial connection through like a terminal program, you'll see the same thing. That's just a standard letting you know what it's doing. All right. So now let's take a look at our very last piece of code, which combines everything that we've done. And we're going to make a light up touch tone piano. So the first thing that we do is we add a way for it to stop making noise. And the reason that this is at the very beginning of this piece of code and is so important is because when I was writing this code, which was actually the first project that I ever did, every time I would pick up the board to do anything, it was making noises and it was the most annoying thing ever. So if the switch is set to true, which I believe is left, it turns all the lights off. It stops all the tones. And this continue means that it's constantly checking to see whether or not you've moved the switch. Because otherwise it would just get to that point and just stop and your code would be done. So this is just saying I'm going to keep doing this because your Well True Loop, remember your Well True Loop goes through everything. And this says I'm going to get to here and I'm going to do this until this is no longer accurate and then I'm going to continue. And then the last thing is that when you're not touching it, the lights are off and the tones are off. But when you are touching it, your lights are going to fill up and it's going to start playing a tone. So right now my slide switch is off and it is spamming that to let me know. So my touch pads do nothing. So I'm going to move that switch and now when I touch the pads, it does things. So the other thing I did was there's only seven touch pads and there are eight notes in a full scale. So I did a little bit of a trick here. Let me make this bigger. I did a little bit of a trick here where this, what this code is saying if we get to six and we get to seven because all the rest of them are just very, it's the same stuff that we've been doing here it says if you touch A1, do this stuff. This says if you touch A6 and you're not touching A7, do this stuff for A6. This says if you're touching A7 and not A6, do this stuff for A7. And the last piece says, which is the fake touch pad, is if you're touching A6 and A7, do this stuff for eight. I wanted all eight notes. So I faked it and that's how I got it. The final project ended up with a fruit attached to it. Fruit is capacitive. It was key limes because the pun was too good and also they're small. And it's alligator clips to the board. These pads are also alligator clip friendly and just jammed the other end into fruit and played music on my fruit piano. So does anybody have any questions about CircuitPython about anything we've done about the projects? Okay. How applicable is this to other microcontrol? I guess maybe not. You mentioned it being different than MicroPython. It's based on MicroPython. The major difference is that we have put a lot of effort into being CPython compatible. CPython is regular Python. And so that was a bit of a break from them as well as this much higher level programming language. So there's some very low level stuff that we did not pull from them. Interups, for example. And MicroPython runs on like slightly different microcontrollers than CircuitPython does. CircuitPython runs on like the Atmel-SAMD21 and the Atmel-SAMD51. We're working on, these are names of different names for like different types of microcontrollers. We're working on the NRF 52840 right now, which is a Nordic chip and it's got Bluetooth capabilities. So we're actually working on adding Bluetooth support to CircuitPython as we speak. These are actually all the boards that it runs on. This is the Metro. It's an Arduino form factor. So all our Arduino shields will fit on this. We don't have support for all of them, but there are a lot of them that we actually do have CircuitPython support for where you just pop it on and it works. There's two different versions of the Atmel chips. One is the M0 and one is the M4. The major difference is that the M4 is bigger and better. You can run more stuff on the M4. You don't run into memory issues. It wasn't out when we first started to have M0 boards. These are the itsy-bitsy form factor. It's a lot of pins in a very small space. It was the goal with this. Again, an M0 and an M4. The Atmel SAMD 21 and the Atmel SAMD 51. This is the feather form factor, which has actually kind of taken off. Other companies are starting to build boards that are this same form factor. The reason is there's a lot of add-on boards that we call feather wings that exist in this form factor. Now they're opening up the ability to be part of that ecosystem by building boards that are the same as this M0 and M4. These two are a little bit different. Every one of these other boards, including the Circuit Playground Express that you have, has another little tiny file space on it. That's what allows a lot of different stuff to run and you can run more complicated programs. These two don't have that extra little bit of file space. They're great for running small quick programs. Maybe you want to run a bunch of... Small quick programs doesn't necessarily mean a small project. You can run up to something like 8,000 LEDs off of one of these, but you would have to keep your code under a certain amount of lines in terms of complication. This is great for wearables. You can sew this into a project, make your sweater light up, whatever you want to do. This one's great for tiny projects that you just want to have something in a very small space, and this is good for that. We recently designed the Trellis M4, which is... There's LEDs underneath each of these, and they all have button pads on them, so when you press the button, it does the same thing basically as the little buttons on there do, and you can use it to send signals. We don't have MIDI support yet in Circuit Python, but it does exist in Arduino, which can be set up as a MIDI controller using Arduino. And that plus the Circuit Playground Express are all the boards that Adafruit makes that run Circuit Python. We have... Gotcha. And there are tons of boards that have been added to Circuit Python that are not Adafruit boards, and that's amazing. So there are other people who are designing boards that run Circuit Python, and it's actually really easy to do. All you have to do is add what's called a board definition, which essentially means you're telling Circuit Python what your pins are, and we have it set up so that you give us that information, and we can spit out a file that works on your board. You made it to work with the... Too small. Yeah. So there is like a certain level of processing power, I guess, that it needs, and then the Atmel SAMD21 is kind of the minimum base. It runs on an ESP8266 as well, but it's a very different experience, because there's no USB. Do you have a suggestion on what I should be approaching for that? For the ESP chips? Yes. I mean, MicroPython works. If so, if you want to be doing Python, that would be the way to go. Is there a way to do a configuration file? So if you're doing a head controller, for example, so you don't have to go in and edit the code every time to change what keystrokes or hotkeys you're sending, is there a way to use like a new file or some kind of configuration file that's read by the... It'll read other py files, actually. We've done that where we'll just put color definitions or... I don't know that anyone's done it with HID, but it should be the same exact concept where you would just put it all in a py file and then import that and call that file from your code.py instead of having it all in your code.py file. Yeah. That's the only way. I know how to do it. There aren't other ways to do it, but that's how I've seen that we've done projects where it's had separate files. Yeah. Python has any file parsers. You can have any file on there. Python does. I don't know if CircuitPython does. Python does because it has a lot of that stuff. Yeah. So the GitHub repo has a lot of extra content. This library actually has a lot of different features because there's a temperature sensor, a light sensor, an accelerometer, a sound sensor, so a microphone, which actually there's no feature for that in the library yet. But it has those other things and the library has options for all of those. However, we did not have, in terms of the time that we had, we didn't have time to cover everything. So the GitHub repo, which I will pop up again, has a folder called bonus content. And there is a number of files that cover the rest of the stuff that the library covers and also a few more complicated, interesting projects, like three more things, like a rainbow accelerometer. I think I have a slide that tells you. Yeah, a light meter and a sound meter. So one, you shine a light on it and the LEDs go up as you do and the other one, you yell at it and the LEDs go up as you scream at your board. So. Yep. For most people, you put your finger on it and the temperature goes up by very cold hands. It's always the opposite for me. So the thing is, Mew has a plotter, which I did not have, I can actually run some code real quick now that I think about it. Hold on, let me pull something up. Well, she's clicking. If anybody needs a class flash board, I have three of them and they can swap for me. They brought your own and they're still struggling. Good, everybody's good. Here's your money. Okay. So this is using the accelerometer. And it's plotting the data depending on how you move the board. So for the way that the accelerometer works is you have to... CPX.acceleration is basically a package of all of the accelerometer data and so you have to break it out into X, Y, Z. You could call that anything you want. X, Y, and Z are the axes that you're moving around. It makes the most sense to call them that because that is where they are. Then you want to print and print statements also want one argument and your argument is three things. It's X, Y, and Z, so that's why we've got the double parens again and we've got time to sleep on it because otherwise this is impossible to read. It's just really fast. And the plotter, as long as it's what's called a tuple which is any piece of data and at least one comma, normally a tuple would be multiple members so anything in parentheses with a comma is considered a tuple. This is considered a three tuple. Without that it would have been a two you can do a single member tuple by putting a comma after a single item. So there's a light sensor on the board and that's how you access the light sensor and it goes down if I cover it up and it goes back up if I let go. So to do it with a single number if you want to be able to plot something that's only providing one number you can just put a comma after it into a tuple. So I noticed when you had the we're printing the accelerometer it was sent in silver the value is from changing. It's because gravity at any point in time gravity is affecting one of the axes so and there's always going to be like a little bit of a jitter it's I clicked plotter. Up at the top it's next to serial. So there's always going to be just a tiny tiny bit of change to them but in general like you're talking about the difference of like 0.001 meters per second squared. And otherwise it only it changes when you when you actually move the board. And it gets if you if you shake the board it gets even bigger because you're putting more acceleration on the board. How do you send the like how does the plotter like receive the print statements or turn that into like a plot? It's just built into mu. I don't actually know the data behind how they did it but it wants a print statement that is a tuple. Okay that's where the tuple goes. Yeah as long as it's a print statement that's a tuple it's happy and it will plot you could even give it a print statement that's a tuple that's literally just a number and it will just plot that number for you and not change. The numbers will be improved. So it will fit inside whatever that box is it will scale it. Yep so if I changed it to something else that the scale was 0 to 6,000 it would scale up to that amount. Alright well I think it's time for us to take a break. I have some more there's like I said there's some more bonus content I've brought some peripherals that we can connect if you want to play with an LED strip or a potentiometer I have and I have some servos. I don't have enough I don't have enough for everybody but I have quite a few. If you're interested in staying after the break I do have more stuff that we can do like a few more programs that we can run otherwise that is what I have for you I hope I was able to give you some more information hopefully got you interested in Python and electronics and programming and that's what I've got, yeah.