기존 아두이노 스케치에 esp32 관련 내용을 설치 한적이 있다.

 

이전 참조글 : http://bigwavek.tistory.com/entry/esp32-%EC%95%84%EB%91%90%EC%9D%B4%EB%85%B8%EC%97%90-%EC%84%A4%EC%B9%98-%ED%95%98%EA%B8%B0

 

 

이걸 Sloeber Eclipse Arduino 에 옴기는 작업를 진행 했다.

 

아두이노 스케치에 설치 되어 있는 esp32 디렉토리를 복사해서 Sloeber Eclipse Arduino 아래 디렉토리로 복사한다.

 

 

예 : C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32

 

         ->  C:\sloeber\arduinoPlugin\packages\esp32

 

 

 

Sloeber 를 실행한다.

 

프로젝트의 오른쪽 마우스를 눌러 Properties 를 실행한다.

 

 

환경값을 Esp32 에 맞추어 준다.

 

 

 

빌드후 다운로드 하면 정상적으로 작동하는 것을 확인 할수 있다.

 

 

 

 

 

 

 

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

ttgo Esp32 보드 sloeber 에서 돌리기  (0) 2018.04.09
esp32 ttgo 보드  (0) 2018.04.06
arduino Eclipse 에서 사용하기  (0) 2018.04.05
esp32 아두이노에 설치 하기  (0) 2018.04.03
esp32 arduino 보드 설명  (0) 2018.04.02

Sloeber, Eclipse Arduino IDE 를 사용해서 Arduino 를 사용할수 있다.

 

원래 사용하던 아두이노 스케치를 깔필요 없이 Sloeber 자체에 설치 된다.

 

(Atmel Studio 7.0을 깔아보니 아두이노 스케치 환경을 가져 오는것 같다.)

 

 

Sloeber 사이트 : http://eclipse.baeyens.it/

 

해당 사이트 에서 다운로드 받으면 된다.

 

최신버전에 OS 에 맞추어 받으면 되고 windows 64bit 버전을 이용했다.

 

 

다운로드 받으면  " V4.2_win64.2017-11-20_02-16-52.tar.gz" 와 같은 파일이 저장 된다.

 

해당 파일을 압축을 풀어서 원하는 디렉토리에서 사용하면 되는데 디렉토리를 길게 하니

실행시 에러가 발생되었다.

 

그래서 C:\sloeber 디렉토리로 사용하였다.

 

 

 

그외에 초기 실행시 에러가 발생했는데 메세지나 나온 옵션을 제거하니 에러가 사라졌다.

 

설치가 완료된 이후 아두이노 사용 옵션을 설정해야 한다.

 

 

 

Arduino > Preferences 옵션에서 하용하고자하는 보드를 선택 해야 한다.

사용을 esp8266 으로 선택 했다.

 

 

 

설치 완료후 신규 프로젝트를 만들어 TEST 를 진행했다.

 

신규 생성된 프로젝트에서 오른쪽 마우스를 누르면 Properties 를 선택 하면 옵션을 선택 할수 있다.

 

 

 

 

연결된 모드 파일을 볼수 있었서 사용하기 편할것으로 보인다. 이것은 자동으로 설정 되었다.

 

 

친숙한 버튼을 이용해서 다운로드 실행해보니 잘된다.

문제는 upload 속도를 115200 으로 했는데 계속 19200 으로만 진행되었다.

그래서 다운로드 속도가 느려서 답답했다.

 

기타 설정 및 하드웨어 디버깅 관련해서 설정하는 방법은 아래 링크된 유투브 동영상을 참고 하면 좋을것 같다.

 

 

 

 

링크 주소 : https://www.youtube.com/watch?v=WFzVzgEA8Fo

 

 

그외 참고 사이트

 

http://blog.naver.com/PostView.nhn?blogId=opusk&logNo=220986318100

 

http://blog.naver.com/PostView.nhn?blogId=opusk&logNo=220990061816

 

 

ESP32 Sloeber 사용 동영상

 

 

 

링크주소 : https://www.youtube.com/watch?v=xJyNLcoG7Q0

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

esp32 ttgo 보드  (0) 2018.04.06
Esp32 환경 Sloeber Eclipse Arduino 옴기기  (0) 2018.04.05
esp32 아두이노에 설치 하기  (0) 2018.04.03
esp32 arduino 보드 설명  (0) 2018.04.02
여러 참고 사이트  (0) 2018.03.27

