background image

SainSmart UNO R3 Starter Kit For Arduino

 

        digitalWrite(ledPin, HIGH); //when the value of val is less than 512(2.5V), light up led lamp 
        }   
        else{   
        digitalWrite(ledPin, LOW); 
        }   

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Summary of Contents for UNO R3

Page 1: ...physical computing platform which is based on the Processing multimedia programming environment Feature Schematic design of the open source development interface free download and also according to t...

Page 2: ...or battery to get started Performance Revision 3 is the last SainSmart UNO development board version Parameter 3 3V 5V Supply Voltage and IO Voltage can be switched at the same time More 3 3V modules...

Page 3: ...grammar not only put some related parameters Settings are function change we have no need to understand his bottom let us to know AVR micro control unit MCU friend can also easy to fit in So here I ll...

Page 4: ...use can combine experimental procedure Structure void setup The setup function is called when a sketch starts Use it to initialize variables pin modes start using libraries etc The setup function wil...

Page 5: ...in miliseconds specified as parameter There are 1000 milliseconds in a second unit ms delayMicroseconds us Math min x y minimum value max x y maximum value abs x absolute value constrain x a b Constra...

Page 6: ...intln Hello World void loop Explain Serial begin 9600 The comment says 9600 bps and just so you know bps stands for bits per second we will refer to this as the baud rate Communicate with computer you...

Page 7: ...SainSmart UNO R3 Starter Kit For Arduino...

Page 8: ...pment we need is the Arduino which each experiment must have and USB download cable Next we connect small lamp in accordance with the following experimental schematic physical map Accordance with the...

Page 9: ...Kit For Arduino define interface is output light up led lamp delay 1s go out led lamp delay 1s After downloading the program you can see our 13 foot LED lights flashing so that our small lights flicke...

Page 10: ...lectron and hole recombination can radiate visible light and thus can be used to prepare a light emitting diode in the circuit and the instrument as the indicator or the composition of the text or dig...

Page 11: ...delay 1000 delay 1000ms 1000ms 1s 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...

Page 12: ...is a steady voltage between 0 and 5v controlling the brightness of the LED In the graphic below the green lines represent a regular time period This duration or period is the inverse of the PWM freque...

Page 13: ...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 The Arduino Due supports analogWrite on pins 2 th...

Page 14: ...t the value is the amount of brightness variations change void setup pinMode 9 OUTPUT set pin9 is output void loop analogWrite 9 brightness write the value of brightness in pin9 brightness brightness...

Page 15: ...SainSmart UNO R3 Starter Kit For Arduino Chapter5 Advertising LED Experiment component LED lamp 6 220 resistors 6 Breadboard Jumper wires Connect your circuit as the below diagram...

Page 16: ...ned char j for j 1 j 6 j every 200ms light up one of led lamps with 1 6 pin in turn digitalWrite j HIGH light up the led lamps with j pin delay 200 delay 200ms for j 6 j 1 j every 200ms got out one of...

Page 17: ...ub 2 led lamp run the example 3 program void style_3 void unsigned char j k led lamp run the example 3 program k 5 set k is 5 for j 1 j 3 j digitalWrite j HIGH light up digitalWrite j k HIGH light up...

Page 18: ...enclosed in curly braces An increment counter is usually used to increment and terminate the loop The for statement is useful for any repetitive operation and is often used in combination with arrays...

Page 19: ...Double click the icon to open it Then you will see that it is the arduino programming software window with the experimental program code int ledred 10 define digital pin10 red int ledyellow 7 define d...

Page 20: ...it For Arduino digitalWrite ledyellow HIGH light up yellow lamp delay 200 delay 200 ms digitalWrite ledyellow LOW go out digitalWrite ledgreen HIGH light up green lamp delay 1000 delay 1000 ms digital...

Page 21: ...their drive different way teach you to distinguish between active buzzer and passive buzzer A small buzzer for sale on the market now because of its small size diameter is only 11mm light weight low p...

Page 22: ...sue and the resistance is more than hundreds of Europe that is active buzzer Active buzzer directly connected to the rated power indicate on the new buzzer s label can be continuous sound rather passi...

Page 23: ...dboard Jumper wires Connect your circuit as the below diagram Example code int buzzer 7 set buzzer s digital pin IO in control void setup pinMode buzzer OUTPUT set digital pin IO OUTPUT void loop unsi...

Page 24: ...loops Description while loops will loop continuously and infinitely until the expression inside the parenthesis becomes false Something must change the tested variable or the while loop will never ex...

