2017년 2월 15일 수요일

LinkIt ONE Tutorial - Mini Servo



LinkIt ONE Tutorial - Mini Servo

Introduction

What We’re Doing
Servo motor (servo) is commonly used in small robots and other machines to control angular position. It is wrapped by a small gear box, and positioned by the timing control pulses. In this section we control the angular position of the mini servo with the help of potentiometer.
Things you need
  • LinkIt One x 1
  • Break board x 1
  • Slide Potentiometer 10kΩ x 1
  • Servo 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 -> L7_Servo
#include <Servo.h> Servo myservo; // create servo object to control a servo int potpin = A0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }
Troubleshooting
  • There are three pins in servos and they are color coded respective to their functionality yellow-analog port red – positive, dark brown – ground. So please make connections according to its functionality.
  • Ensure that 5v power supply is connected to the board.
Making it better
If the mini steering worked, we can adjust the speed of rotation by using a potentiometer. Upload the following code to produce different functionality.
To access the demo code open:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L7_Servo_Speed
More ideas
How do you control two servo motors simultaneously so that you can make a robot?
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

LinkIt ONE Tutorial - Marquee



LinkIt ONE Tutorial - Marquee

Introduction

What We’re Doing
The experiments in the previous sections used only one LED but to show dazzling light effects lets use three LEDs. Make connections as shown in the Fig 4.2 and upload the code given below and observe the changes that happens.
Things you need
  • LinkIt One x 1
  • Break board x 1
  • Resistors 330Ω,1kΩ x 3
  • 5mm LED x 3
  • Transistor(2N3904) x 3
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 -> L4_Control_LEDs
const int pinLed1 = 2; // pin of led1 const int pinLed2 = 3; // pin of led2 const int pinLed3 = 4; // pin of led3 void setup() { pinMode(pinLed1, OUTPUT); // set all pin OUTPUT pinMode(pinLed2, OUTPUT); pinMode(pinLed3, OUTPUT); } void loop() { digitalWrite(pinLed4, LOW); // led4 off digitalWrite(pinLed1, HIGH); // led1 on delay(100); digitalWrite(pinLed1, LOW); // led1 off digitalWrite(pinLed2, HIGH); // led2 on delay(100); digitalWrite(pinLed2, LOW); // led2 off digitalWrite(pinLed3, HIGH); // led3 on delay(100); digitalWrite(pinLed3, LOW); // led3 off digitalWrite(pinLed4, HIGH); // led4 on delay(100); }
Troubleshooting
  • Check the polarity of the LED’s.
  • Ensure that you have connected the LED’ to the correct port pins.
Making it better
Upload the following code with the same breadboard connection in order to obtain different flashing effects.
To access the demo code open:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L4_Control_LEDs_Speed
More ideas
Modify the existing code such that the frequency of LED blinking increases.
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

LinkIt ONE Tutorial - Light Sensor



LinkIt ONE Tutorial - Light Sensor

Introduction

What We’re Doing
It’s time to know about new sensors that could make our projects even more interesting. A photoresistor (light dependent resistor or photocell) is a light sensor which varies its resistance value based on the intensity of the ambient light. A buzzer is a electro-acoustic device used to generate standard tone when it is connected to the power supply. Lets use both these components in our experiments.
Things you need
  • LinkIt One x 1
  • Break board x 1
  • Resistors 10kΩ,1kΩ,330Ω x 1
  • Buzzer x 1
  • Photoresistor 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 -> L8_Light_Control_Buzzer
const int pinBuz = 3; // pin define of LED const int pinLight = A0; // pin define of Light Sensor void setup() { pinMode(pinBuz, OUTPUT); pinMode(pinLight, INPUT); } void loop() { int value = analogRead(pinLight); value = map(value, 0, 1023, 255, 0); analogWrite(pinBuz, value); delay(100); }
Troubleshooting
  • Photosensitive does not work ?
    • Photoresistor lead’s wire spacing is not standard. It is easy to short the leads. Carefully check.
  • No Sound?
    • Buzzer leads are very short. Carefully check if they are properly inserted in the breadboard.
Making it better
Lets control the tone of the buzzer further using the photoresistor. Different tones can be generated if you vary the light intensity that falls on the photo resistor. Upload the following code and observe the difference.
To access the demo code open:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L8_Buzzer_Music
More ideas
We can make more interesting applications using photocell. Try making a light-sensitive Christmas gift.
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

