본문 바로가기
IoT/아두이노

PlatformIO Library 추가하기

by eeeun:) 2022. 1. 19.
반응형

VSCode - PlatformIO로 아두이노 프로젝트를 진행하는 중 CAN 통신과 OBD2 헤더가 없어서 에러가 났다!!!

 

보통은 Arduino IDE처럼 library에 들어가 헤더를 검색해 다운을 받으면 되지만 CAN를 검색해도 안 나옴!

(Platform IDE - HOME - 왼쪽 Libraries로 들어가면 헤더 검색 가능)

 

PlatformIO Registry에 들어가서 라이브러리를 다운받았다

https://registry.platformio.org/

 

PlatformIO Registry

The world's first package and project dependency management solution for embedded development

registry.platformio.org

 

PlatformIO Registry는 임베디드 개발과 관련된 자료를 찾기 좋은 사이트이다! 추천추천!😎

밑에 사진과 같이 여러 필터로 원하는 정보를 얻을 수 있다.

나는 library를 클릭해서 CAN 검색!

원하는 library에 들어가서 installation을 누르면 어떻게 쓰는지 자세히 볼 수 있다

 

✏️ 내가 사용한 CAN Library

platformio.ini를 열어 아래 코드를 넣어주면 해결 완료!

(VSCode 껐다 켜지 않아도 조금만 기다리면 됩니당~)

lib_deps = sandeepmistry/CAN@^0.3.1

 

라이브러리를 여러 개 추가할 때는 밑에 방식으로 하면 안 된다..

lib_deps를 한 번만 인식하는 것 같다

⚠ error!
lib_deps = sandeepmistry/CAN@^0.3.1

lib_deps = sandeepmistry/OBD2@^0.0.1

, 로 라이브러리를 추가해서 넣어주면 된다!!

lib_deps = sandeepmistry/CAN@^0.3.1, sandeepmistry/OBD2@^0.0.1
728x90

댓글