정식 사이트인 https://github.com/espressif/arduino-esp32/  에 접속해서

 

esp32 설치 메뉴얼을 보면 git용 프로그램을 설치 해서 사용하는 방법이 있는데 방법대로 하니

 

설치가 안된다.

 

그래서  http://lucid0sky.blogspot.kr/2018/02/esp32-arduino-ide.html  사이트에 있는 방법으로 설치 했다.

 

해당 사이트의 내용그대로 이미지로 올려 본다.

 

 

 

 

 

통신 속도는 115200으로 변경 하라고 합니다.

 

 

이후 사용하고자 보드로 선택을 하니

 

잘못된 라이브러리가 Arduino\hardware\espressif\esp32\libraries\BLE …. 라는 메세지가 나옵 니다.

 

화면을 보면 아래와 같습니다.

 

 

 

 

해결방법은 일본 사이트에서 찾았습니다.

 

일본 사이트 : https://www.mgo-tec.com/arduino-core-esp32-install

 

주요 내용은 해당 디렉토리에 라이브러리가 없으며, BLE 관련 된 부분은 다른 사람이 개발 하니 그쪽에서 받아서 사용해야 하다는 것입니다.

 

ESP32 BLE 라이브러리 사이트 :

https://github.com/nkolban/ESP32_BLE_Arduino/tree/6bad7b42a96f0aa493323ef4821a8efb0e8815f2

해당 사이트에서 zip 파일을 다운받습니다.

 

ZIP 파일을 열어서 설치 되어 있는 Arduino\hardware\espressif\esp32\libraries\BLE 디렉토치에 풀어 넣으면 됩니다.

 

 

주)

https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/ArduinoBLE.md 

 

사이트의 내용을 보면 라이브러리에서 esp32 ble arduino 로 검색해서 설치가 가능하다고 되어 있는데

해보지는 못했습니다. 


주)  정식 URL 이 있다.( 20190509)

https://dl.espressif.com/dl/package_esp32_index.json, 
http://arduino.esp8266.com/stable/package_esp8266com_index.json


 

 

 

 

 

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

Esp32 환경 Sloeber Eclipse Arduino 옴기기  (0) 2018.04.05
arduino Eclipse 에서 사용하기  (0) 2018.04.05
esp32 arduino 보드 설명  (0) 2018.04.02
여러 참고 사이트  (0) 2018.03.27
아두이노 멀티 소스 프로젝트  (0) 2018.03.27

esp32 관련 보드 2가지를 찾았다. PIN MAP 이 약간 다르다.

사용되는 USB 시리얼이 다르다.

아두이노에 설치 자체는 FireBeetle ESP32 IOT Microcontroller  이 편하다.

 

1. Espressif ESP32 dev boards

 

Espressif 사에서 나온 원본 이다.

설치는 수동으로 이루어진다.

 

참고 사이트 : https://www.esp32.com/viewtopic.php?t=344

 

아두이노 코아 소스 : https://github.com/espressif/arduino-esp32

 

설치 방법 1: http://lucid0sky.blogspot.kr/2018/02/esp32-arduino-ide.html

 

설치 방법 2: http://alexyun.tistory.com/288

 

회로도 :

ESP32-Core-Board-V2_sch.pdf

 

핀맵 :

 

2. FireBeetle ESP32 IOT Microcontroller 

 

참고 사이트 : https://www.dfrobot.com/product-1590.html

 

설치 방법 : https://www.dfrobot.com/wiki/index.php/FireBeetle_ESP32_IOT_Microcontroller_(Supports_Wi-Fi_%26_Bluetooth)_SKU:_DFR0478

 

회로도 :

[DFR0478]FireBeetle Board-ESP32(V1.0).pdf

 

핀맵:

 

 

 

 

 

 

 

아두이노 esp8266 교육사이트(원본)

https://arduino-esp8266.readthedocs.io/en/2.4.0/index.html

 

esp8266 기반 교육 자료

http://embedded-lab.com/blog/category/esp8266-tutorials/

 

 

esp8266 oled 관련

https://github.com/ThingPulse/esp8266-oled-ssd1306

 

 

esp8266 을 스크레치 같은 그림 언어로 개발 하기

http://easycoding.tn/index.php/category/conferences/

 

 

아두이노 PC GUI 연결 프로그램 저작툴

https://devicedruid.com/about/

 

 

U8g library 설명

http://www.hardcopyworld.com/gnuboard5/bbs/board.php?bo_table=tech_etc&wr_id=15

 

 

U8g library 기반 추가 라이브러리

https://github.com/olikraus/m2tklib/wiki/m2tklib

 

 

OLED 설명

http://www.hardcopyworld.com/ngine/aduino/index.php/archives/762

 

 

U8G 라이브러리 기반 그림 출력 하기

https://kocoafab.cc/tutorial/view/448

 

 

아두이노 기반 프로젝트 모음

http://www.hardcopyworld.com/

 

https://www.kocoafab.cc/tutorial/all?level=1&page=0

 

 

아두이노 font 출력

http://blog.naver.com/PostView.nhn?blogId=compass1111&logNo=221077475023&redirect=Dlog&widgetTypeCall=true

 

 

아두이노 bitmap 출력

http://blog.naver.com/PostView.nhn?blogId=compass1111&logNo=221082215247&parentCategoryNo=&categoryNo=14&viewDate=&isShowPopularPosts=false&from=postView

 

 

아두이노 블루투스 한글 출력

http://orasman.tistory.com/341

 

ESP8266 관련 스터디 자료

http://answerofgod.tistory.com/category/Study/ESP8266%28WIFI%29,ESP32%28BLE,WIFI%29

 

 

아마존알렉사 연결

http://winchild.tistory.com/69

 

 

Visual Studio2015 Community 에서 개발

https://blog.naver.com/crucian2k3/220776868235

 

 

 

 

 

 

 

 

 

 

아두이노 IDE 에서 한개의 파일만 가지고 사용하기에 어려움이 많은데

멀티 파일로 사용이 가능하다.

 

텝 화면의 오른쪽 에 역삼각형 icon 이 있다.

 

 

이 버튼을 누르면 아래와 같이 신규 tab 을 만들수 있다.

 

 

신규 이름을 부여하면 파일이 추가로 등록 된다.

 

관리된는 소스폴더에 가서 보면 생성된 파일을 볼수 있다.

 

 

 

컴파일된것을보면 하나의 파일처럼 컴파일되어 따로 header 로 정의 하지 않아도 사용이 가능하다.

 

 

마찬가지로 폴더에  "xxxx.h" 파일을 생성해서 넣으면 자동으로 파일을 불러 온다.

 

 

위와 같이 같은 디렉토리에 있는 header 파일은 " " 사이에 넣어야 한다.

 

 

 

 

 

 

 

 

 

 

 

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

esp32 arduino 보드 설명  (0) 2018.04.02
여러 참고 사이트  (0) 2018.03.27
nodeMCU tft LCD 라이브러리변경(Adafruit ->Ucglib)  (0) 2018.03.26
nodeMCU에 ST7735 Tft Lcd 연결  (0) 2018.03.26
nodeMCU oled 드라이브 Adafruit  (0) 2018.03.26

Adafruit 를 사용해서 시험해보니 어느 순간 알수 없는 문제로 오동작이 발생한다.

그래서 해당 라이브러리가 문제가 있는것 같아서 다른 라이브러리인 Ucglib 로 변경해보았다.

 

라이브러리를 설치 한다.

 

 

 

예제소스는 Ucglib 아래의 GraphicsTest.ino 를 사용했다.

 

관련 소스를 바로 사용 할수 없어서 초기 부분만 변경 했다 나머지 부분은 기존 소스를 보면 되니

초기 선언부분만 올리겠다.

 

소스에서는 S/W TEST 도 가능하게 하였으나 실제 TEST 해보면 동작중 먹통이 되어버린다.

S/W 적인 방법은 사용을 안하는 것이 좋을것 같다.

 

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

 


#define dSPI_HW_DEF   1//1:hw spi , 0:sw spi

 

#if dSPI_HW_DEF
  #include <SPI.h>
#endif

 

#include "Ucglib.h"

 

#define OLED_PCLK     D5    //14
#define OLED_PDATA    D7    //13
#define OLED_PRESET   D1    //6
#define OLED_PCMD     D4    //2
#define OLED_PCS     D8     //15

 

#if dSPI_HW_DEF
  Ucglib_ST7735_18x128x160_HWSPI ucg(/*cd=*/ OLED_PCMD, /*cs=*/ OLED_PCS, /*reset=*/ OLED_PRESET);
#else
  Ucglib_ST7735_18x128x160_SWSPI ucg(/*sclk=*/ OLED_PCLK, /*data=*/ OLED_PDATA, /*cd=*/ OLED_PCMD, /*cs=*/ OLED_PCS, /*reset=*/ OLED_PRESET);
