Movatterモバイル変換


[0]ホーム

URL:


GJ
Uploaded byGovind Jha
PPT, PDF1,395 views

Arduino Platform with C programming.

The document provides an overview of the Arduino platform, highlighting its microcontroller features, programming capabilities, and ease of use in control systems. It details components of the Arduino board, how it operates, and its programming environment using the Arduino IDE, along with various data types and control statements in C programming. Additionally, it touches on the availability of shields for complex tasks and the Arduino toolchain for compiling and uploading code.

Embed presentation

Downloaded 88 times
THE ARDUINO PLATFORMAND C PROGRAMMINGPRESENTED BYPRESENTED BYGOVIND JHAGOVIND JHA
What is Arduino?A microcontroller board, contains on-board power supply, USB port to communicatewith PC, and an Atmel microcontroller chip.It simplify the process of creating any control system by providing the standard boardthat can be programmed and connected to the system without the need to anysophisticated PCB design and implementation.It is an open source hardware, any one can get the details of its design and modify itor make his own one himself.
Arduino Development BoardArduino Development Board• Eight bit microcontroller – brain of the boardEight bit microcontroller – brain of the board• USB Port – to communicate with theUSB Port – to communicate with thedesktop/laptopdesktop/laptop• USB controller chip – manages USB transferredUSB controller chip – manages USB transferreddatadata• IO pins – board’s connection to the outside worldIO pins – board’s connection to the outside world• Quartz oscillator – board’s time keeperQuartz oscillator – board’s time keeper• Reset button – taking the board back to its initialReset button – taking the board back to its initialstatestate• External power jack – power from dedicatedExternal power jack – power from dedicatedsourcesourceCo-axial jack, but USB can also be used.Co-axial jack, but USB can also be used.
Arduino UNO:Arduino UNO:Digital output~: PWM.0,1: Serial port.In circuit SerialprogrammingAtmelMicroControllerAnalog input.Power SupplyUSB portPower input
Input/output Pins (I/OPins)Input/output Pins (I/OPins)• Top and bottom rows of the boardTop and bottom rows of the board• Holes in the board which we can stick wires inHoles in the board which we can stick wires in• Holes are connected to the chips through traces on-boardHoles are connected to the chips through traces on-board• 14 Digital I/O pins on top [0-13]14 Digital I/O pins on top [0-13]• Highs – 5 voltsHighs – 5 volts Lows – 0 voltsLows – 0 voltsMax Current - 40 mAMax Current - 40 mA• 6 Analog input pins on the bottom [A0 – A5]6 Analog input pins on the bottom [A0 – A5]• Power output pins on the bottom [ 5v , 3.3 v ]Power output pins on the bottom [ 5v , 3.3 v ]• Reset pin to reset the board to initial state.Reset pin to reset the board to initial state.
MicrocontrollersMicrocontrollers• Two microcontrollers on the boardTwo microcontrollers on the board• Main ATmega328 – 8 bit microcontrollerMain ATmega328 – 8 bit microcontroller• User programmable, runs user-written application codeUser programmable, runs user-written application codeCarries firmware, like bootloaderCarries firmware, like bootloader• ATmega16U2ATmega16U2• Handles the communication with the USB interface, notHandles the communication with the USB interface, notdirectly accessibledirectly accessible
Storage and MemoryStorage and Memory•Non-volatile flash memory for storageNon-volatile flash memory for storage•32 kilobytes in size32 kilobytes in size•Static Random Access Memory (SRAM) for memoryStatic Random Access Memory (SRAM) for memory(volatile)(volatile)•3 kilobytes in size3 kilobytes in size
ClockClock• 16 MHz clock speed ~ 16 million operations per16 MHz clock speed ~ 16 million operations persecondsecond• Helps synchronize all components togetherHelps synchronize all components together• Keeping track of occurrence of eventsKeeping track of occurrence of events
Programming FirmwareProgramming Firmware• The ISCP headers can be used to program theThe ISCP headers can be used to program thefirmware on the boardfirmware on the board• ICSP1 for the main ATmega328 microcontrollerICSP1 for the main ATmega328 microcontroller• ICSP2 for the ATmega16U2 microcontrollerICSP2 for the ATmega16U2 microcontroller• Special equipment are required in order to re-Special equipment are required in order to re-program the firmware through these headersprogram the firmware through these headers
Software EnvironmentSoftware Environment• Arduino IDE – Integrated Development EnvironmentArduino IDE – Integrated Development Environment• Can be programmed using other IDEs too, like EclipseCan be programmed using other IDEs too, like Eclipse• Arduino IDE is more versatileArduino IDE is more versatile• Needs no special drivers or additional componentsNeeds no special drivers or additional components• Available for Windows, Linux and MacAvailable for Windows, Linux and Mac• Cross compiler – compiles for a different target platform than the one beingCross compiler – compiles for a different target platform than the one beingprogrammed onprogrammed on
IDE – Software Tool forIDE – Software Tool forProgrammingProgramming• File operations and other general options on topFile operations and other general options on top• Buttons for most commonly used options (Verify, Upload,Buttons for most commonly used options (Verify, Upload,etc.)etc.)• Main window – Text editor for writing codeMain window – Text editor for writing code• Message area – for messages to the programmerMessage area – for messages to the programmer
Options ButtonsOptions ButtonsButtons on the top have the most common ,useful operationsButtons on the top have the most common ,useful operationsVerify – compiles the code and checks for errorsVerify – compiles the code and checks for errorsUploads – compiles the code, uploads it to the board. Works only ifUploads – compiles the code, uploads it to the board. Works only ifthe board is connectedthe board is connectedNew – creates a new sketch, a new programNew – creates a new sketch, a new programOpen – opens an existing sketchOpen – opens an existing sketchSave – saves the current sketch in the directory of your choiceSave – saves the current sketch in the directory of your choiceSerial Monitor – opens window to communicate with the boardSerial Monitor – opens window to communicate with the board
Arduino ShieldsArduino Shields• The prominent reason that Arduino got so popularThe prominent reason that Arduino got so popular• Additional hardware to do particular, complex tasksAdditional hardware to do particular, complex tasks• Form of separate boardsForm of separate boards• Pre-wired pins that stick into holes in ArduinoPre-wired pins that stick into holes in Arduino• Stack on top of the Arduino to make connectionsStack on top of the Arduino to make connections• Pre-written functions for operations of these boardsPre-written functions for operations of these boards• Open-source designs in most of the cases, third partyOpen-source designs in most of the cases, third party•
• IntegerInteger: used with integer variables with value between2147483647 and -2147483647.Ex: int x=1200;• CharacterCharacter: used with single character, represent value from -127 to128.Ex. char c=‘r’;• LongLong: Long variables are extended size variables for numberstorage, and store 32 bits (4 bytes), from -2,147,483,648 to2,147,483,647.Ex. long u=199203;• Floating-point:Floating-point: Numbers can be as large as 3.4028235E+38 andas low as -3.4028235E+38. They are stored as 32 bits (4 bytes) ofinformation.Ex. float num=1.291; [The same as doubledouble type]Data Types and OperatorsData Types and Operators
Statement represents a command, it ends with ;;Ex:int x;x=13;Operators are symbols that used to indicate a specific function:- Math operators: [+,-,* ,/,%,^+,-,* ,/,%,^]- Logic operators: [==, !=, &&, ||==, !=, &&, ||]- Comparison operators: [==, >, <, !=, <=, >===, >, <, !=, <=, >=]Syntax:;; Semicolon, {}{} curly braces, ////single line comment, /*/* Multi-lineco m m e nts * /* /Statement and OperatorsStatement and Operators
Compound Operators:Compound Operators:++ (increment)-- (decrement)+= (compound addition)-= (compound subtraction)*= (compound multiplication)/= (compound division)Statement and OperatorsStatement and Operators
If Conditioning:If Conditioning:if(co nditio n){state m e nts-1 ;…State m e nt-N;}else if(co nditio n2 ){State m e nts;}Else{state m e nts ;}Control StatementsControl Statements
Switch case:Switch case:switch (var) {case 1 ://do so m e thing whe n var e q uals 1bre ak;case 2://do so m e thing whe n var e q uals 2bre ak;de fault:// if no thing e lse m atche s, do the de fault// de fault is o ptio nal}Control StatementsControl Statements
Do… while:Do… while:do{Statements;}while(condition); // the statements are run at least once.While:While:While(condition){statements;}forforfor (int i=0; i <= val; i++){statements;}Loop StatementsLoop Statements
Void setup(){}Void setup(){}Used to indicate the initial values of system on starting.Void loop(){}Void loop(){}Contains the statements that will run whenever the system is poweredafter setup.Code StructureCode Structure
Arduino Tool chainArduino Tool chain• Steps taken post code authoringSteps taken post code authoring• Source code(sketch) is compiled to an executableSource code(sketch) is compiled to an executableformatformat• Executable file is linked with libraries and interpretedExecutable file is linked with libraries and interpretedinto a hex fileinto a hex file• Hex file is uploaded to boardHex file is uploaded to board• Starts executing right awayStarts executing right away
Cross CompilationCross Compilation• Compile on one machine, but the target is another machine.Compile on one machine, but the target is another machine.E.g.: compiling it on an Intel processor, compiling it for anE.g.: compiling it on an Intel processor, compiling it for anAVR processorAVR processor• avr-gcc – C compiler for AVR targets, gives a *.o fileavr-gcc – C compiler for AVR targets, gives a *.o file• avr-lnk – links library object files, results in a *.elf fileavr-lnk – links library object files, results in a *.elf file• avr-objcopy – change the *.elf file into Arduino compatible *.hexavr-objcopy – change the *.elf file into Arduino compatible *.hexfilefile
Running IDE on WindowsRunning IDE on Windows• Emacs or NotePad++ text editorEmacs or NotePad++ text editor• Gcc C compilerGcc C compiler• The debugger, gdbThe debugger, gdb• IDE provides one-stop solutionIDE provides one-stop solution
BlinkLEDExampleBlinkLEDExample• Pin 13 is represented by numeral 13Pin 13 is represented by numeral 13• digitalWrite() writes voltage values todigitalWrite() writes voltage values topinspins• delay() sets delays in millisecondsdelay() sets delays in milliseconds• HIGH – 5vHIGH – 5v LOW – 0vLOW – 0v
THE ENDTHE ENDTHANK YOUTHANK YOU

Recommended

PDF
Report on arduino
PPTX
Introduction to Arduino
PPT
Arduino
PPTX
Introduction to Arduino and Hands on to Iot
PPS
What is Arduino ?
PPTX
Arduino Workshop
PDF
Arduino presentation
PPTX
Embedded Systems - Training ppt
PDF
1. Introduction to Embedded Systems & IoT
PPT
Intro to Arduino
PPTX
Introduction to Arduino
 
PPT
IoT with Arduino
PPTX
PPT ON Arduino
PPTX
Arduino
PPTX
Introduction to Arduino
PPTX
Aurdino presentation
PDF
Arduino Workshop Day 1 - Basic Arduino
 
PDF
Introduction of Arduino Uno
PPTX
Basics of arduino uno
PPTX
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
PDF
Introduction to arduino
PPTX
Lesson sample introduction to arduino
PPTX
Arduino Microcontroller
PPTX
Ardui no
PPTX
Embedded system introduction
PDF
Arduino Workshop Day 2 - Advance Arduino & DIY
 
PPS
Arduino Uno Pin Description
PPSX
Arduino by yogesh t s'
PDF
introductiontoarduino-111120102058-phpapp02.pdf

More Related Content

PDF
Report on arduino
PPTX
Introduction to Arduino
PPT
Arduino
PPTX
Introduction to Arduino and Hands on to Iot
PPS
What is Arduino ?
PPTX
Arduino Workshop
PDF
Arduino presentation
PPTX
Embedded Systems - Training ppt
Report on arduino
Introduction to Arduino
Arduino
Introduction to Arduino and Hands on to Iot
What is Arduino ?
Arduino Workshop
Arduino presentation
Embedded Systems - Training ppt

What's hot

PDF
1. Introduction to Embedded Systems & IoT
PPT
Intro to Arduino
PPTX
Introduction to Arduino
 
PPT
IoT with Arduino
PPTX
PPT ON Arduino
PPTX
Arduino
PPTX
Introduction to Arduino
PPTX
Aurdino presentation
PDF
Arduino Workshop Day 1 - Basic Arduino
 
PDF
Introduction of Arduino Uno
PPTX
Basics of arduino uno
PPTX
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
PDF
Introduction to arduino
PPTX
Lesson sample introduction to arduino
PPTX
Arduino Microcontroller
PPTX
Ardui no
PPTX
Embedded system introduction
PDF
Arduino Workshop Day 2 - Advance Arduino & DIY
 
PPS
Arduino Uno Pin Description
1. Introduction to Embedded Systems & IoT
Intro to Arduino
Introduction to Arduino
 
IoT with Arduino
PPT ON Arduino
Arduino
Introduction to Arduino
Aurdino presentation
Arduino Workshop Day 1 - Basic Arduino
 
Introduction of Arduino Uno
Basics of arduino uno
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Introduction to arduino
Lesson sample introduction to arduino
Arduino Microcontroller
Ardui no
Embedded system introduction
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino Uno Pin Description

Similar to Arduino Platform with C programming.

PPSX
Arduino by yogesh t s'
PDF
introductiontoarduino-111120102058-phpapp02.pdf
PPTX
Introduction to the Arduino
PDF
Introduction to Arduino
PPTX
Arduino: On-board components description, IDE and Programming
PDF
aurduino-200107075953.pdf
PPTX
Arduino and c programming
PPTX
Introduction to Arduino Microcontroller
PPTX
Q2 Arduino Draft Q2 Arduino Draft Q2 Arduino Draft
PPTX
Introduction to Arduino
PDF
arduino
 
PPT
Arduino_CSE ece ppt for working and principal of arduino.ppt
PPT
Physical prototyping lab1-input_output (2)
PPTX
Ch_2_8,9,10.pptx
PDF
Arduino: Arduino starter kit
PDF
arduino
PDF
Lesson-4-Arduino-Programming-dsBasics.pdf
PDF
arduinoworkshop-160204051621.pdf
PPTX
Micro_Controllers_lab1_Intro_to_Arduino.pptx
 
Arduino by yogesh t s'
introductiontoarduino-111120102058-phpapp02.pdf
Introduction to the Arduino
Introduction to Arduino
Arduino: On-board components description, IDE and Programming
aurduino-200107075953.pdf
Arduino and c programming
Introduction to Arduino Microcontroller
Q2 Arduino Draft Q2 Arduino Draft Q2 Arduino Draft
Introduction to Arduino
arduino
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Physical prototyping lab1-input_output (2)
Ch_2_8,9,10.pptx
Arduino: Arduino starter kit
arduino
Lesson-4-Arduino-Programming-dsBasics.pdf
arduinoworkshop-160204051621.pdf
Micro_Controllers_lab1_Intro_to_Arduino.pptx
 

Recently uploaded

PPT
new Introduction to PACS.ppt Picture Archieving and communication and medicine
PDF
Presentation-on-Energy-Transition-in-Bangladesh-Employment-and-Skills.pdf
PPTX
Cloud vs On-Premises CMMS — Which Maintenance Platform Is Better for Your Plant?
PPTX
Step-by-step guide to designing standard a microbiology laboratory in pharmac...
PPTX
How to Use Mobile CMMS to Improve Maintenance Operations & Field Productivity
PPTX
Introduction Blockchains and Smart Contracts
PPTX
Optimizing Operations: Key Elements of a Successful Plant Maintenance Plan — ...
PPTX
firewall Selection in production life pptx
PPTX
Salesforce Bulk Connector V1 and V2 Deep Dive!
PDF
Enhancing Distributed Authorization with Lagrange Interpolation and Attribute...
PPTX
Power point presentation on introduction of software engineering
PPTX
Takt Time vs Cycle Time vs Lead Time.pptx
PPTX
Unit 1 Introduction to Information Technology in Business.pptx
PPTX
Best CMMS for IoT Integration: Real-Time Asset Intelligence & Smart Maintenan...
PPT
63490613-Boiler-Tube-Leakage-analysis-symptoms-causes.ppt
PPTX
Role of In Vitro and In Vivo Testing biomedical engineering
PDF
Narrows Planning Collective Transportation Capstone.pdf
 
PPTX
Revolutionizing Facilities Management with MaintWiz — AI CMMS for Smart FMaaS
PPTX
MECCA Empire – Hotel Shuttle System for the 2026 FIFA World Cup
 
PDF
Surveillance_Partner_Product_Training_20240120_KSA.pdf
new Introduction to PACS.ppt Picture Archieving and communication and medicine
Presentation-on-Energy-Transition-in-Bangladesh-Employment-and-Skills.pdf
Cloud vs On-Premises CMMS — Which Maintenance Platform Is Better for Your Plant?
Step-by-step guide to designing standard a microbiology laboratory in pharmac...
How to Use Mobile CMMS to Improve Maintenance Operations & Field Productivity
Introduction Blockchains and Smart Contracts
Optimizing Operations: Key Elements of a Successful Plant Maintenance Plan — ...
firewall Selection in production life pptx
Salesforce Bulk Connector V1 and V2 Deep Dive!
Enhancing Distributed Authorization with Lagrange Interpolation and Attribute...
Power point presentation on introduction of software engineering
Takt Time vs Cycle Time vs Lead Time.pptx
Unit 1 Introduction to Information Technology in Business.pptx
Best CMMS for IoT Integration: Real-Time Asset Intelligence & Smart Maintenan...
63490613-Boiler-Tube-Leakage-analysis-symptoms-causes.ppt
Role of In Vitro and In Vivo Testing biomedical engineering
Narrows Planning Collective Transportation Capstone.pdf
 
Revolutionizing Facilities Management with MaintWiz — AI CMMS for Smart FMaaS
MECCA Empire – Hotel Shuttle System for the 2026 FIFA World Cup
 
Surveillance_Partner_Product_Training_20240120_KSA.pdf

Arduino Platform with C programming.

  • 1.
    THE ARDUINO PLATFORMANDC PROGRAMMINGPRESENTED BYPRESENTED BYGOVIND JHAGOVIND JHA
  • 2.
    What is Arduino?Amicrocontroller board, contains on-board power supply, USB port to communicatewith PC, and an Atmel microcontroller chip.It simplify the process of creating any control system by providing the standard boardthat can be programmed and connected to the system without the need to anysophisticated PCB design and implementation.It is an open source hardware, any one can get the details of its design and modify itor make his own one himself.
  • 3.
    Arduino Development BoardArduinoDevelopment Board• Eight bit microcontroller – brain of the boardEight bit microcontroller – brain of the board• USB Port – to communicate with theUSB Port – to communicate with thedesktop/laptopdesktop/laptop• USB controller chip – manages USB transferredUSB controller chip – manages USB transferreddatadata• IO pins – board’s connection to the outside worldIO pins – board’s connection to the outside world• Quartz oscillator – board’s time keeperQuartz oscillator – board’s time keeper• Reset button – taking the board back to its initialReset button – taking the board back to its initialstatestate• External power jack – power from dedicatedExternal power jack – power from dedicatedsourcesourceCo-axial jack, but USB can also be used.Co-axial jack, but USB can also be used.
  • 4.
    Arduino UNO:Arduino UNO:Digitaloutput~: PWM.0,1: Serial port.In circuit SerialprogrammingAtmelMicroControllerAnalog input.Power SupplyUSB portPower input
  • 5.
    Input/output Pins (I/OPins)Input/outputPins (I/OPins)• Top and bottom rows of the boardTop and bottom rows of the board• Holes in the board which we can stick wires inHoles in the board which we can stick wires in• Holes are connected to the chips through traces on-boardHoles are connected to the chips through traces on-board• 14 Digital I/O pins on top [0-13]14 Digital I/O pins on top [0-13]• Highs – 5 voltsHighs – 5 volts Lows – 0 voltsLows – 0 voltsMax Current - 40 mAMax Current - 40 mA• 6 Analog input pins on the bottom [A0 – A5]6 Analog input pins on the bottom [A0 – A5]• Power output pins on the bottom [ 5v , 3.3 v ]Power output pins on the bottom [ 5v , 3.3 v ]• Reset pin to reset the board to initial state.Reset pin to reset the board to initial state.
  • 6.
    MicrocontrollersMicrocontrollers• Two microcontrollerson the boardTwo microcontrollers on the board• Main ATmega328 – 8 bit microcontrollerMain ATmega328 – 8 bit microcontroller• User programmable, runs user-written application codeUser programmable, runs user-written application codeCarries firmware, like bootloaderCarries firmware, like bootloader• ATmega16U2ATmega16U2• Handles the communication with the USB interface, notHandles the communication with the USB interface, notdirectly accessibledirectly accessible
  • 7.
    Storage and MemoryStorageand Memory•Non-volatile flash memory for storageNon-volatile flash memory for storage•32 kilobytes in size32 kilobytes in size•Static Random Access Memory (SRAM) for memoryStatic Random Access Memory (SRAM) for memory(volatile)(volatile)•3 kilobytes in size3 kilobytes in size
  • 8.
    ClockClock• 16 MHzclock speed ~ 16 million operations per16 MHz clock speed ~ 16 million operations persecondsecond• Helps synchronize all components togetherHelps synchronize all components together• Keeping track of occurrence of eventsKeeping track of occurrence of events
  • 9.
    Programming FirmwareProgramming Firmware•The ISCP headers can be used to program theThe ISCP headers can be used to program thefirmware on the boardfirmware on the board• ICSP1 for the main ATmega328 microcontrollerICSP1 for the main ATmega328 microcontroller• ICSP2 for the ATmega16U2 microcontrollerICSP2 for the ATmega16U2 microcontroller• Special equipment are required in order to re-Special equipment are required in order to re-program the firmware through these headersprogram the firmware through these headers
  • 10.
    Software EnvironmentSoftware Environment•Arduino IDE – Integrated Development EnvironmentArduino IDE – Integrated Development Environment• Can be programmed using other IDEs too, like EclipseCan be programmed using other IDEs too, like Eclipse• Arduino IDE is more versatileArduino IDE is more versatile• Needs no special drivers or additional componentsNeeds no special drivers or additional components• Available for Windows, Linux and MacAvailable for Windows, Linux and Mac• Cross compiler – compiles for a different target platform than the one beingCross compiler – compiles for a different target platform than the one beingprogrammed onprogrammed on
  • 11.
    IDE – SoftwareTool forIDE – Software Tool forProgrammingProgramming• File operations and other general options on topFile operations and other general options on top• Buttons for most commonly used options (Verify, Upload,Buttons for most commonly used options (Verify, Upload,etc.)etc.)• Main window – Text editor for writing codeMain window – Text editor for writing code• Message area – for messages to the programmerMessage area – for messages to the programmer
  • 12.
    Options ButtonsOptions ButtonsButtonson the top have the most common ,useful operationsButtons on the top have the most common ,useful operationsVerify – compiles the code and checks for errorsVerify – compiles the code and checks for errorsUploads – compiles the code, uploads it to the board. Works only ifUploads – compiles the code, uploads it to the board. Works only ifthe board is connectedthe board is connectedNew – creates a new sketch, a new programNew – creates a new sketch, a new programOpen – opens an existing sketchOpen – opens an existing sketchSave – saves the current sketch in the directory of your choiceSave – saves the current sketch in the directory of your choiceSerial Monitor – opens window to communicate with the boardSerial Monitor – opens window to communicate with the board
  • 13.
    Arduino ShieldsArduino Shields•The prominent reason that Arduino got so popularThe prominent reason that Arduino got so popular• Additional hardware to do particular, complex tasksAdditional hardware to do particular, complex tasks• Form of separate boardsForm of separate boards• Pre-wired pins that stick into holes in ArduinoPre-wired pins that stick into holes in Arduino• Stack on top of the Arduino to make connectionsStack on top of the Arduino to make connections• Pre-written functions for operations of these boardsPre-written functions for operations of these boards• Open-source designs in most of the cases, third partyOpen-source designs in most of the cases, third party•
  • 14.
    • IntegerInteger: usedwith integer variables with value between2147483647 and -2147483647.Ex: int x=1200;• CharacterCharacter: used with single character, represent value from -127 to128.Ex. char c=‘r’;• LongLong: Long variables are extended size variables for numberstorage, and store 32 bits (4 bytes), from -2,147,483,648 to2,147,483,647.Ex. long u=199203;• Floating-point:Floating-point: Numbers can be as large as 3.4028235E+38 andas low as -3.4028235E+38. They are stored as 32 bits (4 bytes) ofinformation.Ex. float num=1.291; [The same as doubledouble type]Data Types and OperatorsData Types and Operators
  • 15.
    Statement represents acommand, it ends with ;;Ex:int x;x=13;Operators are symbols that used to indicate a specific function:- Math operators: [+,-,* ,/,%,^+,-,* ,/,%,^]- Logic operators: [==, !=, &&, ||==, !=, &&, ||]- Comparison operators: [==, >, <, !=, <=, >===, >, <, !=, <=, >=]Syntax:;; Semicolon, {}{} curly braces, ////single line comment, /*/* Multi-lineco m m e nts * /* /Statement and OperatorsStatement and Operators
  • 16.
    Compound Operators:Compound Operators:++(increment)-- (decrement)+= (compound addition)-= (compound subtraction)*= (compound multiplication)/= (compound division)Statement and OperatorsStatement and Operators
  • 17.
    If Conditioning:If Conditioning:if(conditio n){state m e nts-1 ;…State m e nt-N;}else if(co nditio n2 ){State m e nts;}Else{state m e nts ;}Control StatementsControl Statements
  • 18.
    Switch case:Switch case:switch(var) {case 1 ://do so m e thing whe n var e q uals 1bre ak;case 2://do so m e thing whe n var e q uals 2bre ak;de fault:// if no thing e lse m atche s, do the de fault// de fault is o ptio nal}Control StatementsControl Statements
  • 19.
    Do… while:Do… while:do{Statements;}while(condition);// the statements are run at least once.While:While:While(condition){statements;}forforfor (int i=0; i <= val; i++){statements;}Loop StatementsLoop Statements
  • 20.
    Void setup(){}Void setup(){}Usedto indicate the initial values of system on starting.Void loop(){}Void loop(){}Contains the statements that will run whenever the system is poweredafter setup.Code StructureCode Structure
  • 21.
    Arduino Tool chainArduinoTool chain• Steps taken post code authoringSteps taken post code authoring• Source code(sketch) is compiled to an executableSource code(sketch) is compiled to an executableformatformat• Executable file is linked with libraries and interpretedExecutable file is linked with libraries and interpretedinto a hex fileinto a hex file• Hex file is uploaded to boardHex file is uploaded to board• Starts executing right awayStarts executing right away
  • 22.
    Cross CompilationCross Compilation•Compile on one machine, but the target is another machine.Compile on one machine, but the target is another machine.E.g.: compiling it on an Intel processor, compiling it for anE.g.: compiling it on an Intel processor, compiling it for anAVR processorAVR processor• avr-gcc – C compiler for AVR targets, gives a *.o fileavr-gcc – C compiler for AVR targets, gives a *.o file• avr-lnk – links library object files, results in a *.elf fileavr-lnk – links library object files, results in a *.elf file• avr-objcopy – change the *.elf file into Arduino compatible *.hexavr-objcopy – change the *.elf file into Arduino compatible *.hexfilefile
  • 23.
    Running IDE onWindowsRunning IDE on Windows• Emacs or NotePad++ text editorEmacs or NotePad++ text editor• Gcc C compilerGcc C compiler• The debugger, gdbThe debugger, gdb• IDE provides one-stop solutionIDE provides one-stop solution
  • 24.
    BlinkLEDExampleBlinkLEDExample• Pin 13is represented by numeral 13Pin 13 is represented by numeral 13• digitalWrite() writes voltage values todigitalWrite() writes voltage values topinspins• delay() sets delays in millisecondsdelay() sets delays in milliseconds• HIGH – 5vHIGH – 5v LOW – 0vLOW – 0v
  • 25.

Editor's Notes

  • #10 In circuit serial programmer

[8]ページ先頭

©2009-2025 Movatter.jp