Page 25: ...ferent physical mechanism This type of sensor is the environmental friendly version of a mercury switch It contains a metallic ball inside that will commute the two pins of the device from on to off a...

Page 26: ...SainSmart UNO R3 Starter Kit For Arduino Example code void setup pinMode 8 OUTPUT set pin8 output void loop int i define i while 1...

Page 27: ...SainSmart UNO R3 Starter Kit For Arduino i analogRead 5 read voltage values of pin5 if i 200 if more than 512 2 5V digitalWrite 8 HIGH light up led lamp else digitalWrite 8 LOW go out led lamp...

Page 28: ...log pin 0 while the pin is an input Be aware however that turning on a pullup will affect the value reported by analogRead when using some sensors if done inadvertently Most users will want to use the...

Page 29: ...ound from one of the outer pins of the potentiometer The second goes from 5 volts to the other outer pin of the potentiometer The third goes from analog input 2 to the middle pin of the potentiometer...

Page 30: ...0 void setup pinMode ledpin OUTPUT set analog pin13 output Serial begin 9600 set baud rate 9600 void loop digitalWrite ledpin HIGH light up led in pin13 delay 50 delay 0 05s digitalWrite ledpin LOW go...

Page 31: ...terial these production materials having characteristics in light of a specific wavelength its resistance decreases rapidly This is due to the light generated carriers are involved in the electrical c...

Page 32: ...age int ledPin 12 define ledPin12 is the output port of led s level int val 0 define original of val void setup pinMode ledPin OUTPUT set ledPin output void loop val analogRead photocellPin get the va...

Page 33: ...SainSmart UNO R3 Starter Kit For Arduino digitalWrite ledPin HIGH when the value of val is less than 512 2 5V light up led lamp else digitalWrite ledPin LOW...

Page 34: ...s a core part of the temperature measuring instruments and a wide variety In accordance with the measurement method is divided into contact and non contact two major categories In accordance with the...

Page 35: ...e few Connection First ready experimental board Follow the LM35 temperature sensor connection connected to VOUT is connected to an analog 0 Such temperature alarm experimental circuit connected Experi...

Page 36: ...perature Serial print dat print the value of dat Serial println C print C means degree delay 500 delay 0 5s Program function Download the program to the experimental board open the monitor you can see...

Page 37: ...SainSmart UNO R3 Starter Kit For Arduino Chapter12 Nixie tube Experiment component digital tube x1 220 resistance x4 Breadboard jumper wire Connect your circuit as the below diagram...

Page 38: ...11 j go out else digitalWrite j HIGH digitalWrite dp HIGH go out decimal point dp display number2 void digital_2 void unsigned char j digitalWrite b LOW digitalWrite a LOW for j 9 j 11 j digitalWrite...

Page 39: ...id digital_5 void unsigned char j for j 7 j 9 j digitalWrite j LOW digitalWrite c LOW digitalWrite d LOW digitalWrite dp HIGH digitalWrite b HIGH digitalWrite e HIGH display number6 void digital_6 voi...

Page 40: ...rite j LOW digitalWrite dp HIGH void setup int i define i for i 4 i 11 i pinMode i OUTPUT set pin4 pin11 output void loop while 1 digital_1 number 1 delay 2000 delay 2s digital_2 delay 2000 digital_3...

Page 41: ...t digital tube Digital tube has be divided into 1 2 4 and so on digital tube depend on how many 8 it can show Digital tube is divided into common anode digital tube and common cathode digital tube by...

Page 42: ...ponding fields are alight when a field emitting cathode of the diode is low which are not bright when a field of the cathode is high Connection One end of the current limiting resistor plugged into th...

Page 43: ...miting resistor connection The first one is connected with D1 d4 anode totally connect four This connection method s benefit is needs of relatively less resistance but generates different the digital...

Page 44: ...SainSmart UNO R3 Starter Kit For Arduino Refer to figure below wiring for the 5643S...

Page 45: ...ne the parameters set anode interface int a 1 int b 2 int c 3 int d 4 int e 5 int f 6 int g 7 int p 8 set cathode interface int d4 9 int d3 10 int d2 11 int d1 12 Set variables long n 0 int x 100 int...

Page 46: ...earLEDs pickDigit 1 pickNumber n x 1000 10 delayMicroseconds del clearLEDs pickDigit 2 pickNumber n x 100 10 delayMicroseconds del clearLEDs pickDigit 3 dispDec 3 pickNumber n x 10 10 delayMicrosecond...

Page 47: ...igitalWrite d1 LOW break case 2 digitalWrite d2 LOW break case 3 digitalWrite d3 LOW break default digitalWrite d4 LOW break void pickNumber int x define pickNumber x Its role is to show digital x swi...

Page 48: ...d clearLEDs clear the screen digitalWrite a LOW digitalWrite b LOW digitalWrite c LOW digitalWrite d LOW digitalWrite e LOW digitalWrite f LOW digitalWrite g LOW digitalWrite p LOW void zero Define th...

Page 49: ...ite b HIGH digitalWrite c LOW digitalWrite d HIGH digitalWrite e HIGH digitalWrite f LOW digitalWrite g HIGH void three digitalWrite a HIGH digitalWrite b HIGH digitalWrite c HIGH digitalWrite d HIGH...

Page 50: ...ite b LOW digitalWrite c HIGH digitalWrite d HIGH digitalWrite e HIGH digitalWrite f HIGH digitalWrite g HIGH void seven digitalWrite a HIGH digitalWrite b HIGH digitalWrite c HIGH digitalWrite d LOW...

Page 51: ...lWrite c HIGH digitalWrite d HIGH digitalWrite e LOW digitalWrite f HIGH digitalWrite g HIGH In front of setup defined range of digital display routines the definition of these subroutines can be easy...

Page 52: ...lights just with Arduino how many its I O will be occupied The answer is eight However one arduino uno only have 20 I O port 8 small lights have take up too many resources The purpose we use 74HC595...

Page 53: ...SainSmart UNO R3 Starter Kit For Arduino This schematic seems are complex after analysis and combined with reference we will find it very simple...

Page 54: ...ND int ledState 0 void setup pinMode latchPin OUTPUT pinMode clockPin OUTPUT pinMode dataPin OUTPUT void loop int delayTime 100 for int i 0 i 256 i updateLEDs i delay delayTime void updateLEDs int val...

Page 55: ...ay pin position What s more the IN4001 diodes are divided into positive and negative Do not look at the relay circuit is slightly complex but the kiev program is very simple The relay is digital signa...

Page 56: ...O R3 Starter Kit For Arduino Result We will see small red lights and green lights flashing take turns This is the end of this chapter s experiment we hope that you could enjoy it and create more inter...

Page 57: ...SainSmart UNO R3 Starter Kit For Arduino Chapter15 8x8 matrix LEDs The following figure is a matrix LED internal schematic Wiring diagram One LED of LED 8X8 matrix is lit as follows...

Page 58: ...the row pin 2 const int row8 14 the number of the row pin 5 the pin to control COl const int col1 6 the number of the col pin 13 const int col2 7 the number of the col pin 3 const int col3 8 the numbe...

Page 59: ...w3 LOW digitalWrite row4 LOW digitalWrite row5 LOW digitalWrite row6 LOW digitalWrite row7 LOW digitalWrite row8 LOW digitalWrite col1 LOW digitalWrite col2 HIGH digitalWrite col3 HIGH digitalWrite co...

Page 60: ...SainSmart UNO R3 Starter Kit For Arduino The code in the folder 8x8 the matrix LEDs experimental can be used as a reference made more exciting experiments...

Page 61: ...he specific frequency of the signal and restoring it into a binary pulse code That is demodulated How it work Built in receiver tube infrared emission tube emitted light signal is converted to a weak...

Page 62: ...out NEC protocol NEC protocol introduction Feature 1 8 bit address spaces 8 bit command spaces 2 address bits and command bits are transmitted twice for reliability 3 Pulse position modulation 4 Carri...

Page 63: ...ll divided receiving end s wave form into four parts Primer searching code 9ms And 4 5ms pulse the address code 16 including an 8 bit address and 8 bit address is negated the command code 16 package I...

Page 64: ...ion TCCR1A 0X00 TCCR1B 0X05 set timer clock source TCCR1C 0X00 TCNT1 0X00 TIMSK1 0X00 Ban timer interrupt overflow void remote_deal void Implement the decoding function data presentation Serial printl...

Page 65: ...ar Analysis of the remote control code user code value for i 0 i 16 i if logic_value 1 if 1 ir_code 1 i Save key value Analytical remote control code commands in the code for i 0 i 8 i if logic_value...

Page 66: ...h TCNT1 TCNT1 0 if Pulse_Width 140 Pulse_Width 141 9ms while digitalRead IR_IN if high wait Pulse_Width TCNT1 TCNT1 0 if Pulse_Width 68 Pulse_Width 72 4 5ms pulse_deal return else if Pulse_Width 34 Pu...

Page 67: ...SainSmart UNO R3 Starter Kit For Arduino while 1 remote_decode decode remote_deal Executive decoding results...

Reviews: