Up until now we’ve used just Particle.io’s cloud based platform. This studio will introduce another popular platform as well as review a common design tool, Sequence Diagrams.
The objectives of today’s Studio are:
Please take your role seriously. When you get your role, review the responsibilities and make sure you follow through on them.
process/Roles.md
)README.md
process/SessionNotes.md
):
process/Debrief.md
Groups of three will be allowed if:
In groups of three the Manager must also take on the responsibilities of the Spokesperson.
As in the previous studios, all group members will need to be in a GitHub group (and repository)
The link for this studio is: https://classroom.github.com/g/m8duwSBD
Today the Recorder, Technician, and the Spokesperson will want to be able to work with the repository (i.e., it should be on at least two computers). The Technician will be working with the Photon (C++).
The Recorder should update process/Roles.md
to record everyone’s roles for this studio (use full names). In addition, the Recorder should take notes about the interaction of the overall session. Be sure to pull/merge/commit/push at the end of the day!
Today you will be doing the bulk of recording answers to questions. Read the questions in process/Debrief.md
to the group and the group should come to a consensus for each. Be sure to enter the responses. Be sure to pull/merge/commit/push at the end of the day!
The Technician will be programming the Photon and the UI. Consequently their computer will need to be logged into the account for the Photon being used for testing. (Particle Desktop will need to be logged in)
You will be managing the code for today’s studio. Download the repository and open it in Particle Dev. Be sure to pull/merge/commit/push at the end of the day!
Today we’ll use a web-based tool to make sequence diagrams. Visit: https://www.websequencediagrams.com/. (There’s no need to create an account or sign-in. You won’t be able to save work on-line, but you can copy/paste the descriptions of the diagram to “save” your work)
Websequencediagrams uses a text-based description of a sequence of interactions to create a sequence diagram. There notation and approach makes it particularly easy to modify sequence diagrams.
We are using sequence diagrams informally, so we won’t use all the special notations available. Mainly we want to capture the sequence of messages being exchanged during interactions between devices.
The following diagram corresponds to a usage scenario where:
Recreate the diagram exactly as shown. (Hints: Look at the use of title
, participant
, and note
as aspects of the diagram)
Complete README.md
Q1
Review your solution for the previous studio (Cloud Connected Lamp). Ideally it will:
Set Color
is will send a message to the PhotonCreate a sequence diagram corresponding to this usage scenario.
functionName() [to DeviceName]
. For example, setColor() [to lamp]
.Complete README.md
Q2
As described on Cheerlights.com: “CheerLights is an “Internet of Things” project created by Hans Scharler that allows people’s lights all across the world to synchronize to one color set by Twitter. This is a way to connect physical things with social networking experiences.”
Basically it allows all Cheer Light participants to see an the same color at the same time and also allows anyone to control the color. Cheer Lights utilizes the ThingSpeak cloud platform. The ThingSpeak platform allows you to easily post and retrieve data from a cloud service as well as do analysis and respond to data in the cloud. Review the ThingSpeak platform.
Complete README.md
Q3.1-3.2
Particle.io also offers a cloud-based environment for development. Today we will use it rather than Particle Dev for code.
Libraries
button on the left toolbar (it looks like a ribbon)
Enter ThingSpeak
in the search boxThingSpeak
library (just the name ThingSpeak
)CheerLights.ino
in the examples menu at the bottom.Use This Example
button.setup()
to be appropriate for your LED.loop()
. Complete README.md
Q4.1setColor()
function uses the RGB LED built into the Photon (the one used to indicate the Photon’s status). This could make it difficult to see if your Photon is connected to the network or not. Remove all references to the RGB
object from setColor()
and update it to work correctly with your RGB LED.Devices
icon (circle/cross hairs) to select the Photon.README.md
Q4.2README.md
Q4.3README.md
Q4.4Now that you can read data from ThingSpeak, let’s write something to it.
Channels>My Channels
from the top menu.
Create a new channel. Name the channel anything you like and the first field Random Value
. You can leave all other data empty. Hit the Save Channel
button at the bottom of the page.API Keys
tab. You will need the Write API Key for the Photon to be able to post data to the channel.writeField(int ChannelNumber, int Field, float Value, String API Key)
Complete README.md
Q5.1
Commit your work to GitHub:
Complete any unfinished work and commit it to your repo by 11:59pm Sunday, March 25th.