|Project Goal||Get your Particle Argon online and claimed to your account|
|What you’ll learn||How to claim a new Particle Argon using a browser and the Particle mobile app.|
|Tools you’ll need||A Particle Argon, USB Cable, and the Particle mobile app for iOS or Android.|
|Time needed to complete||15 minutes|
In this lab, you'll claim your first Particle third generation device, the Argon, with the help of the Particle mobile app. Once you've claimed it, you'll flash some code that blinks an LED on the Argon.
Reminder: Did you come prepared?
Make sure you have completed all the prerequisites before advancing beyond this point.
First, you will set up your Argon and claim it to your Particle account. This will allow you to manage your Argon from the Particle Device Cloud.
- Open your glorious new Argon Kit. Attach the Wi-Fi antenna to the U.FL connector labeled WIFI. Afterwards, use the USB cable to plug the Argon into your computer. This will power-up your device, and you'll see built-in LEDs illuminate and blinking.
Once the Argon powers up for the first time, it will automatically enter "listening mode" (indicated by the RGB LED blinking blue). This means your device is ready to be claimed.
If you need to actively put your device in to Listening Mode, hold down the
MODEbutton for three seconds, until the RGB LED begins blinking blue.
- Make sure your phone has Bluetooth turned on. Open the Particle Mobile App and login to your particle account, if you have not already.
- On the Your Devices screen, click the + icon to add a new device. Choose the Argon/Boron/Xenon option.
- The next screen will instruct you to find the data matrix printed on your Argon. Using your phone's camera, scan the code.
Note: Give the app Camera permissions
Make sure to allow the app to access your camera to complete this step.
- The app will now use Bluetooth to pair with your device. If this is the first time your Argon is connected, it is probably due for a Device OS update. This is handled automatically by the App — this may take some time, depending on the number of updates pending.
- After the update is complete, the app will ask if you want to add the Argon to a mesh network. For now, select NO, DON'T USE IN MESH, as you will explore the mesh networking capabilities later on.
- Connect your device to the cloud, by providing it with Wi-Fi. Select the Wi-Fi you intend to use, and enter the password.
- When your device has connected successfully, you may give it a name. After that, exit the setup.
Congratulations, you've claimed your first Argon. Now, you'll program it to blink an LED.
To program (also commonly called flashing) your device, you'll use the Particle Web IDE
Tip: Flashing... what's flashing?
Flashing is hardware-speak for sending code to a device. For Particle devices, this can be done from the Web IDE, Particle Workbench, or the Command-Line Interface (often abbreviated as CLI).
- Go to the Particle Web IDE and login if you have not already.
- Create a new app by submitting a title (e.g. "blinky") and press enter.
- You should now have a right-side section (the code pane) with two empty functions declared.
At this point, your goal is now to write code that turns the onboard blue LED on and off every second — a hardware equivalent of the classic "Hello world!"
- The physical pin connected to the blue LED is
D7, you give it a name, so you can call it later on. Do this above the
// Blink an LED. // Declare variables. int ledPin = D7; // The onboard blue LED is connected to pin D7.
- You now need to configure this pin as an output to be able to control the voltage (
LOW). This is done inside the
// Set the pin mode to output, so you may control it. pinMode(ledPin, OUTPUT);
- Turn on the LED by setting the pin value to
HIGH. This is done inside the
// Turn on the LED. digitalWrite(ledPin, HIGH);
- To keep the LED on for a fixed amount of time before turning it off again, introduce a delay immediately after.
// We'll leave it on for 1 second (1000milliseconds). delay(1000);
- Now turn the LED off by setting the pin value
// Turn off the LED. digitalWrite(ledPin, LOW);
- To finalize the code, add a delay after turning the diode off, so it is off for a while, before the loop restarts and turns the diode back on again.
The "blinky" code is now complete, and it is time to flash it to your physical device.
// We'll leave it off for 1 second. delay(1000);
- Choose which device to target with this code by clicking the crosshair icon in the left pane.
- Your Argon should be in the list, if you have claimed it successfully. If it is online it will have a breathing cyan circle right of its name.
If this is your first device, it will be selected automatically and you can flash code to it by clicking the lightning bolt icon.
If you have other Particle devices associated to your account, click the star icon next to your new device to select it. Then, click the lightning bolt icon to flash.
... and that's how you get to blinky!
Tip: See all the code in one place
You can find the final code for this lab right here.