라즈에 아두이노ide 설치

BABY CAT·2023년 7월 17일
0

raspberrypi

목록 보기
8/13

아두이노설치

sudo apt-get install arduino

다운/업로딩/시리얼모니터 등을 사용하기 위해 시리얼 통신이 가능하도록 권한 부여

*아래 rxo 는 터미널 rxo@raspberrypi 의 rxo

sudo usermod -a -G tty rxo

sudo usermod -a -G dialout rxo

(디버깅)

/etc/sudoers.d/010_pi-nopasswd:1:10: 문법 오류

rxo roni ALL=(ALL) NOPASSWD: ALL

에러 > sudo visudo /etc/sudoers.d/010_pi-nopasswd > 로 들어가서

rxo roni ALL=(ALL) NOPASSWD: ALL 를 rxo ALL=(ALL) NOPASSWD: ALL 로 수정하면 디버깅 완료

다시

sudo usermod -a -G tty rxo

sudo usermod -a -G dialout rxo

실행

아두이노 보드/포트 잡아주기

포트는 ttyUSB

정상가동 확인


void setup() {

 // initialize digital pin LED_BUILTIN as an output.

 pinMode(LED_BUILTIN, OUTPUT);

 Serial.begin(9600);

}



// the loop function runs over and over again forever

void loop() {

 digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)

 Serial.println("LED On");

 delay(1000);            // wait for a second

 digitalWrite(LED_BUILTIN, LOW);  // turn the LED off by making the voltage LOW

 Serial.println("LED Off");

 delay(1000);            // wait for a second

}

디지털13번핀에 led연결 후 업로드 >

시리얼모니터에서 LED ON/OFF 출렦 및 LED 쩜멸 홖인

2개의 댓글

comment-user-thumbnail
2023년 7월 17일

많은 도움이 되었습니다, 감사합니다.

답글 달기
comment-user-thumbnail
2023년 7월 18일

많은 도움이 되었습니다, 감사합니다.

답글 달기