2014년 11월 18일 화요일

Note2 - Blink sketch

ArduinoNote List-page
PREVIOUS: Note1 - ARDUINO

Hand-on #1 : Blink



-Arduino를 경험해 본다.
-Sketch IDE를 설치, 간단한 Blink Example 따라하기

Preparation Materials




  • Arudino platform : Arduino Mega
    Arduino Mega
    (from http://Arduino.cc)



Arduino Mega

(* form http://duino4projects.com/multiserial-mega-using-arduino/)


























































Spec. Description
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 15 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by bootloader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz




Blink Sketch :




  • Load Blink Sketch : IDE의 파일>예제>Basics>Blink

    Blink example


  • Blink codes

    [code lang=cpp]
    // the setup function runs once when you press reset or power the board
    void setup() {
    // initialize digital pin 13 as an output.
    pinMode(13, OUTPUT);
    }
    // the loop function runs over and over again forever
    void loop() {
    digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }
    [/code]




Pin 13 회로도에서 살펴보자



L LED on Schemetic

Pin 13으로 L LED를 On/Off 한다.!



L LED on Board

Configuration Platform




  • IDE 메뉴의 도구>보드>Arduino Mega of Arduino Mega 2560
    Selett Serial Port



Compile




  • IDE 메뉴의 스케치>확인/컴파일
    Verify



Program




  • IDE 메뉴의 파일>프로그램어를통해업로드
    Upload



NEXT: Note3 - Hello world

댓글 3개: