인터넷 검색중 nodeMCU 에 간단한 회로를 첨부해서

소스와 함께 설명한 사이트를 찾았다.


기초적인 내용을 이해하는데 좋을 듯 하다


https://roboindia.com/tutorials/nodemcu-arduino



'공부 > arduino' 카테고리의 다른 글

nodeMCU wifi 연결  (0) 2018.03.12
nodeMCU analog input 업데이트  (0) 2018.03.10
nodeMCU pin MAP 다시보기  (0) 2018.03.09
nodeMCU 타이머(Ticker)살리기  (0) 2018.03.09
아두이노 멀티 장비 설정  (0) 2018.03.07

PIN MAP 선언 방법이 여러가고 소스마다 달라서 다시 확인 해 본다.

 

NODEMCU의 기본PIN MAP 은 아래와 같다.

 

  • D0 = GPIO16;
  • D1 = GPIO5;
  • D2 = GPIO4;
  • D3 = GPIO0;
  • D4 = GPIO2;
  • D5 = GPIO14;
  • D6 = GPIO12;
  • D7 = GPIO13;
  • D8 = GPIO15;
  • D9 = GPIO3;
  • D10 = GPIO1;
  • LED_BUILTIN = GPIO16
  •  

    #define PPPP D0 로 하면 해당 PPPP 가 D0 로 선언 된다.

    사용 방법은  pinMode(PPPP , OUTPUT);  이된다.

     

    마찬가지로

    int PPPP = 16;  으로 하고 pinMode(PPPP , OUTPUT); 으로 사용하면된다.

    즉 GPIO16 으로 선언을 16이라는 숫자로 선언이 가능하다.

     

     

    '공부 > arduino' 카테고리의 다른 글

    nodeMCU analog input 업데이트  (0) 2018.03.10
    nodeMCU 참고 사이드  (0) 2018.03.10
    nodeMCU 타이머(Ticker)살리기  (0) 2018.03.09
    아두이노 멀티 장비 설정  (0) 2018.03.07
    nodemcu led 구동  (0) 2018.03.07

    Ticker 를 살렸다.

     

    참고 사이트 : https://github.com/esp8266/Arduino/tree/master/libraries/Ticker

     

    ----------------- 소스  -----------------------

     

    #include <Ticker.h>

    #define LED D0


    Ticker flipper;
    unsigned int prt_index = 0;
    void flip_test();


    // the setup function runs once when you press reset or power the board
    void setup() {
      Serial.begin(115200);
      delay(10);
      Serial.println("Start..");
     
      // initialize digital pin LED_BUILTIN as an output.
      pinMode(LED, OUTPUT);

      flipper.attach(0.3, flip_test);    //start , ms
      //flipper.detach(); //stop
     
    }

    // the loop function runs over and over again forever
    void loop() {
     
      digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                       // wait for a second
      digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);                       // wait for a second
    }

    void flip_test()
    {
      prt_index ++;
      Serial.printf("%d",prt_index);
    }

     

    -----------------------------------------------

     

    그외 사항 :

     

    1. 기본 소스는 Ver 1.0 이다. 좀더 발전시킨 Ver 2.0 이 있다.

     

    https://github.com/sstaub/Ticker

     

    Ticker-master.zip

     

     

     

    2. TickerScheduler 도 참고할만한것 같다.

     

    https://github.com/Toshik/TickerScheduler

     

    TickerScheduler-master.zip

     

     

     

     

    '공부 > arduino' 카테고리의 다른 글

    nodeMCU 참고 사이드  (0) 2018.03.10
    nodeMCU pin MAP 다시보기  (0) 2018.03.09
    아두이노 멀티 장비 설정  (0) 2018.03.07
    nodemcu led 구동  (0) 2018.03.07
    nodeMCU H/W특징  (0) 2018.03.06

    아두이노에서 여러개의 보드를 사용하고자 한다면 아래와 같은 방법을 사용

     

    환경설정에서 사용하고자 하는 장비의 json 주소 링크를 한다.

     

     

    툴 > 보드 > 보드메니져 에서 사용하고자 하는 장비 검색후 인스톨 사용

     

    그럼 아래와 같이 여러개의 환경이 등록 된것을 확인 할수 있다.

     

     

    '공부 > arduino' 카테고리의 다른 글

    nodeMCU pin MAP 다시보기  (0) 2018.03.09
    nodeMCU 타이머(Ticker)살리기  (0) 2018.03.09
    nodemcu led 구동  (0) 2018.03.07
    nodeMCU H/W특징  (0) 2018.03.06
    nodeMCU 아두이노 설정  (0) 2018.03.06

    --------- 예제 소스 수정 -------------------------------------

     

    #define LED D0

     

    // the setup function runs once when you press reset or power the board
    void setup() {
      // initialize digital pin LED_BUILTIN as an output.
      pinMode(LED, OUTPUT);
    }

     

    // the loop function runs over and over again forever
    void loop() {
      digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                       // wait for a second
      digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);                       // wait for a second
    }

     

     

    --------- 다운로드 하면 아래 메세지 출력  ------------------

     

    스케치는 프로그램 저장 공간 247051 바이트(23%)를 사용. 최대 1044464 바이트.
    전역 변수는 동적 메모리 32864바이트(40%)를 사용, 49056바이트의 지역변수가 남음.  최대는 81920 바이트.
    Uploading 251200 bytes from C:\Users\bigwa\AppData\Local\Temp\arduino_build_669391/Blink.ino.bin to flash at 0x00000000
    ................................................................................ [ 32% ]
    ................................................................................ [ 65% ]
    ................................................................................ [ 97% ]
    ......                                                                           [ 100% ]

     

     

    '공부 > arduino' 카테고리의 다른 글

    nodeMCU 타이머(Ticker)살리기  (0) 2018.03.09
    아두이노 멀티 장비 설정  (0) 2018.03.07
    nodeMCU H/W특징  (0) 2018.03.06
    nodeMCU 아두이노 설정  (0) 2018.03.06
    아두이노 Nuvoton 관련  (0) 2018.03.05

    1. 통신속도 115200

    2. 보드 모양

     

     

    참고 : https://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/

     

     

    GPIO2(D4) 에 LED 있음 -> 통신시 LED 로 확인 가능

    GPIO16(D0) 에 LED 있음 -> 일반 구동 확인 가능

     

    RST 버튼 은 RESET용

    FLASH 버튼 + 전원 ON 또는 FLASH 버튼 + RST 하면 boot 로더진입 해서 신규 ROM 다운로드 가능

    단 esptool 또는 아두이노는 자동으로 다운로드진입 해서 별도작업 필요 없음

     

    GPIO0(Flash버튼) -> 일반구동시 KEY 입력으로 사용 가능

     

     

    '공부 > arduino' 카테고리의 다른 글

    아두이노 멀티 장비 설정  (0) 2018.03.07
    nodemcu led 구동  (0) 2018.03.07
    nodeMCU 아두이노 설정  (0) 2018.03.06
    아두이노 Nuvoton 관련  (0) 2018.03.05
    아두이노에 STM32 사용설정  (0) 2018.03.05

    1. http://arduino.esp8266.com/stable/package_esp8266com_index.json

    2. 보드메니져에서 esp8266 선택

    3. NodeMCU V1.0 선택후 사용

    '공부 > arduino' 카테고리의 다른 글

    nodemcu led 구동  (0) 2018.03.07
    nodeMCU H/W특징  (0) 2018.03.06
    아두이노 Nuvoton 관련  (0) 2018.03.05
    아두이노에 STM32 사용설정  (0) 2018.03.05
    아두이노 설치  (0) 2018.03.05

    1. 참고 사이트

     

    http://www.nuvoton.com/hq/support/tool-and-software/development-tool-hardware/numaker-uno/?__locale=en

     

    2. 설정 내용

     

    Arduino IDE & Board Installation Guide

    1. Download and Install the Nu-Link USB Driver.
    2. Download Arduino IDE from https://www.arduino.cc/
    3. Run Arduino IDE installer to install it on PC.
    4. Run Arduino IDE.
    Go to File → Preferences, enter the following URL to textbox of ‘Additional Board Manager URLs’
    https://raw.githubusercontent.com/OpenNuvoton/NuMaker-UNO/master/package_nuvoton_index.json
    5. Arduino IDE : go to Tools → Board → Boards Manager
    6. NuMaker UNO will show up on the list, select NuMaker UNO and click install.
    After the package download is finished, go to Tools → Board and select NuMaker UNO to use it.

     

     

    '공부 > arduino' 카테고리의 다른 글

    nodemcu led 구동  (0) 2018.03.07
    nodeMCU H/W특징  (0) 2018.03.06
    nodeMCU 아두이노 설정  (0) 2018.03.06
    아두이노에 STM32 사용설정  (0) 2018.03.05
    아두이노 설치  (0) 2018.03.05

    + Recent posts