Arduino

Full Content


Arduino Minimum Code

 

Compiling Arduino code

 

 

Connecting the Arduino Uno

 

Upload Arduino Code to Board

How to include Zip library file to Arduino ?

  • First Download Zip file and save anywhere in the PC (Ex :Desktop)
  • Click “Add Zip library” in option of “Include Library” from “Sketch” tab .
  • Done.

 


Arduino Tutorial – Random Number Generator

randomSeed()

 

 

random()

 


Arduino IDE Installation

  • Download software
  • Click Arduino.exe file
    • Click I Agree
    • Select component to install
    • Click Close

Arduino IDE Uninstall

Arduino files are found in 3 locations:

  • The installation folder
  • The
    sketchbook folder, and
  • The Arduino15 folder.

The installation folder
should be removed when you uninstall but the other two folders remain so
you will need to remove those also to get a completely clean install.
The Arduino15 folder is located at:

  • On Mac OS X: /Users/(username)/Library/Arduino15
  • On Windows:  
    • Arduino IDE 1.6.5r5 and previous :C:\Users\(username)\AppData\Roaming\Arduino15
    • Arduino IDE 1.6.6 and later: C:\Users\(username)\AppData\Local\Arduino15
  • On Linux: /home/(username)/.arduino15    (a.k.a. ~/.arduino15)

If
you delete this folder then you will need to reinstall any Boards you
have installed using Boards Manager after you reinstall the Arduino IDE.

  • The sketchbook folder location is set in File > Preferences if you have any sketches or libraries that you want to save in there then back them up before removing it.

How do I remove a library from the arduino environment?

       The folder should contain a C or C++ file with your
code and a header file with your function and variable declarations. It
will then appear in the Sketch. Import Library menu in the Arduino IDE. To remove a library, stop the Arduino IDE and remove the library directory from the aforementioned location

Arduino Language

Arduino Structure

  • setup() – the setup() function is called when a sketch starts. (After each power up or reset)
    •  Use it to initialize variable, pin modes, start using libraries, etc.
  • loop() – its like a while loop

Arduino Functions

  • Digital I/O
    • pinMode()
    • digitalWrite()
    • digitalRead()
  • Analog I/O
  •  Time
    • mills()
    • micros()
    • delay()
    • delayMicroseconds()
  • External Interrupt
    • attachInterrupts()
    • detachInterrupts()
  •  Interrupts
    • interrupts()
    • noInterrupts()
  • Communication
  • Random Number

Arduino Libraries

  • EEPROM
  • Ethernet/Ethernet-2
  • Firmata
  • GSM
  • LiquidCrystal
  • SD
  • Servo
  • SPI
  • SoftwareSerial
  • Stepper
  • TFT
  • WiFi library
    • Board WiFi       Pins
      • Uno, Ethernet    –    D11, D12, D13.
      • Mega                 –   50, 51 and 52.
    • Functions
      • begin()
      • disconnect()
      • config()
      • setDNS()
      • SSID()
      • BSSID()
      • RSSI()
      • encryptionType()
      • scanNetworks()
      • status()
      • getSocket()
      • macAddress()

 

  • Wire Library – This library allows you to communicate with I2C / TWI devices.
    • BoardI2C        –    I2C / TWI pins
      • Uno, Ethernet    –    A4 (SDA), A5 (SCL)
      • Mega2560         –    20 (SDA), 21 (SCL)
      • Leonardo         –    2 (SDA), 3 (SCL)
      • Due                 –    20 (SDA), 21 (SCL), SDA1, SCL1
    • Functions
      • begin()
      • requestFrom()
      • beginTransmission()
      • endTransmission()
      • write()
      • available()
      • read()
      • SetClock()
      • onReceive()
      • onRequest()

 Arduino Uno Board Hardware

  • Arduino Board Crystal Frequency 16Mhz

Example Codes

Tutorials

  • Arduino Tutorials –  LiquidCrystal (Libarary Examples)

Need to study and work with following examples

Where the Arduino Binary file will be save in PC

  • C:\WINDOWS\TEMP\Folder (“arduino_build_130419”)