The programs we write for LinkIt One are called sketches. Inside the sketch we have a minimum of the following two methods:
The setup method will run once at the beginning that helps to initialize our variable and sensors.
The loop method will be called repeatedly. We can have many methods other than these two.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Requirements:
LinkIt One board
Step 2: Connections
1) Connect LinkIt One to your computer using a USB A to micro B cable.
2) In the Arduino IDE, go to the Tools pull-down menu at the top, select Board, and make sure “LinkIt One” is checked.
3) Then pull down the Tools menu again, and select appropriate Serial Port.
If you have multiple serial ports to choose from and aren’t sure which to choose, try unplugging the board from your computer and plugging the board back again to see which port gets added.
The Arduino IDE has many examples
that we can use, we will run one of these now.
We will test our LinkItOne with the Blink Example that you can find under File -> Examples -> Basics -> Blink.
A new sketch window will open up with some code in it. Click the Upload button on the tool bar. It may take a moment to compile and upload to the board.
When it’s done, you’ll see the text “Done uploading” at the bottom.
Step 4: The Code
// the setup function runs once when you press reset or power the board
// initialize digital pin 13 as an output.
// the loop function runs over and over again forever
// turn the LED on (HIGH is the voltage level)
// wait for a second
// turn the LED off by making the voltage LOW
// wait for a second
I am using a Red LED that I hooked up to pin 13 by carefully inserting the anode in pin 13 and the cathode to ground. They have polarity which means we need to connect them in the right order. There are many ways to differentiate between cathode and anode of the LED, we can tell that by looking at the LED carefully in many ways.
The longer leg will be the cathode and the shorter will be the anode. When we examine the LED from the top we see the two metal posts, the smaller of the two is the anode and the bigger is the cathode
LinkIt One has digital and analog pins for input and output. Here by default our LED is hooked up to pin 13. To compile and run the sketch just hit the upload button. In the output you will see the transfer is complete and the LED is blinking. There is a little LED on the board that is also hooked up to pin 13 so if you don’t attach an external LED then that will also work for you.
Now we have successfully deployed our first sketch to LinkIt One. And we are ready to do more creative stuff with our powerful development board “LinkIt One”.