Arduino Starter Kit

November 15, 2017 | Author: nascosta | Category: Arduino, Manufactured Goods, Computer Engineering, Electronics, Electronic Engineering
Share Embed Donate


Short Description

Download Arduino Starter Kit...

Description

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Arduino Starter kit Users Manual What is the Arduino Starter Kit ?

Package Include: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,

1 X Arduino Duemilnove ATmega 328 board 1 X Prototyping Shield 1 X Mini breadbord 1 X bundle Breadboard Jump Wires (Approximately 70 pcs) 1 X 9v power adapter 1 X 40Pin Straight Male Headers 1 X Universal board 1 X IR Remote Control 1 X Infrared Receiver 1 X LM35 Temperature Sensor 1 X Ambient Light sensor 1 X Tilt switch sensor 1 X 1602 LCD Dispaly ( default blue one, or you can choose the green one) 1 X 7seg-4digit LED Display 1 X Rotary Potentiometer www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,

Ebay store: b2cqshop ,

E-qstore

1 X Buzzer 5 X Mini Push Button 1 X 2P Screw Terminal Block Connector 5mm 4 X Red LED 3mm 4 X Yellow LED 3mm 4 X Green LED 3mm 2 X Blue LED 3mm 1 X color LED 5mm 10 X 220Ω Resistors 10 X 1 kΩ Resistors 10 X 10 kΩ Resistors 1x High quality electronic tool plastic Box Email CD ROM information( Lessons and User Manuals )

Mini Solderless Breadboard The mini breadboard has 170 Tie points. It is Compatible with all kind of ProtoShield. Completely reusable,Reusable for fast build a prototype of an electronic circuit. With Twin adhesive back, it could be fix and remove to any position easily. Its Dimension: 45mm (L) X 34.5mm (W) X 9.5mm (H).

This mini breadboard has 10 rows 17 columns point. And the top and bottom Five row columns are separate columns, with no internal connections made between them inside the breadboard. The only five internal connections inside the breadboard are to any five vertical consecutive holes . So the five point which are in one column is connected internally.

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Start with Arduino Overview What is Arduino? Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be stand-alone, or they can be communicate with software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free. With this kit you can make a lot of interesting projuct.

Features : www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

1, 2, 3,

Ebay store: b2cqshop ,

E-qstore

Input Voltage (recommended): 7-12V Digital I/O Pins : 14 (of which 6 provide PWM output) Analog Input Pins : 6

4, Support SPI communication. program the microcontroller through the ICSP (In-Circuit Serial Programming) header 5, For Input power supply : It can be powered via the USB connection or with an external power supply. Note : External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery, And the recommended range is 5V to 9V DC. 6, Output voltage: 5V and 3. 3V and VIN. VIN : The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin. 7, Using Atmel Atmega328 microprocessor controller . 8, Sizes (W * H): 70mm X 54mm.

Language Reference The Arduino language is based on C / C + + . Arduino programs can be divided in three main parts: structure, values (variables and constants), and functions. You can check them in the Arduino website : http://arduino.cc/en/Reference/HomePage

/*****************

Basic C language: ********************/

Control Structures if if...else for switch case while do... while break continue return goto

Further Syntax ; (semicolon) {} (curly braces) // (single line comment) /* */ (multi-line comment) #define www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Ebay store: b2cqshop ,

E-qstore

#include Operators = (assignment operator) + (addition) - (subtraction) * (multiplication) / (division) % (modulo) == (equal to) != (not equal to) < (less than) > (greater than) = (greater than or equal to) && (and) || (or) ! (not) ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) Data Types ( Variables ) void boolean char unsigned char byte int unsigned int word long unsigned long float double string - char array String - object array Constants ( Variables ) www.bestqshop.com

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

HIGH | LOW It means a different meaning depending on whether a pin is set to INPUT or OUTPUT . HIGH: means high potential (+). INPUT | OUTPUT INPUT : to be in a high-impedance state OUTPUT : to be in a low-impedance state true | false false : is defined as 0 (zero). true : is often said to be defined as 1, which is correct, but true has a wider definition. Any integer which is non-zero is TRUE, in a Boolean sense. So -1, 2 and -200 are all defined as true, too, in a Boolean sense.

/*******************************************************************/ /*****************

Arduino Language ********************/

Structure: setup() The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board. loop() After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.

Functions Digital I/O pinMode() Syntax : pinMode(pin, mode) Configures the specified pin to behave either as an input or an output. ( 0 ~ 13 ). Mode: either INPUT or OUTPUT digitalWrite() Syntax : digitalWrite(pin, value) Write a HIGH or a LOW value to a digital pin. HIGH or LOW . For example: light a LED.

Digital pins : ( 0 ~ 13 ). value:

digitalRead() Syntax : digitalWrite(pin, value) Reads the value from a specified digital pin, either HIGH or LOW. www.bestqshop.com

Ebay store: b2cqshop ,

Digital pins :

E-qstore

Digital pins :

www.bestqshop.com

( 0 ~ 13 ).

value: HIGH or LOW .

Ebay store: b2cqshop ,

E-qstore

For example : read the digital sensor’s value.

Analog I/O analogRead() Syntax : int analogReference(pin) Reads the value from the specified analog pin. pins : 0 ~ 5 (Arduino Diecimila: 0 ~ 5 ; Arduino nano : 0~7). The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega) For example : in the analog sensor (10-bit analog to digital converter. ) , this means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. analogWrite() // PWM Syntax : analogWrite(pin, value) Writes an analog value (PWM wave) to a pin. Pin : On most Arduino boards (those with the ATmega168 or ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11. On the Arduino Mega, it works on pins 2 through 13. Older Arduino boards with an ATmega8 only support analogWrite() on pins 9, 10, and 11. value: the duty cycle: between 0 (always off) and 255 (always on). For example : in the analog sensor (10-bit analog to digital converter. ) , this means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023.

Time delay() Pauses the program for the amount of time (in miliseconds) specified as parameter. (There are 1000 milliseconds in a second.) delayMicroseconds() Pauses the program for the amount of time (in microseconds) specified as parameter. Math min() : Calculates the minimum of two numbers. max() : Calculates the maximum of two numbers. abs() : Computes the absolute value of a number. constrain() : Constrains a number to be within a range. map() : Re-maps a number from one range to another. pow() : Calculates the value of a number raised to a power. sqrt() : Calculates the square root of a number. /*****************************************************************************/

How to use Arduino board www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Now, go ahead. Let.s begin with the actual operation of this kit.

1. Ready ( 1 ).

Find out the Prototype shield and mini breadboard from your

tool plastic Box . The item like the following picture:

( 2 ) Find out the arduino controller (Duemilnove ATmega 328 board) from your tool box too. ( 3 ).

plug the Prototype shield to the Arduino 328 controller.

2. Download the Arduino Development Environment Go to the Arduino website to download the software that can be run on your Operating System. http://arduino.cc/en/Main/Software

3. Download the USB Driver 1. First, find out the USB cable, and plug one side of the cable to your arduino Atmage 328 board. ( such as the following picture ).

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

2 . And then , plug the other side to your computer’s USB interface. ( such as the following picture ).

3. At this time , the power LED of Atmage 328 board will be light. And your computer will will appear A dialog box like this picture. ( I am sorry the the Operating System showing Chinese.)

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

4 . Choose from “ a list or specific location ” ,

5,

find out the Folder

E-qstore

and the click “ Next ” .

: arduino-0018\drivers\FTDI USB Drivers

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Ebay store: b2cqshop ,

E-qstore

6 , Then click “ Next ” .

7,

Finally, click

“Finish”.

www.bestqshop.com

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

. Now, you can connect your arduino board to the computer , and upload my programs to the Arduino board.

