LinkIt ONE Tutorial - Hello World
Introduction
What We’re Doing
In the previous section we’ve got an insight about how to control an LED with electronic components but lets do some gimmicks with software for automatic control of the LED. You just have to upload the code that is available in this section. The code written initially switches ON the LED, after a delay of 3sec it switches it OFF. Let’s start using the LinkIt board.
Things you need
- LinkIt One x 1
- Break board x 1
- Resistors 330Ω,1kΩ x 1
- 5mm LED x 1
- Transistor(2N3904) x 1
Schematic
Connection
Code
Please click on the button below to download the code for the kit:
You can unzip the file to the Examples folder of your Arduino IDE.
To access the demo code open:
File -> Examples -> Starter Kit for LinkIt -> Basic -> L2_Control_LED
const int pinLED = 3; // LED connect to D13
void setup()
{
pinMode(pinLED, OUTPUT); // set direction of D13-OUTPUT
}
void loop()
{
digitalWrite(pinLED, HIGH); // LED on
delay(3000);
digitalWrite(pinLED, LOW); // LED off
delay(100);
}
Troubleshooting
- Trouble in Uploading the code?
- In this case, the possible problem should be due to wrong selection of the transfer port. You should probably modify it into “Tools> Serial port>“.
- Unable to Stop the process?
- This occurs when your code is running in an infinite loop so in order to terminate the process disconnect the power supply from the board.
Making it better
In the previous section we used a capacitor to grow the brightness of the LED slowly and fade its luminosity slowly. Lets do the same thing without the capacitor but by purely changing the code.
To open the demo code:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L2_Breath_LED
More ideas
How do you change the frequency of the LED by modifying the code?
Reference
Help us make it better
Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
- Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
- Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
- Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking
댓글 없음:
댓글 쓰기