empowering creative people

Videos / Circuit Playground Express Workshop - Chapter 6 - Programming with Javascript

To program with Javascript you use the MakeCode editor but change your interface to be Javascript. Javascript is easy to program, and all the commands that are available in MakeCode are also available in Javascript. One of the coolest features of programming in Javascript within MakeCode is that you retain all the great libraries that MakeCode offers. Plus, you can drag and drop code segments from the menu column just like blocks. This seriously speeds up programming!

Search Videos

Related Content

Transcript

+

Hi welcome back to the Circuit Playground Express online workshop, in this section we're going to learn about programming your Circuit Playground with JavaScript.

Now if you've been using MakeCode you're probably familiar with JavaScript at least you've clicked over to the JavaScript side to see where you can program it, but I'd like to go into a little bit more detail about what JavaScript has to offer. So, Java scripts are widely used programming language, primarily in web browsers because that's the programming language that all web browsers use but it's not used very much within the maker industry or in other areas. It can be used to program anything from games to Internet of Things items to even Circuit boards like the Circuit Playground Express there's just a little less common to see it in that area, but it's an easy programming language to learn and it can be intuitive for a new person who's breaking it into programming. So, let's look at what it looks like in MakeCode.

So, I've got an example up here where I've set up an event for the button A click and B click and if we head over to the JavaScript side we can see what that looks like within JavaScript and we could program anything we like in JavaScript, we can make create our entire sketch in JavaScript here and one of the nice things about it is we keep all the functionality of the virtual Circuit Playground Express that MakeCode offers so we can test out our code in real time and we can grab blocks of code from the menu options and drop them in. So rather than needing to look up what we want for lets say a rainbow animation and then we'll set all the lights to zero we can drag and drop kind of like the blocks to really speed up the process of programming and it's kind of like a cheat sheet for learning the different elements of JavaScript as they apply to the Circuit Playground Express and that allows you to program as quickly and as easily I would say as we the drag-and-drop blocks it once you have a little bit of familiarity with how the code works.

So, if you're looking to start programming with an actual programming language for your Circuit Playground using JavaScript within MakeCode makes the transition easy and gives you all the help you need to start learning how to code in an actual programming language stick around in the next section we'll talk about programming in Circuit Python.

comments