LinkIt ONE Tutorial - Hello World



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

LinkIt ONE Tutorial - Get temperature with Webpage



LinkIt ONE Tutorial - Get temperature with Webpage

Introduction

What We’re Doing
LinkIt One with Wi-Fi communication function. We have collected some data through the LinkIt One. As the Internet AP to support data access by providing Web Server. Access to the corresponding IP address can get the data with browser. Next step you need to connect circuit, data acquisition from temperature sensor. Then well equipped with Wi-Fi antennas you and connected to the network, please have a choise with the network fill in the three parameters, the network name (WiFi_AP), access password (WIFI_PASSWORD), and transmission mode of router (options LWIFI_OPEN, LWIFI_WPA, LWIFI_WEP). Finally, the code is uploaded to the LinkIt One. Use of terminal device with network, open the browser and enter the IP address will obtain the temperature data. (Visit the IP address assignment via DHCP router access)
Things you need
  • LinkIt One x 1
  • Break board x 1
  • Resistors 330Ω x 1
  • Wi-Fi ANT 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 -> L10_Web_Temp
Note that you should open the Serial monitor to input anything to start the program.
Troubleshooting
  • Antenna do not work ?
    • Attention to check the antenna connection is stable connection. (Antenna socket on the back, marked as Wi-Fi/BT ANT)
  • Where is the IP address?
    • First adjust the serial mode (DEBUG - >MOLDE), you can query through the serial port. Click on the upper right corner of the compiler, magnifying chart. Standard query the assigned IP address. (Please click on this step to change Tools - >Port - >COMX)
Making it better
Do you want to change the data in real time? We through the Web port to monitor a variation of light sensitivity value.
To access the demo code open:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L10_Web_Temp_Advanced
More ideas
If want to control the LinkIt One with web. How control the work of hardware can be?
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

LinkIt ONE Tutorial - Colorful World



LinkIt ONE Tutorial - Colorful World

Introduction

What We’re Doing
We now know how to control the LED’s lets combine it with basic idea about combining colors. The R-Red G-Green B-Blue are the primary colors these colors when mixed in different proportion gives different colors. An RGB LED consists of four pins the long lead is the positive terminal and the other three lead are for controlling RGB colors. Make connections as shown in the Fig5.2 and upload the code.
Things you need
  • LinkIt One x 1
  • Break board x 1
  • Resistors 330Ω,10kΩ,1kΩ x 3
  • 8mm RGB LED x 1
  • Transistor(2N3904) x 3
  • Button x 3
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 -> L5_Color_Pannel
const int ledR = 2; const int ledB = 3; const int ledG = 4; const int buttonR = 5; const int buttonG = 6; const int buttonB = 7; void setup() { pinMode(ledR, OUTPUT); // set all led pin OUTPUT pinMode(ledG, OUTPUT); pinMode(ledB, OUTPUT); pinMode(buttonR, INPUT); // set all button pin INPUT pinMode(buttonG, INPUT); pinMode(buttonB, INPUT); } void loop() { int stateR = 1-digitalRead(buttonR); // get state of button int stateG = 1-digitalRead(buttonG); int stateB = 1-digitalRead(buttonB); digitalWrite(ledR, stateR); // set led digitalWrite(ledG, stateG); digitalWrite(ledB, stateB); delay(10); }
Troubleshooting
  • Wrong color display
    • Since there are four pins in the LED, there exists probability of error in the connection make sure that all the control pins are connected to the correct leads
  • Reddish appearance?
    • In RGB LED, red color has high intensity than the other two colors for a given voltage. In order to make the colour overall tone in harmony, try to reduce the intensity of RED LED with a larger resistance value.
Making it better
Do you want to get more colors? There are two buttons to adjust the RGB values of successive rises. Then we can find more colors. Try to build the circuit linking the two analog output interface (RGB values were increased higher or lower). Code has been defined to get it. (PWM analog output, you get a return value of the output of the analog 0-1023 to use.)
To open the demo code:
File -> Examples -> Starter Kit for LinkIt -> Extend_Lesson –> L5_Colourful_RGB
More ideas
How expand the code to turn down the RGB values?
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