#endif

#define T 4000
#define DLY() delay(2000)

 

void setup() {

 

  Serial.begin(115200);
  delay(10);

 

  ucg.begin(UCG_FONT_MODE_TRANSPARENT);
  ucg.setFont(ucg_font_ncenR14_hr);
  ucg.clearScreen();

}

 

void loop() {

 

.........

}

 

 

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

 

 

 

 

 

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

여러 참고 사이트  (0) 2018.03.27
아두이노 멀티 소스 프로젝트  (0) 2018.03.27
nodeMCU에 ST7735 Tft Lcd 연결  (0) 2018.03.26
nodeMCU oled 드라이브 Adafruit  (0) 2018.03.26
nodeMCU oled 드라이브 U8g2  (0) 2018.03.23

Esp8266 nodeMCU 에 ST7735S (해상도 160*128 RGB) tft LCD 를 연결해 봤다.

 

먼저 ST7735 관련 라이브러리를 인스톨 해야 한다.

 

 

S/W SPI 방식과 H/W SPI 방식을 사용해 봤는데 H/W SPI 방식을 사용해야 할것 같다.

S/W SPI 방식은 너무 느려서 동작중 자체 RESET 이 걸렸다. (내부 와치독 동작으로 인해 발생되는것으로 판단된다.)

 

참고 자료는 아래와 같다.

https://forum.arduino.cc/index.php?topic=443787.0

 

http://microcontrollerkits.blogspot.kr/2015/11/esp8266-wifi-tftlcd.html

 

 

사용된 Tft lcd 는 아래와 같다.

 

 

 

연결 회로는 아래와 같다.

 

 

연결된 PIN MAP을 좀더 정리 했다.

 

 

소스상 주의할것은 CLK 과 DATA 는 변경되어서는 안된다.

 

#define dSPI_HW_DEF 1 로 정의 할 경우 H/W SPI로 사용되고 0일 경우 S/W SPI로 사용된다.

 

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

 

#define dSPI_HW_DEF   1//1:hw spi , 0:sw spi

 

#if dSPI_HW_DEF
  #include <SPI.h>
#endif


#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h> // Hardware-specific library

#define OLED_PCLK     D5    //14
#define OLED_PDATA    D7    //13
#define OLED_PRESET   D1    //6
#define OLED_PCMD     D4    //2
#define OLED_PCS     D8     //15

 

 

#if dSPI_HW_DEF
  Adafruit_ST7735 tft = Adafruit_ST7735(OLED_PCS,  OLED_PCMD, OLED_PRESET);  //h/w: cs,dc,rst
#else
  Adafruit_ST7735  tft(OLED_PCS, OLED_PCMD, OLED_PDATA, OLED_PCLK, OLED_PRESET);  // s/w: cs,dc,sid,sclk,rst
#endif

 

 

float p = 3.1415926;

 

void setup() {

 

  Serial.begin(115200);
  delay(10);
 
  Serial.println("Start..");

 


  // Use this initializer if you're using a 1.8" TFT
  tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
 
  uint16_t time = millis();
  tft.fillScreen(ST7735_BLACK);
  time = millis() - time;
  delay(500);

 


  // large block of text
  tft.fillScreen(ST7735_BLACK);
  testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. ", ST7735_WHITE);
  delay(500);

 

  // tft print function!
  tftPrintTest();
  delay(500);

 

  // a single pixel
  tft.drawPixel(tft.width()/2, tft.height()/2, ST7735_GREEN);
  delay(500);


  // optimized lines
  testfastlines(ST7735_RED, ST7735_BLUE);
  delay(500);

  testdrawrects(ST7735_GREEN);
  delay(500);

  testfillrects(ST7735_YELLOW, ST7735_MAGENTA);
  delay(500);


  tft.fillScreen(ST7735_BLACK);
  testfillcircles(10, ST7735_BLUE);
  testdrawcircles(10, ST7735_WHITE);
  delay(500);

 

  testroundrects();
  delay(500);

 

  testtriangles();
  delay(500);

 

  mediabuttons();
  delay(500);
}

 

 

void loop() {

}

 

void testlines(uint16_t color) {
  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, 0, x, tft.height()-1, color);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, 0, tft.width()-1, y, color);
  }

  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, 0, 0, y, color);
  }

  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, tft.height()-1, x, 0, color);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
  }

  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
  }
}

 

 

void testdrawtext(char *text, uint16_t color) {
  tft.setCursor(0, 0);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}

 

 

void testfastlines(uint16_t color1, uint16_t color2) {
  tft.fillScreen(ST7735_BLACK);
  for (int16_t y=0; y < tft.height(); y+=5) {
    tft.drawFastHLine(0, y, tft.width(), color1);
  }
  for (int16_t x=0; x < tft.width(); x+=5) {
    tft.drawFastVLine(x, 0, tft.height(), color2);
  }
}

 

 

void testdrawrects(uint16_t color) {
  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color);
  }
}

 

 

void testfillrects(uint16_t color1, uint16_t color2) {
  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=tft.width()-1; x > 6; x-=6) {
    tft.fillRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color1);
    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color2);
  }
}

 

 

void testfillcircles(uint8_t radius, uint16_t color) {
  for (int16_t x=radius; x < tft.width(); x+=radius*2) {
    for (int16_t y=radius; y < tft.height(); y+=radius*2) {
      tft.fillCircle(x, y, radius, color);
    }
  }
}

 

 

void testdrawcircles(uint8_t radius, uint16_t color) {
  for (int16_t x=0; x < tft.width()+radius; x+=radius*2) {
    for (int16_t y=0; y < tft.height()+radius; y+=radius*2) {
      tft.drawCircle(x, y, radius, color);
    }
  }
}

 

 

void testtriangles() {
  tft.fillScreen(ST7735_BLACK);
  int color = 0xF800;
  int t;
  int w = tft.width()/2;
  int x = tft.height()-1;
  int y = 0;
  int z = tft.width();
  for(t = 0 ; t <= 15; t++) {
    tft.drawTriangle(w, y, y, x, z, x, color);
    x-=4;
    y+=4;
    z-=4;
    color+=100;
  }
}

 

 

void testroundrects() {
  tft.fillScreen(ST7735_BLACK);
  int color = 100;
  int i;
  int t;
  for(t = 0 ; t <= 4; t+=1) {
    int x = 0;
    int y = 0;
    int w = tft.width()-2;
    int h = tft.height()-2;
    for(i = 0 ; i <= 16; i+=1) {
      tft.drawRoundRect(x, y, w, h, 5, color);
      x+=2;
      y+=3;
      w-=4;
      h-=6;
      color+=1100;
    }
    color+=100;
  }
}

 

 

void tftPrintTest() {
  tft.setTextWrap(false);
  tft.fillScreen(ST7735_BLACK);
  tft.setCursor(0, 30);
  tft.setTextColor(ST7735_RED);
  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_YELLOW);
  tft.setTextSize(2);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_GREEN);
  tft.setTextSize(3);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_BLUE);
  tft.setTextSize(4);
  tft.print(1234.567);
  delay(1500);
  tft.setCursor(0, 0);
  tft.fillScreen(ST7735_BLACK);
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(0);
  tft.println("Hello World!");
  tft.setTextSize(1);
  tft.setTextColor(ST7735_GREEN);
  tft.print(p, 6);
  tft.println(" Want pi?");
  tft.println(" ");
  tft.print(8675309, HEX); // print 8,675,309 out in HEX!
  tft.println(" Print HEX!");
  tft.println(" ");
  tft.setTextColor(ST7735_WHITE);
  tft.println("Sketch has been");
  tft.println("running for: ");
  tft.setTextColor(ST7735_MAGENTA);
  tft.print(millis() / 1000);
  tft.setTextColor(ST7735_WHITE);
  tft.print(" seconds.");
}

 

 

void mediabuttons() {
  // play
  tft.fillScreen(ST7735_BLACK);
  tft.fillRoundRect(25, 10, 78, 60, 8, ST7735_WHITE);
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_RED);
  delay(500);
  // pause
  tft.fillRoundRect(25, 90, 78, 60, 8, ST7735_WHITE);
  tft.fillRoundRect(39, 98, 20, 45, 5, ST7735_GREEN);
  tft.fillRoundRect(69, 98, 20, 45, 5, ST7735_GREEN);
  delay(500);
  // play color
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_BLUE);
  delay(50);
  // pause color
  tft.fillRoundRect(39, 98, 20, 45, 5, ST7735_RED);
  tft.fillRoundRect(69, 98, 20, 45, 5, ST7735_RED);
  // play color
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_GREEN);
}

 

 

 

 

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

 

 

 

 

 

 

 

 

 

+ Recent posts