3. Upload my programs (1) Make sure you have the right item selected in the Tools > Board menu. In particular, newer Arduino Duemilanove boards come with an ATmega328, while older ones have an ATmega168. To check, read the text on the microcontroller (the larger chip) on your Arduino board.

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

(2) Check that the proper port is selected in the "Tools > Serial Port" menu (if your port doesn't appear, restart the IDE with the board connected to the computer).

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

For the “ Serial Port” , you can check it in your computer’s Device Manager

(3) Write down your program to a new arduino file.

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Ebay store: b2cqshop ,

E-qstore

(4) And then compile it.

Then it will show

(5) Upload the program to your board. www.bestqshop.com

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

When it show “Done Uploading” , That is great , the Arduino experiment works well . www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Experiment Lesson 1 : Color LED Flashing 1. What is an LED ?

The internal structure Of LED.

The longer one lead is Anode ( “+”), the another one is Cathode (“ --”) .

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

2,

Ebay store: b2cqshop ,

E-qstore

The wiring of LED

First Experiment: Prepare: 1 X

LED , 1 X 220-ohm resistor , some Jumper cable.

To build the circuit, grab an LED and attach its long, positive leg (called the anode) to pin 8 through a 220-ohm resistor . Connect the cathode (the shorter, negative leg) directly to ground.

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Code :

Ebay store: b2cqshop ,

E-qstore

open the folder led1, and open the led1.pde

In the program below, the first thing you do is to initialize pin 8 as an output pin with the line pinMode(8, OUTPUT); In the main loop, you turn the LED on with the line: digitalWrite(8, HIGH); This supplies 5 volts to pin 8. That creates a voltage difference across the pins of the LED, and lights it up. Then you turn it off with the line: digitalWrite(8, LOW); That takes pin 8 back to 0 volts, and turns the LED off. In between the on and the off, you want enough time for a person to see the change, so the delay() commands tell the Arduino to do nothing for 1000 milliseconds, or one second. When you use the delay() command, nothing else happens for that amount of time. Once you've understood the basic examples, check out the BlinkWithoutDelay example to learn how to create a delay while doing other things. int ledPin=8 //设定控制 LED 的数字 IO 脚 void setup() { pinMode(ledPin,OUTPUT);//设定数字 IO 口的模式,OUTPUT 为输出 } void loop() { digitalWrite(ledPin,HIGH); //设定 PIN8 脚为 HIGH = 5V 左右 delay(1000); //设定延时时间,1000 = 1 秒 digitalWrite(ledPin,LOW); //设定 PIN8 脚为 LOW = 0V delay(1000); //设定延时时间,1000 = 1 秒 }

From the code , We can know that arduino language start with setup() function, and Use loop() function to actively control the Arduino board . setup() function is used to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board. loop() : After creating a setup() function, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board. In this First Experiment, you can find that the LED flashes per 1 second.

Second Experiment: Prepare: 6 X LED , 6 X 220-ohm resistor , some Jumper cable. To build the circuit, attach LED to digital IO pin 1, 2, 3, 4, 5, 6 through 220-ohm resistor . www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

Connect the cathode (the shorter, negative leg) directly to ground.

Code : open the folder led2, and open the led2.pde Usually, we can see Billboard flashing various colors. This is because a variety of LED in diferent localtion changing on or off . In this experiment, we use LEDs to show as the billboard. You can set the time and the sequence of flashing, so that it show different effect. //设置控制 Led 的数字 IO 脚 int Led1 = 1; int Led2 = 2; int Led3 = 3; int Led4 = 4; int Led5 = 5; int Led6 = 6; //led 灯花样显示样式 1 子程序 void style_1(void) { unsigned char j; for(j=1;j=1;j--)//每隔 200ms 依次熄灭 6~1 引脚相连的 led 灯 { digitalWrite(j,LOW);//熄灭 j 引脚相连的 led 灯 delay(200);//延时 200ms } } //灯闪烁子程序 www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

www.bestqshop.com

Ebay store: b2cqshop ,

E-qstore

void flash(void) { unsigned char j,k; for(k=0;k
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF