When you first look at the Photon, it's staggering that such a small device could possess the incredible functionality that it does, but not only does it bring an impress spec sheet to the table, but the true power is unlocked in the cloud based ecosystem that Particle have created for their hardware. In this tutorial Sam explores getting started with the Particle Photon.

Transcript

Hey guys, it's Sam here from Core Electronics and today we're going to be taking a look at getting started with the Particle IDE. Now IDE stands for Integrated Development Environment and it's pretty much the way that you program your board, the way that you write your code, it's where you manage your libraries, all that kind of thing.

So the Particle IDE is completely cloud based, it's fantastic, keeps all your applications up there, all the libraries, you know, it can keep track of your devices, you can flash to your Photon Electron over the air. For more information on actually working with the Particle Photon and the Particle Electron individually, check out our specific tutorials for that, this is going to be more of a look at, you know, sort of a walkthrough of the IDE and how we can actually flash over the air our applications.

So, yeah, we'll have a look and we're going to go to build.particle.io, so build.particle.io and the Particle team have actually made it so easy to get started with writing code using the same software abstraction, wiring, as Arduino, so, you know, your functions like digital write, digital read, you know, the loop, you know, your setup, void setup and void loop, they're all exactly the same, you can pretty much port Arduino code almost line for line over to this with very few changes.

So, we're going to have a look and I've got loaded up an app here called Blink Demo, it's pretty much the hello world of programs. But before we go into that, we'll actually just have a look at the Particle IDE window. So there's two main sections here, we've got our, got a kind of a coding workspace here and this is where we write up code, where we're going to, you know, get compilation messages, you know, be able to view the library code, things like that.

And then you've got your, sort of your menu in your menu panel, I guess. So here it's going to show, you know, all the info of the tab you're on and you've got your code tab, which we're on at the moment, you've got your library tab, so you can search for libraries, you can put libraries in, you know, in your apps, things like that. So, you know, we can look through, we can look through the libraries, now the libraries are actually community driven, so lots of people can upload libraries, they can tell you how many people are using it, so, you know, you can actually find a really popular library that's probably going to work.

You've got devices, docs link, so you can see your, all your different devices and the status info of those, so whether they're online, the name of your individual device, I can see which one I'm targeting, whether a photon or an electron or a core, it's an older board. Go to the console and view our settings. So that's sort of everything we can do with the IDE.

Now it's fantastic, all you need to do is log in with your Particle account, if you haven't made one, go to particle.io and sign up, it manages the Particle Cloud platform, the app, your devices, the command line interface, everything.

So, all right, so I've kind of got here, it's two main sections, one and two and three, is really just an extension of that menu bar, you know, it's where you're actually selecting what's going on in the menu bar, I've just sort of highlighted them differently so you can see, you know, see what's going on there.

So we'll look at our, you know, how we actually can manage our code in here, so there's a few main features. Up the top here you've got your flush button, you've got verify and you've got save. Now saving obviously, you know, saves a copy of your code onto the cloud. Verify goes through and attempts to compile your code, so make sure that, you know, it's able to run, that there's not a syntax error or something that's going to break your code. Sure, here's the transcript formatted into paragraphs:

So we can take this code here and just click verify and it'll take a few seconds, sorry, not a few minutes. Yeah, verified, great work, which means it's ready to upload. And then the flush button is actually going to flush your code to the device.

Now, as you can see, I've got an Electron board targeted at the moment and with the Electron, because you do have to, you know, work with data usage and it does cost, you know, per megabyte for the data you're using, I recommend staying away from flushing over the air unless you, A, have lots of data, two, you don't care or, you know, you just can't be bothered using the command line interface.

But if we go flush, it'll actually recognize that and say, hey, you know, you're going to use some, you know, use a few KB from your data plan and it'll just give you a warning. If you want to look at how you can use the command line interface to flush to your Electron, check out our specific getting started with Electron tutorial.

And for now, we're going to change that to Photon Margaret. I like naming my boards after unique Australian names, kind of my thing. And I'm going to target that device. I'm just going to go ahead and connect it up to power. So I'm just using USB power here.

All right. So I've got a previous, I've already got this, I think Tinker is on this particular Photon. And in fact, it might not be Margaret that's selected here. I think it's, I know it is Margaret. Yeah, just running a different piece of firmware there. So we're going to go back. And so that's the IDE. And now we can pretty much just flush our code. So the code's here. So if you just copy and paste that into your IDE, I've actually already got it here, but I'll go through the process. Yeah. So copy that in. We don't need to use any libraries, anything like that. And we're going to go through and now we can flush it.

So when you click verify, that's, you know, compiling and checking without flushing. But when you click flush, it'll also go through that compilation process. Pretty much. So you don't really need to click both. If you're going to flush, we can just click flush. And because it's a Photon, it doesn't matter that it's flashing over the air. And so it's just taking a moment to compile. We can see the status LED here connecting to the network and it's running our code. Super easy. That's the hello world of our microcontrollers blinking the LED on and off the onboard LED. Nothing too complicated going on. We're just declaring our LED as a variable, setting it as an output, and then we're setting it high, waiting for half a second, setting it low, waiting for half a second, rinse and repeat.

And there we go. That's getting started with the Particle IDE. We're using build.particle.io, the sub domain of Particle IO. Yeah, that's all there is to it, guys. Thanks for watching. Take a look at some of our other tutorials. Go through working with displays, graphic, character, great project ideas. Yeah, that's it for now, guys. Have a great day. I'm Sam. Thanks for watching. Bye.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.